Solved

How to keep App User ID

  • 29 August 2022
  • 3 replies
  • 1244 views

Badge +1

Hi guys, 

I'm trying to understand how to deal with "App User ID" and user accounts.

 

 

All good if I have the next flow:

  1. A user downloads an app.
  2. The user register in the app
  3. Based on the registered user account, I can generate an "App User ID" and send it to RevenueCat.
  4. Then, based on the registered user account, I always have access to the user "App User ID" because it is stored in my database and mapped to the registered user account.
  5. Later on, users can restore purchases anytime after they log in to the app. Because again, I have his "App User ID" stored in my database.

But what should I do if I have no user registration in the first place? Is it possible? 
 

For example:

  1. A user downloads an app.
  2. I generate some random "App User ID" based on the device UUIDD
  3. The user goes through onboarding screens with a PayWall in the end.
  4. The user makes a purchase. 
  5. All that I have now, it's his "App User ID" mapped to his device UUID, and that is it. If the user changes the phone or tries to log in on other platforms, I wouldn't be able t identify him because he has no user account in my database. 

So, I must somehow register the user at first to be able to map the "App User ID" with some account in my system, right? Or is there another way? Is it okay to create a user account after purchase?

 

​​​​​​​Thank You for your support!

icon

Best answer by Jens 30 August 2022, 10:21

View original

3 replies

Userlevel 5
Badge +7

You really only need to use an App User ID if you want the customer to be able to use their subscription / purchase on multiple devices. If they are only using one device, you can use the second flow. You don’t even need to create a random user ID yourself, the RevenueCat SDK does that for you (in fact, we would recommend you use RevenueCat’s anonymous user IDs as opposed to ones you randomly generated, because then the RevenueCat SDK knows that they are anonymous IDs and not proper user IDs).

If you are using the second flow and a customer uninstalls and reinstalls the app, or installs it on a different phone, you have to use the functionality to restore purchases to allow them access to their purchases. The purchases are associated with the App Store account (Apple ID) of the customer, and therefore the SDK can query for any previous purchases of that customer.

Lastly, about your last question: Yes, you can also create a user account after purchase. In that case, the anonymous user ID and the proper user ID are “aliased” in our system (i.e., our backend knows that they are two different identifiers for the same customer).

Badge +4

Helpful discussion. I would like some clarification though regarding App User ID and Custom User ID as it relates to free trials. I’ve posted a new question and just linked to it here (unable to delete the original reply).

 

What about "consumables and non-renewing subscriptions"?

https://www.revenuecat.com/docs/restoring-purchases#:~:text=Restoring%20Purchases%20for%20Consumables%20and,after%20the%20transaction%20is%20finished.

Reply