Android In App Billing Restore Transaction

前端 未结 2 1753
无人及你
无人及你 2021-01-07 13:49

My scenario of In App Billing implementation: 1. The Home screen shows the list of products which I am planning to sell. 2. The detail screen (Screen shown on selecting a li

相关标签:
2条回答
  • 2021-01-07 14:22

    In the Dungeons example, if you make a RESTORE_TRANSACTION request the response from the server will first call this function:

    onPurchaseStateChange(PurchaseState purchaseState, String itemId, int quantity, long purchaseTime, String developerPayload)

    and then: onRestoreTransactionsResponse(RestoreTransactions request,ResponseCode responseCode)

    0 讨论(0)
  • 2021-01-07 14:32

    Restore transactions should not be done frequently, possibly only on the app's first run (so you can restore purchases if the user reinstalled the app, etc.) You don't need it for purchasing a product.

    The BillingService offers separate methods for requesting a purchase and restoring transactions. Just call the appropriate one from the relevant activity. You only need one purchase observer, it doesn't matter how UI/activities are structured.

    0 讨论(0)
提交回复
热议问题