xcode 应用内购买没有恢复按钮会导致拒绝

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10975312/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:33:39  来源:igfitidea点击:

No restore button for in app purchase causes rejection

objective-ciosxcodein-app-purchase

提问by Nidal Saed

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 offers In-App Purchase/s that can be restored but it does not include a "Restore" feature to allow users to restore the previously purchased In-App Purchase/s.

To restore previously purchased In-App Purchase products, it would be appropriate to provide a "Restore" button and initiate the restore process when the "Restore" button is tapped.

For more information about restoring transactions and verifying store receipts, please refer to the

我们发现您的应用提供了可以恢复的应用内购买,但它不包含“恢复”功能以允许用户恢复之前购买的应用内购买。

为了恢复之前购买的应用内购买产品,提供一个“恢复”按钮并在“恢复”按钮被点击时启动恢复过程是合适的。

有关恢复交易和验证商店收据的更多信息,请参阅

and there is no link to refer to, I have already implemented the:

并且没有链接可以参考,我已经实现了:

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions

with SKPaymentTransactionStateRestoredcase.

SKPaymentTransactionStateRestored案例。

but I didnt implement:

但我没有实施:

`restoreCompletedTransactions`  or `paymentQueueRestoreCompletedTransactionsFinished`

are these methods necessary for the in app purchase to be approved, or what is the exact problem.

这些方法是应用程序内购买获得批准所必需的,或者确切的问题是什么。

Thanks

谢谢

回答by Malek_Jundi

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

使用以下命令恢复用户从您的应用购买的产品 ID

- (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.

购买的商品 ID 将包含用户购买的所有产品 ID。您可以放置​​一个按钮,在完成后调用此函数,您可以显示所有这些产品,以便用户再次下载。