在应用程序购买中,SKPaymentTransactionStatePurchased 重试
我正在实施应用内购买并在我的服务器上验证收据。
当我在 paymentQueue:updatedTransactions:
期间遇到 SKPaymentTransactionStatePurchased
时,我将收据发送到我的服务器进行验证。当我的服务器响应 OK 时,我调用 finishTransaction
。
如果我的服务器离线或者我无法验证收据,什么会触发应用再次调用 paymentQueue:updatedTransactions:
,从而有效地让我有机会重试验证?我注意到重新启动应用程序会执行此操作 - 还有其他吗?当应用程序保持运行时,它会以某个固定频率再次被调用吗?
是否有手动方法强制事务队列循环?
I'm implementing In App Purchase and am validating receipts on my server.
When I encounter SKPaymentTransactionStatePurchased
during paymentQueue:updatedTransactions:
I send the receipt to my server for validation. When my server responds with an OK I call finishTransaction
.
If my server is offline or I'm otherwise unable to validate the receipt, what triggers the app to call paymentQueue:updatedTransactions:
again, effectively giving me a chance to retry the validation? I've noted that restarting the app does this - is there anything else? Will it get called again on some fixed frequency while the app remains running?
Is there a manual way to force the transaction-queue to cycle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为 TomSwift 不想恢复购买的付款,
但他想要申请打电话
支付队列:更新交易
再次带有 SKPaymentTransactionStatePurchased 标志
未完成交易
,他知道的唯一方法是重新启动
我曾经尝试过的 应用程序
[[SKPaymentQueuedefaultQueue]removeTransactionObserver:mMyStoreObserver];
[[SKPaymentQueue defaultQueue] addTransactionObserver:mMyStoreObserver];
再次
但它不起作用..
非finishTransaction的问题是
苹果会说已购买但从未下载过
再次尝试购买相同的产品 ID 时,将进入 SKPaymentTransactionStateFailed。
I think TomSwift doesn't want to restore purchased payment,
but he want application to call
paymentQueue:updatedTransactions
with SKPaymentTransactionStatePurchased flag again
of non finishTransaction
and only way he know is re-launch the app
I used to try
[[SKPaymentQueue defaultQueue] removeTransactionObserver:mMyStoreObserver];
[[SKPaymentQueue defaultQueue] addTransactionObserver:mMyStoreObserver];
again
but it doesn't work..
the problem of non finishTransaction is
apple will said it have been purchased but never been downloaded
and it will enter SKPaymentTransactionStateFailed when try to purchased same product id again.
您可以让应用程序调用
这将发送至
所有交易的集合:
而不是
You can have the App call a
This will send to
a set of all of the transactions with:
rather than