I've purchased a non-consumable product using my test user, but when I call this:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
I don't see any transactions in paymentQueueRestoreCompletedTransactionsFinished. The code looks like this:
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
{
NSLog(@"received restored transactions: %i", queue.transactions.count);
for (SKPaymentTransaction *transaction in queue.transactions)
{
[self restoreTransaction:transaction];
}
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Success" message:@"Your add-ons have been restored." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
return;
}
The log always shows "received restored transactions: 0", but I expect to see one transaction. Does anyone know why the transaction isn't being returned?
Now it suddenly started working! I only changed one thing, which was to go into iTunes Connect and edit the description of my product so that the status would change from "rejected" to "pending". The strange thing is that purchasing was still working (even in the "rejected" state), and only restoring didn't work. I tried restoring immediately after that change and it didn't work, but now (about 20 minutes later), the restore is working. Changing to pending must have fixed it (after the change had some time to propagate to the StoreKit servers), or else this is some kind of intermittent StoreKit bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With