Skip to main content
Solved

Purchases Incorrectly Assigned to Previous Customer ID on iOS after Login Switch

  • November 2, 2024
  • 2 replies
  • 98 views

Forum|alt.badge.img+1

I am integrating RevenueCat into both my iOS and Android applications, and I've encountered an issue with how purchases are assigned to customer IDs across different logins:

  1. On iOS: When I log in with Account A, set the customer ID to A (with revenuecat’s login), and make a purchase (not subscription), the purchase is correctly associated with customer ID A in the RevenueCat dashboard. However, when I log out and log in with Account B (in my app), set the customer ID to B (with revenuecat’s login), and make another purchase, the new purchase still gets associated with customer ID A instead of B.

  2. On Android: After logging out of Account A and logging in with Account B, the new purchase correctly associates with customer ID B as expected.

I've already set the “Restore Purchases Behavior” in RevenueCat to “Leave purchases on the original App User ID”.

Expected Behavior: My expectation is that purchases made by customer A should only be associated with customer ID A, and purchases by customer B should only be associated with customer ID B, without any crossover or confusion between them.

Could you help clarify why this is happening on iOS and how I can ensure that each account’s purchases remain isolated to their respective customer IDs, as it works on Android?

Best answer by jeffrey_bunn

Hi @hangyu-cde31f - it looks like Cody may have responded to your other post here, and I’ve linked his response below for reference:

That’s right - products purchased on iOS belong to the logged in Apple Account. Separate products can’t be attached to different app user IDs if they were purchased from the same Apple Account.

App user IDs allow us to link these transactions to an custom identifier, but the underlying transaction behavior (purchases all linked to one Apple Account) is a limitation on Apple’s end. 

 

An Apple receipt contains every purchase a customer has made (with the underlying Apple ID). When a customer logs into account A and makes a purchase, the purchase gets added to their receipt and we save it under customer A. When a customer logs into account B (but with the same underlying Apple ID), their purchase gets added to the same receipt. When we receive the receipt, we notice that customer A “owns” a previous purchase, and because of the “Leave purchases on the original App User ID” restore behavior you’ve selected, the purchase is associated with customer A.

Android behaves differently. Non-subscription purchases generate a completely different receipt, which is why customer A and customer B’s non-subscription purchases are being associated with each of their IDs. Subscription purchases behave a bit differently on Google - renewals are associated with the original receipt/customer that purchased the subscription, but if a subscription is cancelled, expires, and a new subscription purchase isn’t made for >60 days, this scenario will produce a new receipt.

For the behavior you’re hoping to have on iOS, the customer will have to log-in to a different underlying Apple ID, which I understand isn’t practical unless they’re logging in to different devices with different Apple IDs. I apologize that you’re not seeing the flow you’d like to see on iOS, but I hope this makes sense. Thanks.

View original
Did this post help you find an answer to your question?
This post has been closed for comments

2 replies

Forum|alt.badge.img+1

@sharif Could help review this question? Thanks.


jeffrey_bunn
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 288 replies
  • Answer
  • November 8, 2024

Hi @hangyu-cde31f - it looks like Cody may have responded to your other post here, and I’ve linked his response below for reference:

That’s right - products purchased on iOS belong to the logged in Apple Account. Separate products can’t be attached to different app user IDs if they were purchased from the same Apple Account.

App user IDs allow us to link these transactions to an custom identifier, but the underlying transaction behavior (purchases all linked to one Apple Account) is a limitation on Apple’s end. 

 

An Apple receipt contains every purchase a customer has made (with the underlying Apple ID). When a customer logs into account A and makes a purchase, the purchase gets added to their receipt and we save it under customer A. When a customer logs into account B (but with the same underlying Apple ID), their purchase gets added to the same receipt. When we receive the receipt, we notice that customer A “owns” a previous purchase, and because of the “Leave purchases on the original App User ID” restore behavior you’ve selected, the purchase is associated with customer A.

Android behaves differently. Non-subscription purchases generate a completely different receipt, which is why customer A and customer B’s non-subscription purchases are being associated with each of their IDs. Subscription purchases behave a bit differently on Google - renewals are associated with the original receipt/customer that purchased the subscription, but if a subscription is cancelled, expires, and a new subscription purchase isn’t made for >60 days, this scenario will produce a new receipt.

For the behavior you’re hoping to have on iOS, the customer will have to log-in to a different underlying Apple ID, which I understand isn’t practical unless they’re logging in to different devices with different Apple IDs. I apologize that you’re not seeing the flow you’d like to see on iOS, but I hope this makes sense. Thanks.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings