Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

subscribed in-app renewal broadcast in android

I have implemented in-app purchase for subscription product, It's working fine. I have set 1 month subscription for each product, and it will get renew after 1 month.

Now my question is does there any way to get renewed product list and renewal date?

Does google provide any kind of service or event through which we can get to know about renewal.

like image 894
Ravi Avatar asked Feb 11 '16 09:02

Ravi


1 Answers

Unfortunately, the In-app Billing API v3 does not provide any event or kind of way to be notified of subscription renewal or cancelation.

The only thing that you can do is manually query the API to retrieve the currently activated subscription. (This is valid for the Android API as well as the http based ones…)

The way to do this is from an Android client is :

  • Query the inventory as you usually do to get the list of products with IabHelper#queryInventory(boolean querySkuDetails, List<String> moreItemSkus, List<String> moreSubsSkus)

  • If the user has an active subscription, you will be able to get the purchase about it with IabHelper#getPurchase(String sku). The purchase will contain the information about the subscription state and time. (doc here)

To do this with the Google Play Developer API (from your serveur), you have to use get, the informations will be in the ressource returned.

like image 179
meynety Avatar answered Oct 10 '22 21:10

meynety