关于IAP:苹果的审核规则发生了一点变化--没有“恢复”将会被拒

原文链接:http://hillboy.blog.51cto.com/1645730/946243

最近的一个应用被拒了,苹果解释如下:

Jul 25, 2012 12:52 PM. From Apple.
We found that while your app offers In-App Purchase(s) that can be restored, it does not include the required "Restore" feature to allow users to restore the previously purchased In-App Purchase(s), as specified in Restoring Transactions section of the In-App Purchase Programming Guide:

"...if your application supports product types that must be restorable, you must include an interface that allows users to restore these purchases. This interface allows a user to add the product to other devices or, if the original device was wiped, to restore the transaction on the original device."

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.

For more information about restoring transactions and verifying store receipt, please refer to the In-App Purchase Programming Guide.
大体意思就是应用需要一个购买恢复的功能,第一次做的IAP并没有做这个功能,但也通过了,可能是苹果新增的审核规则。
解决方法很简单,增加一个Restore按钮,并调用[[SKPaymentQueue defaultQueue] restoreCompletedTransactions],接下来的流程是
1,弹出对话框输入帐号信息
2,如果点击“取消”,调用方法
-(void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error
如果点击“确定”,开始请求数据
3,返回数据后,回调
-(void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
4,判断交易队列中交易的状态,在状态为“SKPaymentTransactionStateRestored”的switch分支下调用恢复处理方法
5,恢复完成后回调-(void)completeTransaction:(SKPaymentTransaction *)transaction

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值