Well first, all IAPs, except consumables, must be available to all devices owned by the same user. Second, it is very rare to have more than one user on a device. And in cases where there is more than one user, it is appropriate to have the user sign out of their App Store account before releasing the device to another user. You seem to indicate the other user has a different email address. Perhaps you actually mean they are using a different App Store account (Apple IDs) - that is the original user has signed out of their App Store account and the new user has signed in. In which case I think a refresh receipt (SKReceiptRefreshRequest) will generate a different receipt for that device. Try that.
Thanks PBK. I realize I wasn't really clear about the question I was asking. So the context here is that, I'm offering a cloud service where users create an Account with me and can have multiple Vaults associated with each account, e.g. 1, 2, 3, 4 Vaults and they are all part of different price tiers.
Basically, I have 2 issues that I'm trying to get clarifications for and have been pretty unsuccessful at finding resources:
1) I'm offering tiered auto-renew subscriptions, where the pricing goes as follow:
- PLAN A : 1 Vault = $4/month
- PLAN B : 2 Vaults = $9/month
- PLAN C : 3 Vaults = $14/month
- PLAN D : 4 Vaults = $20/month
The first issue is if a User signs up for PLAN A, and realizes he/she wants to upgrade to PLAN B, I'm not sure auto-renew subscription (or even non-renew) can elegantly support. What model do similar Apps use to handle this case, where it's seamless for users and minimal support for us?
2) A user can decide to create 2 Accounts with us (Account X with 2 Vaults, and Account Y with 2 Vaults), and want to use the same iOS device and Apple ID for the purchase. They basically login using either Account X or Account Y in the App, only one at a time.
Does IAP allow for multiple auto-renew purchases of the same plan (PLAN B in this example) using the same Apple Id? I am managing the expiration dates for each Account (X & Y) using receipt validation, but I cannot confirm whether IAP treated them as separate purchases in sandbox or single.
Any clarification/advice on the above questions will be greatly appreciated.
The answer to both of your questions is the same : Autorenewables won't do it, non-renewing subscriptions will.
1) how does a user convert from a $4 / month plan to a $9 / month plan in the middle of the month? using a non-renewing subscription they purchase the plan they want from the App Store. The device then determines how much 'credit' they have left over at the time they are making the purchase and it extends the expiration date by that amount. Here is a simple example. Sept 1 purchase $4/month plan. It's great so on Sept 8th purchase the $9/month plan. App says -
"Thanks for your conversion to the $9/month plan and your purchase of the first month. You have 3/4 of a month left over from the $4 plan - that's a $3 credit. That is 1/3 of a month on your $9/month plan. So your new expiration date is....October 18th (10 days beyond one month from now - October 8th)." And you write somewhere (e.g. your server or the device's keychain) the plan/expiration date $9/October 18. Then on October 18th (or anytime they actually want to use the service after October 18) tell them "Do you want to renew?"
2) Before the user makes a purchase ask them "Under which account do you wish to make a purchase" and then you record....it's easy with non-renewing subscriptions.
And the good news is they won't tell you "Your app has been rejected because you used autorenewable subscriptions. Please resubmit using non-renewing subscriptions." The bad news is that users who actually don't want to renew will not get their subscription automatically renewed.
This is actually a problem i currently have and trying to solve. I think I have solved it but I am not 100% sure I covered all my bases. What PBK is saying about being able to buy multiple purchases of the same autorenewable subscription is in fact correct. Apple will not allow them to make the same purchase. However, Apple's IAP framework will return a successful purchase if someone tries to buy a subscription that is already purchased.
This means if they do try to open a new account with the same Apple ID. They will be able to walk right through the payment process. This is also problematic for someone who gives their Apple ID to their friend to use to bypass the subscription.
The way I'm currently doing this check to see if someone already purchased the subscription is to store the transaction identifier under the user that bought the subscription and then after the payment would technically go through and Apple returns a successful payment but before you process this new account, you would check your database to see if anyone already has that transaction identifier. If so, you would reject this new account from being used.
I'm just a little stuck because there's different transaction identifiers that get made with these purchases and when they auto renew as well. But I found out that if theres an original transaction object on the payment transaction object after getting the success from Apple within the app, you would want to check your database with the original transaction identifier rather than the transaction identifier on the main object. (SKPaymentTransaction has a property claled originalTransaction and thats what I'm referring to)
Yes, you can use the transactionIdentifier of the originalTransaction to identify the singular purchase event. The easiest way to get this is to look in the receipt itself and look at the original_transaction_id field. In the transaction object returned in updatedTransactions you can look at the original transaction only in a restoreCompetedTransactions request - so it may be possible (I don't know) for a user to make a 'purchase' of a subscription they already own and get a free purchase and a return to updatedTransactions without an original transaction in it.
Of course, Apple requires that you provide a subscription to any device that logs in under the users iTunes Account so what you propose might run into problems. You are claiming that the user (who might have multiple iPhone devices) has only one account on your system - might that not be always true?
I am doing autorenew subscription for our app. I have a question here when I am testing in sandbox:
I enroll in autorenew subscription, and I have a server which is used for verification and see purchasing log: I can see that the subscription is autorenewed every five mintes, and lasts for about 30 minutes total. Everything is fine.
If, in the middle of the subscription, I use this sandbox account to buy some IAP item on another device. When I check the log of the original device, it's becoming very weird. (It feels like when you are using one account to buy two autorenew subscription in 8 hours).
Does anyone if this is expected in real life?
Thank you !