Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Elaborating on Shawn's answer, in <code>- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions</code> you probably have some code like this:</p> <pre><code>- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { switch (transaction.transactionState) { case SKPaymentTransactionStatePurchased: [self completeTransaction:transaction]; break; case SKPaymentTransactionStateFailed: [self failedTransaction:transaction]; break; case SKPaymentTransactionStateRestored: [self restoreTransaction:transaction]; default: break; } } } - (void) restoreTransaction: (SKPaymentTransaction *)transaction { /* Handle restore here */ [[SKPaymentQueue defaultQueue] finishTransaction: transaction]; } </code></pre> <p>You can handle nil productIdentifiers in <code>restoreTransaction:</code> by adding a check to see if the productIdentifier is nil, like this:</p> <pre><code>- (void) restoreTransaction: (SKPaymentTransaction *)transaction { if (!transaction.originalTransaction.payment.productIdentifier) { NSLog(@"productIdentifier is nil; Apple bug?"); [[SKPaymentQueue defaultQueue] finishTransaction: transaction]; return; } /* Handle restore here */ [[SKPaymentQueue defaultQueue] finishTransaction: transaction]; } </code></pre> <p>This technique fixed the problem for me in my app. The app started, logged "productIdentifier is nil; Apple bug?" and didn't crash. When I then manually re-restored transactions, Apple sent a valid transaction, and the app worked as designed.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload