Obj-C, Storekit restoreCompletedTransactions returns zero transactions?

↘锁芯ラ 提交于 2019-12-02 19:27:05
Malek_Jundi

try to do it like this and check the array count is it return zero also ?

- (void) checkPurchasedItems
{
   [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}//You 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];
  }
}

According to the docs:

When you create a new product to be sold in your store, you choose whether that product can be restored or not.

So the question is, is your product configured to allow restores?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!