可能有很多与同一主题相关的问题,但我只是不明白恢复购买的含义以及苹果希望我在我的应用程序中实现什么恢复按钮。
请有人回答这个问题,我是新手,这是我的第一个应用程序。我有点迷路了。谢谢
恢复按钮意味着:当用户按下它时,它会恢复已经购买的项目,它会返回他购买的东西并拿回钱 或者 它只是意味着用户可以重新下载他已经购买的任何东西而无需付费两次?(如果他删除并重新安装了该应用程序)
如果是第二个,苹果不检查吗?并为“您已经购买此产品。点击确定以再次下载它”设置警报
我在我的代码中实现了一个恢复按钮,够吗?这就是苹果想要的吗?
////Restore button tapped
{
[[RageIAPHelper sharedInstance] restoreCompletedTransactions];
}
// Then this is called form the code Above
- (void)restoreCompletedTransactions {
NSLog(@"Restore Tapped in transaction process");
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}
//Then This
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
NSLog(@"%@",queue );
NSLog(@"Restored Transactions are once again in Queue for purchasing %@",[queue transactions]);
NSMutableArray *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];
NSLog (@"product id is %@" , productID);
***////HERE////
what should i do here?
delete the item, as it is restored OR re-download it ?(depends on the question i asked above)***
}
}