AdaptySDK-React-Native icon indicating copy to clipboard operation
AdaptySDK-React-Native copied to clipboard

Android Missing PurchaseToken in AdaptyProfile

Open Aximem opened this issue 2 years ago • 11 comments

Description

For Android, In onPurchaseCompleted and AdaptyProfile there is no field purchaseToken.
We want to keep Google server notifications webhook on our side but we need this field to perform Google API call on purchases.subscriptions.get

This is what AdaptyProfile looks like on a "sandbox" subscription:

{
  "accessLevels": {
    "premium": {
      "activatedAt": "2024-03-18T08:02:26.000Z",
      "expiresAt": "2024-03-18T09:02:24.000Z",
      "id": "premium",
      "isActive": true,
      "isInGracePeriod": false,
      "isLifetime": false,
      "isRefund": false,
      "renewedAt": "2024-03-18T08:32:24.000Z",
      "store": "play_store",
      "vendorProductId": "XX",
      "willRenew": true,
      "android": {}
    }
  },
  "segmentHash": "not implemented",
  "customAttributes": {},
  "nonSubscriptions": {},
  "profileId": "767c2a48-a906-416d-ae85-44056a709466",
  "subscriptions": {
    "XX": {
      "isActive": true,
      "isLifetime": false,
      "vendorProductId": "XX",
      "store": "play_store",
      "vendorTransactionId": "GPA.XX",
      "vendorOriginalTransactionId": "GPA.XX",
      "activatedAt": "2024-03-18T08:02:26.000Z",
      "willRenew": true,
      "isInGracePeriod": false,
      "isRefund": false,
      "isSandbox": true,
      "renewedAt": "2024-03-18T08:32:24.000Z",
      "expiresAt": "2024-03-18T09:02:24.000Z"
    }
  }
}

For iOS it's OK since we only need transactionId.

How can I retrieve the purchaseToken from Adapty ? I couldn't find a way to.

System info

No response

Aximem avatar Mar 18 '24 15:03 Aximem

Because they want to use adapty integration with Pro package. its not hard to give purchaseToken. i'm developing app and integrating adapty.io. i want to use adapty io as secondary analyzer. when i made purchase there is no purchaseToken. because i'm validating purchase on server side like any other our apps. also there is no purchaseToken on adapty io server callback integration too. i see if i can not use integration why im using adapty io? and what is the purpose of free account if i need to get pro for integration with our backend? now im re-integrating react-native-iap

cenmob avatar Dec 25 '24 23:12 cenmob

Hi @Aximem @cenmob

We're going to add purchaseToken to the purchase result in upcoming releases

vladd-g avatar Sep 02 '25 12:09 vladd-g

Is there any development on this issue?

Cutta avatar Sep 30 '25 08:09 Cutta

Hi @Cutta, yes

vladd-g avatar Sep 30 '25 08:09 vladd-g

Hi @vladd-g Thanks for your quick response. When do we see this feature?

Cutta avatar Sep 30 '25 08:09 Cutta

Hi @vladd-g Thanks for your quick response. When do we see this feature?

This feature is planned for release in October.

StanislavMayorov avatar Sep 30 '25 13:09 StanislavMayorov

Hi Has this been resolved in the version released 2 days ago?

Cutta avatar Oct 17 '25 07:10 Cutta

@Cutta hi! No, it will be released in 3.12.0

StanislavMayorov avatar Oct 17 '25 10:10 StanislavMayorov

Hi @Cutta! RN SDK v3.12 won't be available in October because the Android SDK is still being tested (iOS 3.12 is published).

Next week I can provide access to the RN 3.12-alpha build which will include all features and documentation. However, the release will introduce some breaking changes and switching back to the previous version in case of a bug won't be convenient. RN v3.13 will most likely be tested right away for production.

StanislavMayorov avatar Oct 28 '25 12:10 StanislavMayorov

Hi @StanislavMayorov I'm waiting to verify my purchase for Android development on the backend. That's why I need a purchaseToken. I don't think I'm alone in this. Do you know of a best practice for this? Let's just stick with that until your solution arrives.

Cutta avatar Oct 28 '25 15:10 Cutta

@Cutta Is webhook event what you are looking for? Do you consider using server side integration?

StanislavMayorov avatar Oct 28 '25 15:10 StanislavMayorov

Google Play purchaseToken was added in v3.14.0. See the docs here.

StanislavMayorov avatar Dec 10 '25 11:12 StanislavMayorov