Solved

UserID Identification

  • 8 November 2021
  • 2 replies
  • 71 views

Badge +1

Hi, I want to use my own UserIDs that I have migrated from MYSQL Server via API. I read the documentation but got confused at one point.

I use the following to get the id of the logged in user in the application:

response.data!.mainUser!.userId!

So, during the installation of RevenueCat, am I use it like this to define my own user ids?

await Purchases.setup("public_sdk_key", appUserId: response.data!.mainUser!.userId!);

Thanks a lot…

icon

Best answer by cody 8 November 2021, 18:53

View original

2 replies

Userlevel 6
Badge +8

Hey @Enes UTKU!

Yep- if you have access to your user identifier when you’re configuring the RevenueCat SDK, you can pass the user ID property at that time. If you don’t have access to the user ID at that time (since we recommend initializing the SDK as soon as possible in your app’s lifecycle), you can identify with the user ID at any time by calling the `.logIn` method.

You can read more about Identifying Users in our documentation here: https://docs.revenuecat.com/docs/user-ids

Badge +1

Thank you. If I need to identify users as quickly as possible, pulling the user IDs on the splash screen will give the most accurate result, right?

Reply