Skip to main content
Question

Question about syncPurchases

  • February 14, 2025
  • 3 replies
  • 27 views

Forum|alt.badge.img

I have a question about the syncPurchases function when I have two users of my app on one Apple Id. What happens when I call syncPurchases after then calling logIn with another App User Id? I know that the restorePurchases function throws an error that the receipt is already in use (if I set transfer behaviour to not transfer), but syncPurchases does not do that. In fact, it doesn't do anything and I don't know what exactly is going on. Is it safe to call syncPurchases when users sign in to the app? Not on every startup but while calling my backend sign in function.

This post has been closed for comments

3 replies

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 313 replies
  • February 18, 2025

Hi ​@dawid-bytys,

Are you using it for subscriptions or consumable products? And do you have custom app ids or anonymous users?

 

Best,


Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • February 18, 2025

Hello ​@joan-cardona 

Yes, I am using it for subscriptions and yes I have custom app ids.


joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 313 replies
  • February 24, 2025

Hi ​@dawid-bytys,

Thanks for letting me know. Login in should already grant the user the valid entitlements they are entitled to. syncPurchases is safe to call at that time too to double check everything is fine. When you mentioned:

but syncPurchases does not do that. In fact, it doesn't do anything and I don't know what exactly is going on

do you mean that the user has not their purchases synced even calling it or that you don’t get any feedback as in it has been successful or not? It should return the latest updated CustomerInfo and it also throws an error if something has been unsuccesful.

Best,


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