Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get the original transaction receipt for a subscription?
    primarykey
    data
    text
    <p>In my app I'm trying to implement a Restore Purchases button, but I can't figure out how to get the latest purchase receipt for a subscription. I have only one SKProduct, an auto-renewable subscription.</p> <p>I just need to obtain the latest receipt and send it to the server for verification.</p> <p>I have tried this:</p> <pre><code>- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue { for (SKPaymentTransaction *transaction in queue.transactions) { if (transaction.transactionState == SKPaymentTransactionStatePurchasing) { NSLog(@"Purchasing"); } if (transaction.transactionState == SKPaymentTransactionStatePurchased) { NSLog(@"Purchasing"); } if (transaction.transactionState == SKPaymentTransactionStateRestored) { NSLog(@"Restored"); } if (transaction.transactionState == SKPaymentTransactionStateFailed) { NSLog(@"Failed"); } } } </code></pre> <p>But I'm getting this:</p> <pre><code>2013-10-04 12:21:48.994 App[5289:60b] Purchasing 2013-10-04 12:21:48.995 App[5289:60b] Purchasing 2013-10-04 12:21:48.996 App[5289:60b] Purchasing 2013-10-04 12:21:48.996 App[5289:60b] Purchasing 2013-10-04 12:21:48.997 App[5289:60b] Purchasing 2013-10-04 12:21:48.998 App[5289:60b] Purchasing 2013-10-04 12:21:48.999 App[5289:60b] Purchasing 2013-10-04 12:21:48.999 App[5289:60b] Purchasing 2013-10-04 12:21:49.000 App[5289:60b] Purchasing 2013-10-04 12:21:49.000 App[5289:60b] Restored 2013-10-04 12:21:49.001 App[5289:60b] Restored 2013-10-04 12:21:49.001 App[5289:60b] Restored </code></pre> <p>I just need the latest receipt. How can I get that? The problem is that for some reason a user has purchased a subscription, but it failed to verify on my server. Why it failed - I don't know.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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. 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