Listening for SyncPurchases / New Entitlements to arrive.

  • 4 May 2023
  • 1 reply

Badge +2

I’m currently setup with 

“Transfer to new App User ID”
for my
“Transferring purchases seen on multiple App User IDs” option.

Where should I be calling SyncProducts() that makes most sense?

Should it be if I call getCustomerInfo after signing in and it comes back empty?

If I do this, can I safely assume that I’ll never have to show the paywall screen and I can just display a waiting dialog until the new entitlements arrive in my listener?

At the moment, I’m just calling SyncProducts after sign in but I would like to hold off from displaying the paywall if I’m certain that the purchases are going to get transferred.

I could obviously just test this but as we all know, just because something SEEMS to be working, it doesn’t necessarily follow that it will consistently if the application runs contrary to convention.



1 reply

Userlevel 4
Badge +6

Hi @Rob Brooks,

Since .syncPurchases is a call that can occur without user intervention, you can call it where you like in your app - when it’s used for migrating subscriptions, we typically recommend calling it on launch. 

One scenario I can think of that .syncPurchases will not be able to catch is if an anonymous user has changed their device. In this scenario, .syncPurchases will attempt to restore from the receipt on the device but there won’t be one. For an anonymous user, .syncPurchases won’t trigger a restore from the store, so I’d recommend still having a .restorePurchases button that users can trigger in those cases. (We don’t recommend using .restorePurchases programmatically as it can cause an OS level sign in and be disruptive).