Android In-app purchase: how to consume?

前端 未结 2 1324
一生所求
一生所求 2021-01-05 16:41

I\'ve implemented Google In-App Billing V3 in my app and i did my first test purchase. Now, as seen that i want it consumable, but if i click the \"Purchase\" button again i

2条回答
  •  别那么骄傲
    2021-01-05 16:54

    As stated in the official documentetion: https://developer.android.com/google/play/billing/billing_reference.html

    The response intent to the purchase includes several fields, one of them being:

    INAPP_PURCHASE_DATA A String in JSON format that contains details about the purchase order. See table 4 for a description of the JSON fields.

    Inside that JSON, you have several fields, also explained in that page, the one you are looking for is:

    purchaseToken A token that uniquely identifies a purchase for a given item and user pair.

    All these is quite easy to follow from the official sample application, which I recommend you to download and try out, also to check the code.

提交回复
热议问题