In-app billing workflow in a ListView

前端 未结 2 972
我在风中等你
我在风中等你 2021-01-06 09:52

I implemented in-app billing in Android application, have like 6 product they are like coins the user will buy in order to buy items in my app. The setup and the testing for

2条回答
  •  无人及你
    2021-01-06 10:21

    Since you're consuming multiple items, would suggest to use consumeAsync for multiple items method by passing your list of purchases. You can find it inside TrivialDrive sample app for Iab ver 3

    /**
     * Same as {@link consumeAsync}, but for multiple items at once.
     * @param purchases The list of PurchaseInfo objects representing the purchases to consume.
     * @param listener The listener to notify when the consumption operation finishes.
     */
    public void consumeAsync(List purchases, OnConsumeMultiFinishedListener listener) {
    

    Use onConsumeMultiFinished as your callback

    public void onConsumeMultiFinished(List purchases, List results);
    

    It should take care of sending proper async consume requests. Update you code and post any problems.

提交回复
热议问题