1
我的應用程序中實施了應用內購買以及恢復。我的問題是:如果我按下恢復按鈕並且沒有任何恢復,我怎麼能知道它?當沒有什麼可以恢復時顯示警報
現在,如果我點擊恢復按鈕,並且用戶之前購買了某些東西,它將恢復並顯示一條消息。但是如果沒有什麼可以恢復的話,它不會做任何事情,我想告訴用戶一些東西。
感謝
更新:
我通過檢查交易取得的一批固定的吧,如果是= 0,則沒有任何恢復:
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {
NSMutableArray *purchasedItemIDs = [[NSMutableArray alloc] init];
if (queue.transactions.count == 0) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You don't have anything to restore" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
}
for (SKPaymentTransaction *transaction in queue.transactions) {
NSString *productID = transaction.payment.productIdentifier;
[purchasedItemIDs addObject:productID];
[_transactionDelegate inAppPurchaseHelper:self transaction:productID didFinish:YES];
}
}
我無法得到它的工作..我使用InAppPurchaseHelper類,我正在恢復:'[[InAppPurchaseHelper sharedManager] restoreCompletedTransactionsBy:self];' – emiliomarin
您需要更新您的問題與相關細節你的問題。如果你不告訴我們你正在做的事情,只是陳述「不起作用」,沒有人能夠提供幫助。 – rmaddy
謝謝,我得到它的工作。起初我沒有聽到你說的話。 – emiliomarin