Note that there are some explanatory texts on larger screens.

plurals
  1. POSame app, same test user, two different devices with different SKPaymentQueue contents. What could cause this?
    text
    copied!<p>I have two iPhones I use for testing my app.</p> <p><strong>On Device A:</strong></p> <pre><code>NSLog(@"Unfinished Transactions: [%i]", [[SKPaymentQueue defaultQueue].transactions count]); </code></pre> <p>Which outputs: "Unfinished Transactions: [0]"</p> <p>When when I do a:</p> <pre><code>[[SKPaymentQueue defaultQueue] restoreCompletedTransactions] </code></pre> <p>the function </p> <pre><code>- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions </code></pre> <p>gets called with 17 items in the transactions array, each flagged as RESTORED. So, I loop over the set and call <code>[[SKPaymentQueue defaultQueue] finishTransaction: transaction]</code> on each. </p> <p>After processing each item, <code>(void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue</code> is called, and <code>[[queue transactions] count]</code> is equal to 4, not 17, which is something of a surprise. </p> <p>If I re-run <code>[[SKPaymentQueue defaultQueue] restoreCompletedTransactions]</code> on this device, I repeatedly get the same result - despite having told each transaction I want it removed from the queue, updatedTransactions gets called with 17 items to process.</p> <p><strong>On device B,</strong> </p> <pre><code>$NSLog(@"Unfinished Transactions: [%i]", [[SKPaymentQueue defaultQueue].transactions count]); </code></pre> <p>Still outputs "Unfinished Transactions: [0]"</p> <p>When I run </p> <pre><code>[[SKPaymentQueue defaultQueue] restoreCompletedTransactions] </code></pre> <p>, the function </p> <pre><code>- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions </code></pre> <p>NEVER gets called. Eventually </p> <pre><code>- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue </code></pre> <p>is called, with </p> <pre><code>[[queue transactions] count] </code></pre> <p>equal to 0. </p> <p>What could be causing this? It's almost like the payment queue is linked to the device ID, not the Test Account Apple ID. Also, please forgive the terrible formatting of this question, I'm still getting used to StackOverflow. :)</p>
 

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