Question

App_user_id with Guest ID at first then later with real Subscriber ID after successful login to my App

  • 21 February 2024
  • 1 reply
  • 14 views

Badge +3

Hi,

Our app is a subscription streaming with Monthly and Yearly package.

The current flow we want to use with RC are:

1) . Subscription Purchase but the user not login yet to the app. So still as a guest

Guest > Purchase > Successful 

Is it correct if we use this const { customerInfo, created } = await Purchases.logIn(guest_id); ?

Then we will force them to login before can use the full features of the app.

Login > successful

Because its already logged in, then we can get the actual subscriber_id for that user,

Is it correct if we use this const { customerInfo, created } = await Purchases.logIn(subscriber_id); ?

So in RC, the app_user_id will be updated with the latest one which is subscriber_id, whilst the original_app_user_id is still the original Anonyomous ID.

Then later, this user can login to any device / platform and still can get the same status of the subscription.

Is it my understanding on how to implement is correct?

Thank you


This post has been closed for comments

1 reply

Userlevel 4
Badge +6

Hey @awdur01 !

 

For your use case I would recommend just calling configure with no defined app user Id when you want to replicate the guest ID flow. This way, the user can still purchase a product. Once you have the app user ID, you can call the login() method which will change the current app user ID to the new subscriber ID that you have for this user when they are logged in. This will also merge the ID’s so the user likely wont need to restore purchases in this case. 

 

Let me know if that helps and if you have any other questions!