Skip to main content
Solved

What happens if we have to change the appUserId for the same user?

  • October 12, 2022
  • 6 replies
  • 697 views

Steph
Forum|alt.badge.img+9

We used to have an old format for handling user ids that we currently use to initialize RevenueCat with. What are the downstream implications if we need to change the user id format for all users? More specifically:

  1. Would there be a chance that the client gets out of sync from Google Play/App Store?  
  2. What are the downstream implications in RevenueCat’s dashes/data reporting?
  3. Are there any other implications from changing the user id format?

 

We are using Flutter so the code diff would be:

# current code
await Purchases.setup(_api, appUserId: oldUserIdString);

# new code
await Purchases.setup(_api, appUserId: newUserIdString);

 

Best answer by Miguel Carranza

Hi Steph, there is no way to change IDs in RevenueCat. What this code would do is essentially log in as a new, different user, with the new ID. Access to whatever was purchased will be initially lost.

 

Restoring purchases could merge both users together or transfer the purchase from the original user to the new one, depending on configuration. I would discourage changing the format for existing users, maybe use subscriber attributes if you need extra information server side.

View original
Did this post help you find an answer to your question?

6 replies

Miguel Carranza
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 84 replies
  • Answer
  • October 12, 2022

Hi Steph, there is no way to change IDs in RevenueCat. What this code would do is essentially log in as a new, different user, with the new ID. Access to whatever was purchased will be initially lost.

 

Restoring purchases could merge both users together or transfer the purchase from the original user to the new one, depending on configuration. I would discourage changing the format for existing users, maybe use subscriber attributes if you need extra information server side.


Steph
Forum|alt.badge.img+9
  • Author
  • Helper
  • 24 replies
  • October 13, 2022

@Miguel Carranza Thanks for answering!

To clarify, if users were to get merged, would they merge under the new `appUserId`? Also what configurations are relevant for changing how accounts get merged? At the moment we’re only initializing with the following code:

 

await Purchases.setDebugLogsEnabled(true);
await Purchases.setup(_api, appUserId: userId);
await Purchases.collectDeviceIdentifiers();
final String? adjustId = await adjustGetAdIdIfMobileApp();
await Purchases.setAdjustID(adjustId);


Lastly, if the user’s id changes and we’re automatically checking `Purchases.getPurchaserInfo()` during app cold start to check RevenueCat’s subscription state, would RevenueCat automatically also resync with App Store/Google Play for the user’s subscription state, or does RevenueCat assume the new user has no subscription? (i.e., does the user have to explicitly trigger the Restore Purchase flow to update the new user’s state in Revenue Cat with App Store/Google Play?)


Miguel Carranza
RevenueCat Staff
Forum|alt.badge.img+6

Hi Steph,

 

My bad, the alias (merging) mechanism is no longer an option. Merging will only happen between RevenueCat generated anonymous ids and provided app user ids, as shown in this table.

 

So there is no effective way to merge these customers. I was referring to the restore mechanisms configurable in the dashboard. You can either transfer the purchase to the new user (new user would “steal” the transactions) or block the restore. In any case, `getPurchaserInfo` will not do anything for the new user (it will be empty). You would have to trigger a restore.


Forum|alt.badge.img+2
  • New Member
  • 1 reply
  • December 28, 2023

We need the same capability as we’re changing the source of the user ID strings from Strava’s to our own identities hosted in firebase.  Any chance you could have a feature request to allow people to change identifies or are we forced to figure out a solution on our own?


Forum|alt.badge.img+9
  • Helper
  • 14 replies
  • October 22, 2024

Is this still not possible? @Mike Wood  did you ever figure out a solution?


Forum|alt.badge.img+5
  • Member
  • 5 replies
  • January 21, 2025

This functionality would also greatly help us out, is there any update on this feature request? ​@Miguel Carranza 


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