I'm building a Flutter mobile app that uses RevenueCat with anonymous user IDs β there is no authentication or login system.
On first app launch, I store the user's anonymous appUserID
securely. If the user makes a purchase, I save their credit balance and subscription status in Firebase, keyed by this RevenueCat ID. I also call setAttributes
to store this ID (e.g. firebase_user_id
) as a RevenueCat customer attribute.
Now, my question is:
If the user uninstalls the app or switches to a new device (but uses the same Apple ID or Google Play account), and then taps restorePurchases()
(which creates a new anonymous App User ID), will the customer attributes from the original App User ID be automatically synced and transferred to the new user?
I would like to rely on that attribute (e.g. firebase_user_id
) to reconnect the user with their Firebase data β without requiring login or using a custom App User ID.
Alternatively:
Is there any way to access the original App User ID (i.e. the ID that RevenueCat links from the receipt during restore) from the new anonymous user after restorePurchases()
is called?
If customer attributes are not synced and transferred, can I use the originalAppUserId
returned in CustomerInfo
after a restore as a reliable way to locate and restore the userβs record from Firebase?
In this case, what is the recommended way to persist user identity and reliably restore their credit balance and subscription status from Firebase after reinstall or device change β while remaining fully anonymous and not requiring login?