Hi guys,
A small subset of my users are stuck in a strange state where they cannot purchase anything because they apparently have the purchase but they also cannot restore.
I recently tried switching to a RMStore for cleaner code and to get rid of my messy homemade solution but the same issue is still happening for affected users.
For those familiar with RMStore my restore block looks like this:
[[RMStore defaultStore] restoreTransactionsOnSuccess:^(NSArray *transactions){
if ([SKPaymentQueue defaultQueue].transactions.count == 0) {
[self fail:@"There are no items available to restore at this time."];
} else {
for (SKPaymentTransaction *transaction in transactions) {
if (transaction.transactionState == SKPaymentTransactionStateRestored) {
if ([transaction.payment.productIdentifier isEqualToString:(NSString*)productID]) {
[Utils setPremium:YES];
}
}
}
[self success];
}
}
failure:^(NSError *error) {
//...
}];For whatever reason the affected users hit the ELSE case but do not have premium activated. The only possiblities are that the transaction doesnt match the product identifier or the transaction state is not SKPaymentTransactionStateRestored. I only have the one product and I haven't changed it since it was first created so I'm guessing the transaction state is the issue.
Should I be doing [[SKPaymentQueue defaultQueue] finishTransaction:transaction]; if transactions are found in the for loop that are not in the restore state? Is this bad practice? Could this potentially fix my users in a bad state?
Any suggestions would be greatly appreciated.