react-native-purchases
react-native-purchases copied to clipboard
purchaseSubscriptionOption uses incorrect/old UpgradeInfo.oldSKU field and fails to upgrade Android subscription
- [X] I have updated Purchases SDK to the latest version
- [X] I have read the Contribution Guidelines
- [X] I have searched the Community
- [X] I have read docs.revenuecat.com
- [X] I have searched for existing Github issues
Describe the bug
Calling purchaseSubscriptionOption with a GoogleProductChangeInfo argument fails to upgrade a subscription (adds a new subscription instead). The issue is that the implementation in the Android RNPurchasesModule uses the oldSKU
field from the old UpgradeInfo instead of the typed oldProductIdentifier
in GoogleProductChangeInfo. As a workaround I added oldSKU to the googleProductChangeInfo argument as well.
-
purchaseSubscriptionOption implementation that checks for
oldSKU
instead ofoldProductIdentifier
https://github.com/RevenueCat/react-native-purchases/blob/93ef699450e8b6a53aa4b42b95a49b1d10685527/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java#L209-L216 -
purchaseSubscriptionOption typed with GoogleProductChangeInfo https://github.com/RevenueCat/react-native-purchases/blob/93ef699450e8b6a53aa4b42b95a49b1d10685527/src/purchases.ts#L476-L480
Same issue in the community https://community.revenuecat.com/sdks-51/reactnative-sdk-purchasesubscriptionoption-not-applying-proration-and-oldproductidentifier-3520
- Environment
- Platform: Android
- SDK version: 7.2.0
- OS version:
- Xcode/Android Studio version:
- React Native version:
- SDK installation (CocoaPods + version or manual):
- How widespread is the issue. Percentage of devices affected.
- Debug logs that reproduce the issue
- Steps to reproduce, with a description of expected vs. actual behavior
- Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Additional context Add any other context about the problem here.
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Thanks for reporting and debugging @Markario. You're correct, that method is incorrectly parsing the old product identifier. We will release a fix for this issue soon.
Also found this issue to break our android upgrade flow
Sorry we forgot to update the issue here. A fix for this was released in 7.3.0. Please let us know if that solved your issue @Markario.
@ColeTownsend could you confirm what version you're using to confirm it's not the same error?
We are using 7.5.1, we had to change what values we were sending in the makePurchase function to include the new GoogleProductChange value in addition to the deprecated UpgradeInfo.
Wasn't sure if this was fixed/closed