Skip to main content
Solved

Current app user id not original


Forum|alt.badge.img+5

Hi,

How can I get the current App user id not the original one?
We can have purchaserInfo?.originalAppUserId but I need current app user id to differentiate between different devices of a single user.

Best answer by Jens

Are you sure? I am not talking about PurchaserInfo / CustomerInfo.originalAppUserId, I am talking about Purchases.shared.appUserId. That one should not get overwritten with the original app user ID. 

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

7 replies

Jens
RevenueCat Staff
Forum|alt.badge.img+7
  • RevenueCat Staff
  • 178 replies
  • August 18, 2022

Hey @Alireza Nazer , would’t the current app user ID be the one that you passed to logIn()? 


Forum|alt.badge.img+5
Jens wrote:

Hey @Alireza Nazer , would’t the current app user ID be the one that you passed to logIn()? 

Hi, I don't provide an App User ID of my own , I receive anonymous app user id in purchaserinfo which is the original app user id but I need the current anonymous app user id because it can vary over different devices.

We can see it in webhook events but I need it in my app when it lunches.


Jens
RevenueCat Staff
Forum|alt.badge.img+7
  • RevenueCat Staff
  • 178 replies
  • August 22, 2022

I see. You can access the app user ID from the SDK (on iOS, there’s this method, on Android, you can access it through Purchases.sharedInstance.appUserId) .


Forum|alt.badge.img+5
Jens wrote:

I see. You can access the app user ID from the SDK (on iOS, there’s this method, on Android, you can access it through Purchases.sharedInstance.appUserId) .

Yes, you are right but it returns the original app user ID which can be different from current user id.

When user runs the app on tow different devises, it returns the same app user ID, but there is different current user ID`s in webhook.


Jens
RevenueCat Staff
Forum|alt.badge.img+7
  • RevenueCat Staff
  • 178 replies
  • Answer
  • August 23, 2022

Are you sure? I am not talking about PurchaserInfo / CustomerInfo.originalAppUserId, I am talking about Purchases.shared.appUserId. That one should not get overwritten with the original app user ID. 


Forum|alt.badge.img+5
Jens wrote:

Are you sure? I am not talking about PurchaserInfo / CustomerInfo.originalAppUserId, I am talking about Purchases.shared.appUserId. That one should not get overwritten with the original app user ID. 

Yes, You are right.

I made a mistake and “Purchases.shared.appUserId” is the one which I was looking for.

Thanks a lot.


Jens
RevenueCat Staff
Forum|alt.badge.img+7
  • RevenueCat Staff
  • 178 replies
  • August 24, 2022

Fantastic, that’s great to hear! 😄


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