Solved

How to know if isSubscribedInOldSystem in React Native

  • 29 March 2022
  • 1 reply
  • 76 views

Badge +5

I migrated my app to RC, however old subscribed users are having a sync problem.

 

Previously, I was using react-native-iap library for subscriptions and receipts validations in the client side. 

 

if (
isSubscribedInOldSystem // not able to get this information
&& !isSubscribedInRevenueCat
) {
Purchases.syncPurchases();
}

Because of RC, I had to remove react-native-iap from my packages.json to prevent crashes and libraries incompatibilities.

I never stored any users subscriptions informations and I am now unable to get the isSubscribedInOldSystem to syncPurchases. I need your help. Is there any way to proceed? 

 

Thank you in advance,

Paul

icon

Best answer by Tech Team 31 March 2022, 16:36

View original

1 reply

Badge +5

Hi! 👋🏻

I think for your case, where you don't have access to `isSubscribedInOldSystem`, your safest bet would be to do something like:
 

if (!isSubscribedInRevenueCat && !haveCheckedSinceMigration) {
Purchases.syncPurchases();
setHaveCheckedSinceMigrationToTrue();
}


Where the "haveCheckedSinceMigration" is something like a boolean that you store on the device (like using UserDefaults or sharedPreferences), that starts out false, and after the first time you call syncPurchases, gets set to true, and will stay true in future app launches.

This way you guarantee that you're being efficient with regards to syncing purchases, but you're also not leaving anyone out that had access before.

Hope this makes sense!

Andy

 

Thanks @Andy for your reply. 

Reply