Skip to main content

Hello everyone,

 

First of all thanks for a very well thought out product, entitlement, offering setup.

It is indeed well thought. 
I have an educational app. The app has react-native expo as front-end and Python FastAPI as backend.
My app has a monthly and yearly subscription options. I am pretty sure that it will stay that way. Meaning… It is very unlikely for me to add consumable goods, one-shot purchases, extra packages etc..

I am able to get subscriptions working for anonymous users. However, it is suggested that I use Purchases.login for more defined customer tracking. Fine 🙂 I tried it but I was not really successful.
Or, … it is successful but I did not get it. 

I have my own authentication and backend for my app.

So, I wanted to base subscriptions on user login info which is email as username and a password.
Once the user logs in, I would save the user email and also do Purchases.login() with email.
Once I get the subscription info after Purchases.login() I would check for activeSubscriptions array


const ci = await Purchases.logIn(u);

if (ci.customerInfo.activeSubscriptions.length !== 0)

which is also fine but the thing is Revenuecat uses Apple Id of the physical device.
Then it records my apps login info that is different in most cases or can be different.

For instance, I could borrow a friends iPad and want to login with my own account and subscription.
However, the paying account can be different but it shows with the Purchase.login email.

Then when I want to buy subscription with different email then the loggedin Apple Id on the device, it is not possible. Or is there any other way to buy subscription different than device’s loggedin Apple Id?

I find this quite confusing. 

If that is the case, is it better to just leave the customer info anonymous or always use the buying apple Id? So I can not get it working the way I wanted to.
What should I do?

I can not seem to get this working!
Please help!

I can not track users with emails. So I gave up on that.

When I try to use RevenueCatUI.presentPaywallIfNeeded it breaks my tab navigator so it seems I’m a bit stuck. Can anybody help?


OK, I was able to check for..

if (result.customerInfo.activeSubscriptions.length !== 0) {

finally and that gave me what I wanted so I could navigate away from Paywall.

Is this a good check?

İf I tried to match if (result.customerInfo.activeSubscriptions === <apple or google product > ) .. ,

That meant a lot of checks and if statements. So, I just checked if the user had an active subscription.
This way, I can store user email that was used for app account. ( Not Apple Id used in device ).

However, if someone borrowed an iPad and used it with my app, and used the app’s email account ( not the devices Apple or Google Id ) I still don’t know how to resolve that conflict.

So I still need help with that.

 


So, I noticed if you change the email you logged in to your device, revenuecat dashboard-overview changes the accounts email to the new one.

I think revenuecat does not track the apple id of the device but instead tracks Purchases.login() id.

So, cool so far. 

What I am wondering is this. 
If I make a purchase ( subscription ) with my app account email ( not apple id email and let’s say they are different ). Then if I login to the app at another device with even different apple id, will I be able to cary my subscription to the new device regardless of new devices apple id?
That would mean whatever email you logged into Purchases.login() your subscriptions are carried with that account and that would be cool.


Hi @yavuzakyazici! I’d suggest you review this document, as it describes how to identify users with RevenueCat and best practices. Identifying users with a custom user ID allows you to share subscriptions across devices and platforms, which it sounds like you’re looking to do. I’d also recommend reviewing this section, as email addresses are generally not recommend to use as app user IDs.

I would also recommend that you review this document, as it details what happens when a customer of yours restores purchases. You can decide whether purchases will be transferred, shared, or to stay with a single app user ID.


Hi Jeffrey,

Thanks for the answer. I wanted to think about this a bit.
So, I read the articles. At first, I thought why not email?

It is unique and you can keep it across platforms. Then in one of the articles, guessability is mentioned. OK. Fair. 

So, let me ask you this.

Is there anyway to keep the revenuecat user id at the backend api. My backend is with Python-FastAPI.
I can add a column to database and keep revenuecat id there. Will that work?

I can generate some combo of UUID or email+users reg date etc.. sth unique to user.
However, where am I gonna keep it? It will still be kept at backend DB right?

Instead, why could I not use the anonymous revenuecat id and keep it at the backend. 
Since it is coupled with users email, if user uninstalls and reinstalls, I can find that id from the db.
Or,, is it not safe to send over the wire?

The best practice of this a bit confusing to me.
So, if I did what you suggested, generate a unique id and use it as revenuecat subscription id, where can I keep it? I am using react native Expo. So I keep it at the client? May be Expo Secure Store?
This is where I am a bit lost.