如何跳过警告“您已经购买了此内容,但尚未下载”

发布于 2024-08-25 07:48:02 字数 120 浏览 3 评论 0原文

我正在测试我的应用内购买应用程序。当我在沙箱环境中使用我的用户帐户第二次购买消耗品时,它总是显示一条警告“您已经购买了此产品,但尚未下载。点击“确定”立即下载。”。有什么办法可以跳过警报吗?

感谢您的任何帮助。

I am testing my in app purchase application. While I purchase my consumable product second time with my user account in sandbox environment, it always show me a alert "You've already purchased this but it hasn't been downloaded. Tap OK to download it now.". Is there any way to skip the alert?

Thanks for any help.

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

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

发布评论

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

评论(7

鲜肉鲜肉永远不皱 2024-09-01 07:48:02

如果您在购买消耗品后才购买消耗品,则不应看到此警报。如果是,那么您从未从队列中删除该事务。您需要先将其删除,然后商店才会允许您再次购买。

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];

You should not see this alert if you are purchasing a consumable after already having done so. If you are, then you have never removed the transaction from the queue. You need to remove it before the store will let you purchase it again.

[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
秋叶绚丽 2024-09-01 07:48:02

好吧,我在网上搜索了几个小时后的解决方案!不要忘记为您的 IAP 经理添加交易观察员

[[SKPaymentQueue defaultQueue] addTransactionObserver:self];

您的应用程序应在应用程序初始化期间将观察者添加到支付队列中。如果没有观察者附加到队列,则支付队列不会将其待处理交易列表与 Apple App Store 同步,因为没有观察者响应更新的交易。

如果应用程序在事务仍在处理时退出,这些事务不会丢失。下次应用程序启动时,支付队列将恢复处理交易。您的应用程序应该始终期望收到已完成交易的通知。

Well, my solution after searching the web for several hours! Don't forget to add transaction observer for your IAP manager!!

[[SKPaymentQueue defaultQueue] addTransactionObserver:self];

Your application should add an observer to the payment queue during application initialization. If there are no observers attached to the queue, the payment queue does not synchronize its list of pending transactions with the Apple App Store, because there is no observer to respond to updated transactions.

If an application quits when transactions are still being processed, those transactions are not lost. The next time the application launches, the payment queue will resume processing the transactions. Your application should always expect to be notified of completed transactions.

风吹过旳痕迹 2024-09-01 07:48:02

这实际上是相当复杂的。 Apple 已将此消息内置到其交易流程中,因此,如果您让用户尝试重新购买他们已经拥有的产品,他们将看到此消息。

您可以使用

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; 

在他们进入您的购买屏幕之前, 恢复他们之前购买的任何交易。在商店 GUI 加载之前运行 RestoreCompletedTransactions,然后锁定交易成功完成后解锁的任何内容的购买按钮。

This is actually fairly complicated. Apple has this message built into their transaction process, so if you let the user get to the point where they are attempting to repurchase a product they already own, they will see this message.

You can use

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; 

To restore any transactions they have previously purchased before they get to your buy screen. Run restoreCompletedTransactions before your store GUI loads, and then lock out the buy buttons of any content that is unlocked when a transaction is successfully completed.

陪你到最终 2024-09-01 07:48:02

如果您使用非沙箱 ID 或错误的沙箱 ID 登录(例如来自与应用程序签名的证书不同的开发程序的沙箱 ID),则在临时构建中完全有效的代码也可能会发生这种情况。例如,个人与公司。

This can also happen with perfectly valid code in an ad-hoc build if you're logged in with a non-sandbox ID, or the WRONG sandbox ID - like one from a different dev program than the cert the app was signed with. Like personal vs corporate for example.

許願樹丅啲祈禱 2024-09-01 07:48:02

确保您已在处理所有请求的控制器中添加了这段代码。

[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];

Make sure you have added this piece of code in the controller handling all the requests.

[[SKPaymentQueue defaultQueue] addTransactionObserver:observer];
她如夕阳 2024-09-01 07:48:02

即使我添加了事务观察者并从队列中删除了事务,我也遇到了同样的问题。我可以通过清理我的配置文件来修复它:

  1. 转到配置门户并检查您的发行版/开发人员配置文件是否仍然有效 - 如果需要更新它们,或者至少通过删除设备并再次添加来刷新它们.

  2. 转到 XCode 中的组织器并删除所有配置文件,然后单击刷新。

  3. 从测试设备中删除您的应用以及所有应用配置配置文件

    从测试设备

  4. < p>使用您当前的测试用户从应用程序商店注销并稍后再次登录
    您的应用内购买内容会要求您这样做。

  5. 当您在应用程序中购买商品时,使用您的测试用户进行清理、构建和登录

  6. 祈祷它能正常工作也适合你!

I've had the same problem even though I did add the transaction observer and also did remove the transaction from the queue. I was able to fix it by cleaning up my provisioning profiles:

  1. Go to Provisioning Portal and check if your distribution/developer provisioning profiles are still valid - renew them if necessary or at least refresh them by removing a device and adding it again.

  2. Go to your organizer in XCode and delete all provisioning profiles, than hit refresh.

  3. Delete your app and all of your app provisioning profiles from your test device

  4. Sign out with your current test user from the appstore and sign in again later on when
    your in app purchase stuff will ask you to do so.

  5. Clean, build and sign in with your test user when you buy an item in your app

  6. Pray that it works for you too!

我做我的改变 2024-09-01 07:48:02

我在创建一个新帐户后刚刚解决了这个问题。我认为苹果的系统只是进行了备份,并且暂时弄乱了帐户。

祝你好运!

I just fixed the problem after created a new account to use. I think Apple's system just gets backed up and messes up accounts for a while.

Good luck!

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