iphone store kit:如何捕获取消事件
这是我的问题:
当使用 storekit 进行应用内购买时,我显示一个“正在加载”视图,告诉用户在该过程正在进行时等待几秒钟;但假设同一个用户,当 storekit 询问他的 itunes 帐户密码时,请按“取消”按钮...我如何“捕获”此事件以隐藏加载视图?
恐怕这可能会成为苹果拒绝的一个原因,因为用户的沟通非常重要。
感谢您的任何提示!
编辑:我没有在这里进行交易;我的第一步是恢复已完成的交易,以便通过此方法触发密码提示:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions]
Here's my problem :
When using storekit for in-app purchase, i'm displaying a "loading" view to tell the user to wait for a few seconds while the process is in progress; but let's say this same user, when the storekit ask him for his itunes account password, press the "cancel" button... How can i "catch" this event in order to hide the loading view?
I'm afraid it could be a cause of rejection for Apple since user's communication is pretty important.
Thanks for any tips!
Edit : I'm not in a transaction here; my first step is to restore completed transactions so the password prompt is trigger by this method :
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
苹果开发论坛中也报告了类似的情况。
当用户要求恢复后点击取消时会发生什么......
在他们的例子中,复制并粘贴文档中的方法会产生一个错误,该错误显然编译时没有错误。
而不是
如果您的观察者方法类似于上面的第一个方法,那么您可能没有收到恢复操作的失败消息。
更新:
在
SKPaymentTransactionObserver
的SDK文档中,我看到了OS 3.1(2009-11-17)的恢复失败方法,但3.0文档(2009-05-01)似乎没有它。奇怪的是,3.1 文档声明此观察者方法“在 iPhone OS 3.0 及更高版本中可用”。可以肯定的是。我检查了 iPhoneOS3.0.sdk/System/Library/Frameworks/StoreKit.framework/Headers/SKPaymentQueue.h 的副本,以确保恢复失败观察器方法存在。 (这是。)
Something similar was reported in the Apple dev forums.
What happens when user hits Cancel after asking to restore......
In their case, a copy-and-paste of a method from the documentation created a bug that apparently compiled without error.
instead of
If your observer method looks like the first one above, then you're probably not receiving the failure message for the restore operation.
Update:
In SDK documentation for
SKPaymentTransactionObserver
, I see the restore failure method for OS 3.1 (2009-11-17) but 3.0 documentation (2009-05-01) doesn't seem to have it. Strange since the 3.1 doc states this observer method is "Available in iPhone OS 3.0 and later".To be sure. I checked my copy of iPhoneOS3.0.sdk/System/Library/Frameworks/StoreKit.framework/Headers/SKPaymentQueue.h to make sure the restore failure observer method is there. (It is.)
如果用户单击取消按钮,则请求将失败 - 使用像这样的商店观察者......
并像这样处理......
If the user clicks the cancel button then request will fail - use a store observer like so...
And handle like this....