I want to have a system like netflix where I ask users to log in with email and using my custom auth backend, store the user info.
So user logs in on iOS device and purchases the subscriptions, and now can login to android device and get access to pro features (or vice versa). Achieving this so far is not the problem. The problem comes with the discrepancy where the source of truth of purchases is linked to the android or iOS account and not my app’s login.
So imagine, customer A logins in android device with email - firstname.lastname@example.org, and is also logged in his android id with the same email id, which is fine. But now if he logs out of my app and then log back in with another email id, say email@example.com, technically he should not have pro subscription. and since RC also stores both these users as separate account, the data I get from RC treats the user with firstname.lastname@example.org as a non-pro user.
But now if the email@example.com tries to purchase the subscription, he will get an error saying - You’re already subscribed to Pro, since his android account is still firstname.lastname@example.org
I can try to get the system logged in user account and use that to tie in the same user in another platform, but iOS does not provide that info in the app (AFAIK, correct me if I am wrong).
What can I use to identify users using the same email id across platforms so that they can share the same subscriptions?
Or How do I restore purchase of a user on a platform who has purchased subscriptions from another platform?
What is the correct solution to this issue? Any help on this is appreciated.
Best answer by sharifView original
This is expected behavior and there’s no one way to solve this for your customers because it’s a limitation of the OS itself. Purchases are handled by the App Store/Play Store and are attached to the App Store/Play Store account, so there are going to be cases where there’s a mismatch between the user logged into your app and the user logged into the device’s App Store/Play Store. Here are some workarounds:
As long as the purchases are in RevenueCat and you query RevenueCat’s API with the same user identifier as before, RevenueCat will return all subscription data.