Skip to main content
Question

Undo a transfer


Paul Finlay
Forum|alt.badge.img+5

On my app, users can log in anonymously ( a skip button) or with a full account. Some users due to perhaps not using the app for a long time, have to resign in, but have a tendancy to “skip” when they come back. This triggers a transfer of their purchase to the new anonymous account.

It would be great to have a button in the revenue cat panel to undo a transfer or an endpoint I could ping to do so or a way to prevent transfers to certain users.

2 replies

Forum|alt.badge.img+4
  • New Member
  • 2 replies
  • November 4, 2023

Hey Paul.

Not sure I’m qualified to answer, since I’m just now implementing it in my own app for the very first time.

I have thought about the same scenario you mentioned. What I came up with for now is the following:

I have a local state “last_known_server_user_id”, which is also persisted locally.
This is used for initiating revenue cat. it is null, until a user signs in for the first time → then I set it as the user ID from the server, and also call LogIn with RevenueCat, linking the anonymous account (and potential purchases) to the server user ID.

Now it could happen that, as you mentioned, my server signs the user out after some time. In my implementation though, since the last_known_server_user_id is still locally persisted and used to initialize RevenueCat, the user still has access to their subscriptions.

If a user signs in to a different account, you call RevenueCat login again, as well as save the newly logged in server user id in the local “last_known_server_user_id” state. 
If the user signs out, you call RevenueCat.logOut, and save null in the local “last_known_server_user_id” state.

I can’t see anything wrong with that for now but if there is, please let me know.

Hope I could help you with my thoughts,
Jacob


cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 497 replies
  • November 8, 2023

Hey @Paul Finlay!

It looks like Jacob had a good idea to manage this, you can also set your transfer behavior in our dashboard: https://www.revenuecat.com/docs/restoring-purchases

If needed, you can manually transfer entitlements in our dashboard as described here: https://www.revenuecat.com/docs/active-entitlements#transferring-entitlements


Reply


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