Reputation: 381
My app has individual non-consumable in-app purchases for sale, plus a "bulk" IAP which contains all the other IAPs at a discounted price. Therefore, before allowing the user to purchase an IAP, I need to know which other IAPs they have already purchased. The only way I know of to get this info is to call restoreCompletedTransactions. But Apple has rejected my app, saying I'm not allowed to call restoreCompletedTransactions before displaying the Confirm In-App Purchase dialog. AFAIK this dialog appears when a purchase is attempted. So I'm stuck. Does anyone have any ideas? Thanks!!
Upvotes: 1
Views: 495
Reputation: 105
I thing you couldnt make yourself clear about what you are trying to do. As I am trying to do the same thing let me explain.
When someone purchases a non-consumable IAP you give them some privileges.
In your case discounts, in my case some extra points.
When you dont know that it is the first purchase of the non-consumable IAP you will always give discounts when user press the buy button. You cant store it in NSUserDefaults or keychain because it wont help if user changes device.
So if user buys the IAP from a device, he gets discounts on that device, its cool but he can do this at every device he logs in with the same account. In order to prevent this you need to know if it is the first purchase or not.
Some can say that you should let him to get discounts. I dont know about what he is thinking but in my case I am giving the points for only once because he can make many points with just changing devices and that would be unfair...
Btw I came up with a solution for this but it is not very useful. You can make a gamecenter leaderboard called Pro Users and when someone buys your IAP you can give 100 points to that leaderboard. After that you can check the users score to see if he bought it already or not ...
Upvotes: 0
Reputation: 10398
What does your app do once a purchase is made? Surely it sets a flag or 2 to allow additional content to work? Can you not check for whats unlocked, then you'll know whats been bought.
If not, then simply store a value somewhere when a purchase is made.
Upvotes: 2