Solved

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

  • 12 October 2022
  • 4 replies
  • 197 views

Userlevel 1
Badge +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);

 

icon

Best answer by Miguel Carranza 12 October 2022, 23:05

View original

4 replies

Userlevel 2
Badge +6

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.

Userlevel 1
Badge +9

@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?)

Userlevel 2
Badge +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.

Badge +2

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?

Reply