可能有一噸的有關同一主題的問題,但我只是不明白恢復採購的含義以及恢復按鈕蘋果希望我在我的應用程序實現。應用程式purshase恢復過程
請有人可以回答這個問題,我是新來這個,這是我的第一個應用程序。 我有點失落了。由於
還原按鈕意味着: 當用戶按下它,它在,它返回他購買什麼都和拿錢回來 OR 它只是意味着用戶可以重新恢復了已經購買的物品-download什麼,他已經購買,卻沒有付出兩次嗎?(如果他刪除並重新安裝應用程序)
如果是第二個,不要蘋果的檢查是什麼?並設置警戒「你已經購買了這一點。點擊確定,重新下載」
我在代碼實現一個恢復按鈕,這樣可以嗎?是所有的蘋果想要?
////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)***
}
}
謝謝你的幫助。它現在更清晰! – George