何时在服务器产品模型中调用 SKPaymentQueue 上的 finishTransaction?
我对何时确切调用:
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
在“服务器产品模型”中有点困惑:http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Art/store_transactions.jpg
当我的服务器返回收据有效时是否应该调用它我可以显示付费内容,还是应该在从 itunes 收到收据(购买或恢复)后立即调用它?
谢谢
I'm a little confused on when exactly to call:
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
in a 'Server Product Model': http://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Art/store_transactions.jpg
Should it be called when my server returns me that receipt is valid and I can display paid content or should I call it immediately after I get back receipt (purchased or restore) from itunes ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在服务器检查收据后调用它。如果您太早调用 finishTransaction 并且您的应用程序崩溃或在服务器记录购买之前互联网连接断开,那么客户的钱就会消失,但您不会交付货物。如果收据无效,则收据不是来自 Apple。调用 finishTransaction 可能不会有什么坏处。
You should call it when the server has examined the receipt. If you call finishTransaction too early and your app crashes or the internet connection goes down before your server records the purchases, then the customer's money is gone, but you are not delivering the goods. If the receipt isn't valid, then the receipt doesn't come from Apple. It probably doesn't hurt to call finishTransaction.
当您的服务器返回收据有效并且显示付费内容时,应该调用它。
It should be called when your server returns that receipt is valid and paid content is displayed.