gpt4 book ai didi

ios - 应用因没有 "Restore"购买功能而被拒绝

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:01:03 24 4
gpt4 key购买 nike

我的应用因未实现“恢复购买”功能而被拒绝。

苹果说

We found that your app offers In-App Purchase/s that can be restored but it does not include a "Restore" feature to allow users to restore the previously purchased In-App Purchase/s. To restore previously purchased In-App Purchase products, it would be appropriate to provide a "Restore" button and initiate the restore process when the "Restore" button is tapped.

所以我最终决定添加它,我发现我们必须使用

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

但是没有用!我搜索了类似的问题,但发现没有一个适用于我的应用程序。这些是我到目前为止堆叠的以下链接:

Restore already bought in-app-purchases on iPhone?

iOS6 - In app purchase with download from Apple server

请帮忙!!提前致谢..

最佳答案

尝试以下操作:

点击恢复按钮 -->

- (IBAction)retoreinApp:(id)sender
{
//set addTransactionObserver to self.
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

}

这会调用

- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue {

UIAlertView *alert ;
if(queue.transactions.count >0)
{
for (SKPaymentTransaction *transaction in queue.transactions)
{
NSString *productId = transaction.payment.productIdentifier;

NSLog(@" ProductIdentifier is %@",productId);
if([productId isEqualToString:@"com.xy.yourProductId"])
{//add code to add it to your account
}
alert = [[UIAlertView alloc ] initWithTitle:@"Restore Transactions" message:@"All your previous transactions are restored successfully." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];

}
else
{
alert = [[UIAlertView alloc ] initWithTitle:@"Restore Transactions" message:@"No transactions in your account to be restored." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];

}
[alert show];

}

关于ios - 应用因没有 "Restore"购买功能而被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30438547/

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