Question

Migrating from in_app_purchase: should I call the syncPurchases() function?

  • 31 January 2023
  • 1 reply
  • 50 views

Badge +3

The app stores are Play Store and App Store only and there is no back-end support. I am migrating from the official in_app_purchase plugin, should I call the syncPurchases() function?

 

The Purchases SDK automatically detects new transactions and sends them to RevenueCat. However, when migrating from an older system, you need to tell Purchases to sync to ensure we are tracking your subscribers correctly.

The way to do this is: if your existing subscription code knows you have a subscription, but RevenueCat does not, then restore transactions.

 

Can’t RevenueCat directly check with Play store or App store account to know this when a CustomerInfo is fetched?

Also, other than migrating, is there any other circumstances where I need to call this function? I see people calling (here and here) this function after or before performing a purchase and I am confused.

Can someone help? Thanks.


1 reply

Userlevel 4
Badge +8

The use case of syncPurchases would be to trigger a sync once per subscriber programmatically the first time they open a version of your app containing RevenueCat. You should not call this programmatically on every app launch for every user as this can increase latency in your app and can unintentionally alias users together, so do not call it as shown in the stack overflow link.

 

Please see our client-side migration guide here for the usage of syncPurchases in your case: https://www.revenuecat.com/docs/migrating-existing-subscriptions#client-side-migration

Reply