Note that there are some explanatory texts on larger screens.

plurals
  1. PORestore button for iOS non-consumable in-app purchase
    text
    copied!<p>Apple have unfortunately rejected my app for not having a restore button. I wanted to have a seamless experience for the user but there are some problems. </p> <pre><code>- (void)purchaseProUpgrade { [[SKPaymentQueue defaultQueue] addTransactionObserver:self]; // User is prompted for iTunes username and password here (1) [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; } // Then this delegate Function Will be fired - (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue { if( queue.transactions.count == 0 ) { [self setUpgradeProductId]; // User is prompted for iTunes username and password here (2) SKPayment *payment = [SKPayment paymentWithProductIdentifier:kInAppPurchaseProUpgradeProductId]; [[SKPaymentQueue defaultQueue] addPayment:payment]; }else { [[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerTransactionSucceededNotification object:self userInfo:NULL]; } } </code></pre> <p>Is the above a good solution? The logic would be:</p> <ol> <li>User presses button to remove in-app purchase.</li> <li>Check if the user has already made a purchase (user has to enter username and password)</li> <li>If user has already made a purchase, restore</li> <li>If user has not already made a purchase,prompt for payment (user has to enter password again).</li> </ol> <p>The problems with this approach are: 1. An additional server call 2. User has to enter details twice.</p> <p>Has anyone actually implemented a Restore button that they can demonstrate? </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