Solved

Restore purchase after App delete and reinstall with anonymous user

  • 29 July 2021
  • 4 replies
  • 100 views

Badge

I have a “no login” app using anonymous ID’s and working fine in a sandbox environment.

The action to take is unclear when deleting and re-installing the app or moving to a new device.

When I delete the app and re-install, I allow the user to “restoreTransactions” which fails because the app now has a new anonymous ID. If I programmatically login with the original anonymous ID, then restore works as expected.

But I don’t want to be saving ID’s anywhere after the user removes the app, right?

Am I missing something simple?

icon

Best answer by cody 29 July 2021, 23:14

Hey @Paul Rekieta!

If you’re using anonymous IDs, and don’t want to use custom IDs/don’t have a custom auth system, restoring purchases is the way to go here. Restoring purchases takes a user’s device receipt and syncs it with RevenueCat’s backend, where we then grant the user access to the purchases by either transferring the receipt to the new user ID or aliasing the user IDs together, depending on your configuration.

If you’re seeing restoreTransactions fail, you’ll want to be sure you’re signed into the correct Apple ID/Google Play account as it will only sync the receipt of the current account.

View original

4 replies

Userlevel 3
Badge +6

Hey @Paul Rekieta!

If you’re using anonymous IDs, and don’t want to use custom IDs/don’t have a custom auth system, restoring purchases is the way to go here. Restoring purchases takes a user’s device receipt and syncs it with RevenueCat’s backend, where we then grant the user access to the purchases by either transferring the receipt to the new user ID or aliasing the user IDs together, depending on your configuration.

If you’re seeing restoreTransactions fail, you’ll want to be sure you’re signed into the correct Apple ID/Google Play account as it will only sync the receipt of the current account.

Badge

Thanks for the reply. It is working correctly when I test with a real device. The failure occurred when I was using a StoreKit configuration file. Perhaps it is expected to not work in that scenario?

Thanks for the reply. It is working correctly when I test with a real device. The failure occurred when I was using a StoreKit configuration file. Perhaps it is expected to not work in that scenario?

Hello @Paul Rekieta 

How could you make the app restore purchases after uninstall and reinstall again?

Hey @Paul Rekieta!

If you’re using anonymous IDs, and don’t want to use custom IDs/don’t have a custom auth system, restoring purchases is the way to go here. Restoring purchases takes a user’s device receipt and syncs it with RevenueCat’s backend, where we then grant the user access to the purchases by either transferring the receipt to the new user ID or aliasing the user IDs together, depending on your configuration.

If you’re seeing restoreTransactions fail, you’ll want to be sure you’re signed into the correct Apple ID/Google Play account as it will only sync the receipt of the current account.


Hello @cody 

If i have login system, how can i create custom IDs and restore purchases after reinstall the app on this basis?

Reply