Reputation: 1192
I have an app in the app store, and have confirmed that my in-app purchases work for the latest official release. However some of my app users are crafty and they have the unreleased version of iOS. Should my app's in-app purchases still work for beta iOS versions? Because at least one maybe two users are reporting that their in-app purchases are not being marked as purchased correctly.
If you want specifics, nothing much is downloaded when my app marks the item as purchased. It simply writes a file in the docs directory and gives them unlimited plays.
UPDATE:
I have read in the Apple developers forums that
The “store kit flow”, is a process taken at the time of an attempt to purchase an "in app purchase" item such that the store kit determines that there is a problem with the user’s storekit account - for example, when the credit card information has expired. When this issue is detected, the user is given the option to be taken to the App Store app to update their account information. It used to be that the StoreKit would alert the user and ask them to fix the issue in the App Store app, when the issue was detected. Beginning with iOS 7, this check won’t bother the user until an actual charge is attempted - either when an app is requested for download or when a user attempts an in app purchase.
Consequently I think my code may have been finishing transactions early. Here is what I believe to be my relevant code with my suspicions marked. Can someone double check or clarify?
- (void)failedTransaction:(SKPaymentTransaction *)transaction //Working
{
//NSLog(@"failedTransaction.");
if (transaction.error.code != SKErrorPaymentCancelled)
{
// error!
NSLog(@"Transaction error: %@", transaction.error.localizedDescription);
[self finishTransaction:transaction wasSuccessful:NO]; //TODO: Remove this, it may be causing the bug with transaction errors in Multi Path Audio 1.1.4
}
else
{
//NSLog(@"failedTransaction, user just cancelled.");
// this is fine, the user just cancelled
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
}
}
Upvotes: 1
Views: 239
Reputation: 52538
You ABSOLUTELY MUST call finishTransaction ONLY when you have delivered the goods to the user. The sequence of actions is: Apple takes the user's money. You deliver the goods. You call finishTransaction. If you don't deliver the goods, that's fine, Apple will remember and ask you again until you call finishTransaction. If you call finishTransaction without delivering, you are cheating the customer.
If the users interaction with the store ends without the user handing over money, you will never be told about the purchase.
Upvotes: 1