Skip to main content
Solved

ReactNative SDK - purchaseSubscriptionOption not applying proration and oldProductIdentifier


Forum|alt.badge.img+1

Sorry if this has been answered elsewhere but we couldn’t find any information - hopefully someone can point us in the right direction.

We have 2 subscriptions set up in our Google Play Console, each with their own set of offers, and different pricing. Let’s call them SubscriptionA and SubscriptionB - the latter being a “higher tier” subscription (which gives access to more app features etc...).

Our users can purchase either of these subscriptions directly, however if they purchase SubscriptionA, first, we allow them to upgrade to SubscriptionB at any point. We have so far done it using  the purchasePackage method, like so:

Purchases.purchasePackage(package, undefined, {
  oldProductIdentifier,
  prorationMode: PRORATION_MODE.IMMEDIATE_AND_CHARGE_PRORATED_PRICE,
});

This would result in the user being charged the relevant pro-rated price, and the existing SubscriptionA switching to SubscriptionB. This works correctly, as expected.

However we are now facing an issue as we have an upcoming promotion, which means SubscriptionB now has 2 offers (i.e, different subscriptionOptions) between which we may need to choose. Hence, we are now trying to replace the above with the following:

Purchases.purchaseSubscriptionOption(subscription, {
  oldProductIdentifier,
  prorationMode: PRORATION_MODE.IMMEDIATE_AND_CHARGE_PRORATED_PRICE,
});

(subscription here refers to the relevant offer retrieved using the SDK method Purchases.getOfferings)

We would expect the above snippets to behave in the exact same way, however, the latter does not apply any pro-rata nor does it update the existing subscription for the user. Instead, it creates a new subscription, resulting in the user having 2 active subscriptions.

I hope all of this is clear, massive thanks in advance for any help you may provide!

Best answer by Mark Zepeda

@antoine-bugni-56dcb5 I ran into the same issue. After looking through the source I found that the implementation of purchaseSubscriptionOption doesn’t use oldProductIdentifier as described in the type. Instead it’s using oldSKU. Using oldSKU fixed the behavior for me on 7.2.0

 

Here’s the ticket in Github https://github.com/RevenueCat/react-native-purchases/issues/763

View original
Did this post help you find an answer to your question?

4 replies

Forum|alt.badge.img+5
  • Helper
  • 1 reply
  • Answer
  • November 1, 2023

@antoine-bugni-56dcb5 I ran into the same issue. After looking through the source I found that the implementation of purchaseSubscriptionOption doesn’t use oldProductIdentifier as described in the type. Instead it’s using oldSKU. Using oldSKU fixed the behavior for me on 7.2.0

 

Here’s the ticket in Github https://github.com/RevenueCat/react-native-purchases/issues/763


Forum|alt.badge.img+3
  • RevenueCat Staff
  • 55 replies
  • November 2, 2023

As @Mark Zepeda mentioned, this is an issue in our translation layer in the react-native-purchases SDK. We will ship a fix for this soon. Thanks for reporting it!


Forum|alt.badge.img+1

Sorry for not replying sooner - thank you both for your attention to this issue, we really appreciate it!


Forum|alt.badge.img+3
  • RevenueCat Staff
  • 55 replies
  • November 9, 2023

We released a fix for this in RNP 7.3.0: https://github.com/RevenueCat/react-native-purchases/releases/tag/7.3.0. Now we will accept oldProductIdentifier in addition to oldSKU.

Please check it out and let us know if you still run into issues!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings