Google Play Subscription Callbacks in App

so i am using InAppBillingService

google and i am facing problem.

There are two main types of operations:

  • A purchase that I had no problems with, the Google Play Developer API is now available, which allows our server to check if the purchase was successful, etc.

  • Subscriptions, here I am completely lost. First of all, there is simply no way to cancel a subscription to a subscription, and secondly, the answer to a purchase and a subscription is the same. But I want to have a callback to find out, for example, if the customer canceled the subscription or the money was transferred to the merchant account at the correct time.

Question: after reading this post Android requests to change subscription status in app , I released this question for callbacks wasn 'I really answered, I hope there was a change in implementation, allowing me to track payments every period or unsubscribe callbacks ... Any help is greatly appreciated.

+1


source to share


1 answer


You are correct that the In-app billing API does not currently support programmatic unsubscription support from within the in-app purchase. But you can cancel your subscription using the Google Play Developer API . Before you can use the API, you will need to create an API Console project, create a Client ID, and create a refresh token as described here .



The callback is not known when the subscription is canceled or renewed. You can track the purchaseState of the response INAPP_PURCHASE_DATA

when the application starts. purchaseState

is the status of the purchase order. Possible values ​​are 0 (purchased), 1 (canceled), or 2 (returned). But due to local caching, you cannot get the correct answer right away.

0


source







All Articles