Skip to main content
Solved

UserID Identification

  • November 8, 2021
  • 2 replies
  • 101 views

Forum|alt.badge.img+3

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…

Best answer by cody

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

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

cody
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • November 8, 2021

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


Forum|alt.badge.img+3
  • New Member
  • November 8, 2021

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


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