如何跳过警告“您已经购买了此内容,但尚未下载”
我正在测试我的应用内购买应用程序。当我在沙箱环境中使用我的用户帐户第二次购买消耗品时,它总是显示一条警告“您已经购买了此产品,但尚未下载。点击“确定”立即下载。”。有什么办法可以跳过警报吗?
感谢您的任何帮助。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
如果您在购买消耗品后才购买消耗品,则不应看到此警报。如果是,那么您从未从队列中删除该事务。您需要先将其删除,然后商店才会允许您再次购买。
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.
好吧,我在网上搜索了几个小时后的解决方案!不要忘记为您的 IAP 经理添加交易观察员!
Well, my solution after searching the web for several hours! Don't forget to add transaction observer for your IAP manager!!
这实际上是相当复杂的。 Apple 已将此消息内置到其交易流程中,因此,如果您让用户尝试重新购买他们已经拥有的产品,他们将看到此消息。
您可以使用
在他们进入您的购买屏幕之前, 恢复他们之前购买的任何交易。在商店 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
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.
如果您使用非沙箱 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.
确保您已在处理所有请求的控制器中添加了这段代码。
Make sure you have added this piece of code in the controller handling all the requests.
即使我添加了事务观察者并从队列中删除了事务,我也遇到了同样的问题。我可以通过清理我的配置文件来修复它:
转到配置门户并检查您的发行版/开发人员配置文件是否仍然有效 - 如果需要更新它们,或者至少通过删除设备并再次添加来刷新它们.
转到 XCode 中的组织器并删除所有配置文件,然后单击刷新。
从测试设备中删除您的应用以及所有应用配置配置文件
从测试设备
您的应用内购买内容会要求您这样做。
当您在应用程序中购买商品时,使用您的测试用户进行清理、构建和登录
祈祷它能正常工作也适合你!
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:
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.
Go to your organizer in XCode and delete all provisioning profiles, than hit refresh.
Delete your app and all of your app provisioning profiles from your test device
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.
Clean, build and sign in with your test user when you buy an item in your app
Pray that it works for you too!
我在创建一个新帐户后刚刚解决了这个问题。我认为苹果的系统只是进行了备份,并且暂时弄乱了帐户。
祝你好运!
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!