gpt4 book ai didi

ios - 在 ios 的应用程序购买中遇到自动续订订阅问题

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

我有一个应用程序,我在应用程序购买中实现了自动更新订阅。

我正在关注此链接 link

有了这个,我成功收到了购买提醒,但是当我再次按下它时,它每次都要求我购买。

其中提到了两种检查过期日期和产品是否过期的方法。

但我无法从中找到合适的解决方案。

谁能帮帮我???

我们将不胜感激。

提前致谢。

最佳答案

检查这个链接

https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html

Apple 建议收据验证应该在服务器端完成。

订阅过期时收到的状态码是 21006。


用于恢复购买

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

self.restoringInAppStatusLabel.hidden = NO;

}

它将在获取恢复详细信息后调用该方法:

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

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

NSLog(@"Product Identifier string is %@",temp);

}

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 - 在 ios 的应用程序购买中遇到自动续订订阅问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30237553/

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