检测应用内购买的重复购买

发布于 2024-12-02 13:44:34 字数 333 浏览 1 评论 0原文

如何在代码中检测到这种情况:

  • 用户通过应用内购买购买完整版本。

  • 用户从 iPhone 中删除应用程序。

  • 用户再次安装了应用程序

  • 用户购买了完整版,

我的问题是在测试中,我可以看到一个消息框,上面写着“您已购买...”,但在应用程序中未调用 updateTransactions

在这种情况下我需要更改为完整版本。我怎样才能检测到这个事件? 即,我如何在我的应用程序中知道用户已经购买,以便我将“打开”完整版本?

谢谢。

How can I detect this situation in code:

  • User purchase a full version with in-app purchase.

  • User delete the application from iPhone.

  • User installed the application again

  • User purchases full version,

My problem is that in testing, I can see a message box saying "you already purchased...", but in the application updateTransactions not called.

In this situation I need to change to full version. How can I detect this event?
I.e., How can I know in my application that the user already purchased so I will "open" to full version?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦断已成空 2024-12-09 13:44:34

使用[[SKPaymentQueuedefaultQueue]restoreCompletedTransactions]。它将强制您的应用程序再次接收交易。

请参阅文档:

  • 恢复事务
  • <一个href="http://developer.apple.com/library/ios/documentation/StoreKit/Reference/SKPaymentQueue_Class/Reference/Reference.html#//apple_ref/occ/instm/SKPaymentQueue/restoreCompletedTransactions" rel="nofollow noreferrer"> - 恢复已完成的交易

Use [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]. It will force your app to receive transactions again.

See docs:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文