Created by shenyang-zhl
关于内购IPA审核,Apple的审核大佬会有千奇百怪的被拒方法。
本人目前遇到比较罕见的是没有Restore恢复按钮??这个也要管吗?
好吧,以下是亲测生效的解决办法。
被拒原文:
We found that your app offers in-app purchases that can be restored but does not include a "Restore Purchases" feature to allow users to restore the previously purchased in-app purchases, as specified in the "Restoring Purchase Products" section of the In-App Purchase Programming Guide:
"Users restore transactions to maintain access to content they've already purchased. For example, when they upgrade to a new phone, they don't lose all of the items they purchased on the old phone. Include some mechanism in your app to let the user restore their purchases, such as a Restore Purchases button."
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 by the user.
如果你碰到这种被拒的邮件,请按照下列步骤
1、首先要在你内购的页面上添加一个按钮,按钮名称设置为【恢复购买】
2、按钮点击事件设置成为
- (IBAction)buttonRestoreClick:(id)sender {//xib 连接实现的方法
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];//(关键)
}
2、在当前的控制器或者视图初始化方法中(viewDidLoad)添加
- (void)viewDidLoad {
[super viewDidLoad];
//添加监听方法,self是当前的控制器
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
}
同时当前类中引入
#import <StoreKit/StoreKit.h>
3、实现必须的代理方法
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue NS_AVAILABLE(10_7, 3_0){
[@"没有找到可恢复后买项" toast];
}
在上面的代理方法中实现恢复购买的逻辑。如果没有的话,那么直接弹窗"没有找到可恢复后买项"也是可以的。如果需要真正的Restore恢复购买的话,需要在queue.transactions找到相关恢复购买。
以上3步之后,重新打包,等待审核,官方上架亲测有效。
智慧流-用科技成就中小学生!