Solved

When should I call syncPurchases?

  • 25 January 2023
  • 1 reply
  • 23 views

Badge +3

“This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation for subscriptions anytime a sync is needed, like after a successful purchase.”

Source: https://sdk.revenuecat.com/android/5.0.0/purchases/com.revenuecat.purchases/-purchases/sync-purchases.html

If I understand correctly syncPurchases:
1. upload the local device’s receipt to RevenueCat
2. Transaction might under another app user id, so if needed transfer going to happen.
3. The user access all entitlement based on the device’s receipt

Is it correct? 
If yes, I don’t understand why need to call “like after a successful purchase.”.

I assume purchaseProduct make a full sync with RevenueCat backend after the purchase, because the app should send the current receipt to the RC server, so why needed syncPurchases?

icon

Best answer by Haley Pace 28 January 2023, 00:57

View original

1 reply

Userlevel 1
Badge +4

Yes, you are correct in your understanding of the method. Sorry for the confusion, that documentation is outdated, we will be updating it soon with the correct information. 

The use case of this method would instead 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. This can increase latency in your app and can unintentionally alias users together.

Reply