Bo Z
Bo Z

Reputation: 2607

In App Purchases where I can get the token?

On official page https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get

the following HTTP request suppose to be send https://www.googleapis.com/androidpublisher/v3/applications/packageName/purchases/subscriptions/subscriptionId/tokens/token

As last parameter we need to send token. It says The token provided to the user's device when the subscription was purchased.

But how I can get it since there is no returned object after the subscription was done? Or I missed anything?

Upvotes: 2

Views: 3541

Answers (1)

Saeed Arianmanesh
Saeed Arianmanesh

Reputation: 1428

You can get it from purchase object purchase.getPurchaseToken() inside of onPurchasesUpdated() method. tokens are generated when purchase is successful.

related doc: https://developer.android.com/google/play/billing/integrate#launch

Upvotes: 2

Related Questions