No restore button for in app purchase causes rejection

前端 未结 1 1413
别那么骄傲
别那么骄傲 2020-12-08 01:02

I am implementing an application using in app purchase with non-consumables items, it was rejected by apple and the reason is:

We found that your app off

相关标签:
1条回答
  • 2020-12-08 01:47

    Use the following to restore the products ID's that user did purchased from your app

    - (void) checkPurchasedItems
    {
       [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
    }// Call This Function
    
    //Then this delegate Function Will be fired
    - (void) paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue
    {
      purchasedItemIDs = [[NSMutableArray alloc] init];
    
      NSLog(@"received restored transactions: %i", queue.transactions.count);
      for (SKPaymentTransaction *transaction in queue.transactions)
      {
          NSString *productID = transaction.payment.productIdentifier;
          [purchasedItemIDs addObject:productID];
      }
    
    }
    

    the purchasedItemIDs will contain all the product IDs that the user purchased it .. you could put a button to call this function when it finished you show all these products to enable the user to download it again.

    0 讨论(0)
提交回复
热议问题