gpt4 book ai didi

ios - 恢复应用内购买是否适用于 iTunes Connect 上的测试帐户?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:18:05 26 4
gpt4 key购买 nike

采购工作完美。但是,通过 iTunes Connect 上的测试帐户无法恢复应用内购买。这是正确的吗?我使用以下代码恢复购买:

... {
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
}

// called when a transaction has been restored and and successfully completed
- (void)restoreTransaction:(SKPaymentTransaction *)transaction {
[self recordTransaction:transaction.originalTransaction];
[self provideContent:transaction.originalTransaction.payment.productIdentifier];
[self finishTransaction:transaction wasSuccessful:YES];
}

// saves a record of the transaction by storing the receipt to disk
- (void)recordTransaction:(SKPaymentTransaction *)transaction {
if ([transaction.payment.productIdentifier isEqualToString:[self getProductId:gFullVersion]]) {
// save the transaction receipt to disk
[[NSUserDefaults standardUserDefaults] setValue:transaction.transactionReceipt forKey:[self getProductId:gFullVersion]];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}

// removes the transaction from the queue and posts a notification with the transaction result
- (void)finishTransaction:(SKPaymentTransaction *)transaction wasSuccessful:(BOOL)wasSuccessful {
// remove the transaction from the payment queue.
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];

NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:transaction, @"transaction" , nil];
if (wasSuccessful) {
// send out a notification that we’ve finished the transaction
[[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerTransactionSucceededNotification object:self userInfo:userInfo];
} else {
// send out a notification for the failed transaction
[[NSNotificationCenter defaultCenter] postNotificationName:kInAppPurchaseManagerTransactionFailedNotification object:self userInfo:userInfo];
}
}

应用程序显示输入 AppleID 密码的对话框。

最佳答案

我发现了问题。我有两个非消耗性应用程序。一个被删除了。一个是活跃的。以下代码仅返回应用内删除的内容:

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

所以,问题出在 App Store 上......

附言当我再次购买它时,它是免费的,因此真正制作了两个应用程序内。

关于ios - 恢复应用内购买是否适用于 iTunes Connect 上的测试帐户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24101617/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com