Can someone please give me some clarification on the following scenario regarding anonymous users and the restorePurchases
method. I’ve been chasing my tail on this for a week.
Here’s the scenario:
- My app lets users use and subscribe to the app anonymously.
- RevenueCat creates an anonymous App User ID, when the user first opens the app.
- When the user subscribes, that anonymous ID is linked to the purchase.
- Webhook events list this anonymous ID in both the
app_user_id
andoriginal_app_user_id
fields.
Now, let's assume the user gets a new phone:
- They download and open the app, generating a new anonymous App User ID for the new device.
- The user clicks "Restore Purchases," and I call
restorePurchases()
from the SDK. - The
restorePurchases()
method returns aCustomerInfo
object containing anoriginalAppUserId
field.
My questions are:
- What value will be in the
originalAppUserId
field of theCustomerInfo
object after the restore?- The anonymous App User ID from the first device that originally purchased the subscription?
- Or the new anonymous App User ID generated for the new device?
- What values will be in the both the
app_user_id
andoriginal_app_user_id
fields of future webhook events? - If the user initiated a trial and then cancelled the trial before a payment processed, will the answers to questions 1 and 2 be the same?
Thank you for clarifying!