iOS in app purchase receipt with different itunes user
Asked Answered
O

1

12

I am using receipt validation locally on device and targeting iOS 7+

I am testing auto renew subscription in app purchase in the sandbox environment and I noticed this scenario.

-User A is signed in iTunes account on device, purchases subscription in app, gets app receipt. -User A signs out iTunes account on device and User B signs in -User B launches app -User B will continue using User A’s subscription because [[NSBundle mainBundle] appStoreReceiptURL] is valid and will return User A's receipt.

How come it doesn't return User B's receipt?

Ouabain answered 3/12, 2014 at 21:41 Comment(12)
What do you mean by "send"?Sublingual
Oops sorry, what I meant to ask was how come User B's receipt does not get returned from [[NSBundle mainBundle] appStoreReceiptURL] rather still User A's.Ouabain
I don't see why the receipt should change. appStoreReceiptURL returns a reference to a file. Why should that file change? This said, yes, the use of multiple Apple ID's/iTunes accounts by users does introduce complexities. Say, what if User B now makes a purchase. Restores, done using official Apple methods, are based on Apple ID. So a restore will only restore User A's or User B's purchases. Not both.Sublingual
Right, if I restore User A or B I will get their receipt respectively but only if I do a restore. My question is based on my scenario above, if User A logs out and User B logs in, I won't know this in my app. I want to know this so I can then prompt a refresh receipt.Ouabain
I don't think you can know this. Apple hides the Apple ID from you. Unless you do a restore every time the app launches. But this would be annoying to the user (to enter the password), and I don't know if you have to download assets based on the purchases.Sublingual
Yeah I was leaning towards that as well. I just wanted confirmation from other users. It is so weird that this is the intended behavior from Apple. So basically if I purchase a subscription service on an app and someone uses my phone and logs out of iTunes, he/she can use my app subscription service. Apple is indeed tying subscription service to the device.Ouabain
I think Apple is shooting for a typical use case of a phone or other mobile device as being a single user device. Do you have an application where multiple Apple ID's will be the common use case?Sublingual
@Dev_Sand, I just found out the exact same issue with my in-app purchase. Are you any wiser since your last post about it or is a restore of the receipt still the only way to deal with this issue?Sorosis
@soko It seems restoring of the receipt is the only way to deal with this issue.Ouabain
How often do you restore the receipt? Doing it on app start will prompt user to login which is kind of annoying. Have you come up with a better solution than this?Homeland
If user B have not made any purchases, Should user B get receipt of User A even after Restoring purchases? I have the same issue now.Shutdown
@Ouabain were you able to solve this issue. I have tried refreshing the receipt as well but still for user B it returns old user A receipt.Carhart
C
0

must refresh the receipt.

    SKReceiptRefreshRequest *request = [[SKReceiptRefreshRequest alloc] init];
    request.delegate = self;
    [request start];
Clout answered 18/3, 2019 at 13:1 Comment(1)
Even after refreshing the receipt it returns old user receipt while itunes user is changed.Carhart

© 2022 - 2024 — McMap. All rights reserved.