Hello, I am currently testing my Revenue Cat integration and have a problem when switching between different users. I use my own user ID, which I send to Revenue Cat after logging into my app using the .login-method. As soon as I make a purchase, however, all existing purchases are transferred to my current user ID and only the current user ID is listed in my sandbox overview. It does not matter whether a logout takes place beforehand or not.
Do I have to pay attention to anything else when switching between two users?
Thanks in advance.
Best answer by sundeepView original
So let me know if I have this wrong, but it sounds like you made a purchase on User A, and when you logged in and made a purchase on User B, the transactions from User A were transferred to User B. If you didn’t change the underlying Sandbox account when you switched to User B, then this is expected behavior with Transfer on Restore - the device receipt is the same between the two users, so the purchasing history will be transferred to the most recent user that makes or restores purchases: https://docs.revenuecat.com/docs/restoring-purchases
You’ll want to change Sandbox accounts when you test purchases on new users to avoid this.
But I have an app which different users may log in. For example, the user A logs in to my app and purchases an item. Then he logs out and the user B logs in to the app with a different userID. In this case, the revenuecat confuses and could not fetch the offering when the user B tries to subscribe. Also, if he manages to subscribe, he gets an error saying that he is already subscribed. I want each user with different IDs to have their own subscription account, even when they log in to the software from the same device. Is this possible without changing the sandbox or user acount?
If what you want is a scenario where two different users can log into the same device and subscribe to products separately without changing the underlying store account, that isn’t really possible, because the purchases themselves are made with the underlying store account.
You could look into our Block Restore restore behavior if all you want is to block one App User ID from accessing the subscriptions tied to a different App User ID: https://docs.revenuecat.com/docs/restoring-purchases#block-restores But even in that case, the user would get an error, that the receipt is already in use (by a different App User ID): https://docs.revenuecat.com/docs/errors#purchasing-errors. The user would then need to log in as user A to access the subscription, or change the underlying store account so they can make and restore purchases as user B.