Wrong behavior with multiple accounts on the same device with active subscription
complete
N
Nikita
I want to use your service to manage subscriptions across multiple platforms (iOS, Android, Web), because I have external authorization in my service. But I have a problem with the access level. For example:
I call Adapty SDK method - try await Adapty.identify("1")
I'm making an in-app purchase, then I retrieve a profile try await Adapty.getProfile()
In result I see "premium" access level is granted. It's ok.
Next, I log out of the profile and call Adapty.logout()
Now I want to log in with a different account, and I call SDK method - try await Adapty.identify("2"). But there's a problem here.
Both profiles have a "premium" access level. It's wrong, I want only one customer_id to have granted access level "premium". Do you have a solution for this case?
Adapty Support
complete
M
Mahesh Agrawal
@Dimitris the logic is its not possible to have 2 different account of apple or google from which you can purchase subscription. You can login to the settings with one email as main account which you will be using for subscriptions. So idea is to allow the user from our app to purchase sub from the account they are using in settings but when they purchase, it will be linked to the current logged in user in adapty and our goal is to restrict other app user to purchase from same device. but i am facing issue when user purchases from settings or upgrade/downgrade and at that time if my app user is not logged in and someone else is logged in, then its getting messed up.
M
Mahesh Agrawal
I have handled the above situation properly by mapping the vendorOriginalTransactionId with the customAttributes against the adapty user which is identified with my custom app user id. But i am having problem with the purchase upgrade/downgrade or re-subscribe from settings. Even if i logged in from a different app account, i am getting callback in the onLatestProfileLoad with same response. So there is the problem of differentiator. Please someone help out here.
M
Mahesh Agrawal
Above context, what if the update of transaction id fails from my server due to no internet or any reason, the user will have active subscription but they will never be able to use it. This is serious concern. Subscription should be linked to profile id. If thats not possible, atleast the record should be there in the response saying subscription purchase was happened using which profile id. We can crossmatch this in response and build logic, but without any help, this can lead to trouble.
M
Mahesh Agrawal
I have the same issue. My application has login system which is not directly linked to device apple id. So user can login to the app with different accounts. Now i logged in with multiple different accounts, but everyone getting same access level premium in profile response even though one person purchased the subscription. There is no field in the premium object which identifyes that this purchase was made for which user. I know asking for any change in the SDK will never be possible with just those data. My query about a solution to this problem is below but still there is a last problem i want solution.
In the response of profile or make purchase, we receive obje of subscriptions which clearly gives an object inside which there is a vendorTransactionId present. Once the purchase was successful, if we take this id and save in the backend, then next time someone else login with different account into my app, they will not have that transaction id in their profile. Because that was not saved for them. In that case, i will simply ignore the premium access level checking. I will always check which subscription is active in the users subscription object and if the vendorTransactionId for that subscription exists for my profile in my backend. If this condition satisfyes, then i can allow the person to see that its an active subscription.
The a final problem.
When the other user logins to my app and see they dont have subscription, and hit subscribe, the makePurchase is giving success with premium access. So how will i idenfity whether the current user is actually subscribing for first time or getting same response for every time. By the way apple popup says you already have a subscription but i get success. If i get an error saying you already subscribed, that would work but thats not happening. Please help.
V
Victor Murzaev, Adapty
Hello Nikita,
Thank you for highlighting this! Assuming you see this issue specifically on Apple devices. Such behavior comes from Apple requirements so if there is a receipt on a device, all the users will share the same access level on that device.
The Adapty "Identify" method does not grant access levels to users, it ties up the profiles created on separate devices to collect accurate statistics.
If your common scenario is one when a second user with their own access level logs in to a device on which first user purchased a subscription, you have to implement granting access levels on your side.
For example, if you receive an access_level_updated event for a new profile, but you already see an access level with such transaction id on your backend, you can choose which profile should be provided with an active access level and which should not.
We will look into that logic in the future and possibly make such an option available on our side but can provide no ETA for now.