“无法连接到 iTunes Store”应用内购买
我在测试应用内购买时遇到问题。我取回了有效的产品标识符,但在购买后我收到了可怕的“无法连接到 iTunes Store”。有趣的是,恢复购买似乎有效 - 会弹出 iTunes 登录。
我有: - 检查我的应用内购买是否已批准出售 - 检查、重新检查我的源代码以与Apple的文档同步 - 添加了适当的测试用户 - 应用程序 ID 不包含通配符 - 应用内购买链接到应用程序(应用程序本身处于开发者拒绝状态,购买已准备好提交) - 等待 - 重新安装应用程序,清理解决方案,所有巫毒内容
I am having problems testing my in-app purchases. I get back valid product identifiers, but upon purchase I receive the dreaded "Cannot connect to iTunes Store". Interesting thing is that restore purchases seems to work - iTunes login pops up.
I have:
- Checked that my in-app purchases are cleared for sale
- Checked, rechecked my source code to be in sync with Apple's documentation
- Added appropiate test users
- app id does not contain wildcard
- in-app purchases are linked to the app (app itself is in developer rejected state, purchases are in ready to submit)
- waited
- reinstalled app, cleaned solution, all the voodoo stuff
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(17)
确保您已注销设备上的任何生产 iTunes 帐户。
我在使用我的实际 iTunes 帐户登录的测试手机上收到此错误。您无法使用生产 iTunes 帐户测试应用程序,因此会出现错误。我只是希望苹果提供一个更好的错误以避免这种猜测......
Make sure you have signed out of any production iTunes accounts on the device.
I was getting this error on my test phone which was logged in with my actual iTunes account. You cannot test apps using your production iTunes account, hence the error. I just wish Apple provided a better error so as to avoid this guesswork...
请参阅应用内购买常见问题解答:无法连接到 iTunes Store
对于应用内购买测试,请始终使用真实设备。
see In-App Purchase FAQ: Cannot connect to iTunes Store
For testing in app purchases always use real devices.
对于新手,请确保您的应用内购买产品的状态为
准备提交
,并且没有“缺失元数据”。就我而言,缺少的是订阅组的本地化。For newcomers, make sure your in-app purchasing product's status is
Ready to Submit
, with no "missing metadata". In my case, what was missing was the localization of the subscription's group.我一直遇到这个问题,并且我确信这是一个错误。我已提交错误 ID 为 10108270 的错误报告
问题似乎是测试用户被“锁定”,并且可能与尝试使用该帐户在已发布的应用程序中购买应用程序内购买有关。
我的解决方法是创建一个新的测试用户,但在 Apple 回复我之前,我无法提供任何更好的解决方案。当我收到回复时,我会更新这个答案。
I've been having this problem and I'm convinced its a bug. I've filed a bug report with Bug Id 10108270
The problem seems to be that the test user is getting 'locked' and may have something to do with attempting to purchase an in app purchase in an already released app with that account.
My workaround was to create a new test user but until Apple get back to me, I can't provide any better solutions. I'll update this answer when I get replies.
这个问题在 2016 年仍然持续存在。令人难以置信。这是我的解决方案:
添加内部版本号。目标>一般>身份>建造。
This problem remains persistent in 2016. Incredible. Here was my solution:
Add a build number. Target > General > Identities > Build.
这是一个旧线程,与我今天面临的问题有关。
就我而言,直到昨天我还可以在我的设备上测试应用内购买,但今天它停止工作了。原来,苹果公司推出了一项“付费应用程序修正案”供我审查并同意。一旦我同意修正案(当然没有阅读它),一切就又开始运转了。不必创建新的测试用户或任何其他解决方法。
导致应用内购买不起作用的原因可能有很多,但请确保您在
itunesconnect
上设置正确,否则您将无法测试应用内购买。This is an old thread that is related to problem I was facing today.
In my case, I was able to test in-app purchases on my device till yesterday but it stopped working today. It turned out that Apple had pushed an 'Amendment for Paid Applications' for me to review and agree to. Once I agreed to the amendment (without reading it, of course), everything started working again. Did not have to create a new test user or any other workaround.
There may be many reasons for in-app purchases to not work but make sure you are correctly set up on
itunesconnect
or you won't be able to test in-app purchases.我遇到了同样的问题。对我来说,它发生在以下顺序之后:
我不知道这是否是 IAP 平台上的问题,但我希望获得错误/回调以在我的代码中以某种方式处理它。
要继续测试您的 IAP,请尝试以下任一操作:
如果上述方法均不起作用,则可能是 IAP 平台上的问题,请参阅我的评论以下。
I'm hitting the same issue. For me it happens after this secuence:
I don't know whether this is an issue on the IAP platform but I would like to get an error/callback to handle it in some way in my code.
To carry on testing your IAPs try any of these:
If none of the above work, it might be an issue on IAP platform, see my comments below.
确保系统状态已就绪 https://www.apple.com/support/systemstatus/
我有一部 Iphone,重新启动它对我有用
Make sure the system status is ready https://www.apple.com/support/systemstatus/
I have an Iphone, Restart it worked for me
如果您遇到“无法连接到 iTunes Store”错误,这里是详尽的清单:
确保您在 App Store Connect 中创建了沙盒用户
模拟器不支持应用内购买:在真实设备上测试
检查该产品是否可供销售。您是在 App Store Connect 中创建的吗?
如果是以前的 iOS 12,请注销设备上的任何生产 iTunes 帐户。否则,您只需使用沙盒帐户在开发应用程序中登录即可。
Here the exhaustive checklist if you got this error "cannot connect to iTunes Store" :
Make sure you have a sandbox user created in App Store Connect
Simulator DOES NOT support In-app purchase : test on real-device
Check that the product is available for sale. Did you create it in App Store Connect?
If previous iOS 12, signed out of any production iTunes accounts on the device. Otherwise, you can just sign in within the dev app with your sandbox account.
当重用您在另一个应用程序(我的场景)上测试过的旧 IAP 的旧沙箱帐户时,您也可能会收到此错误。 Apple 确实需要更新我们测试 IAP 的方式,我的电子邮件已经用完了 :0
You may also be getting this error when reusing an old sandbox account you tested a previous IAP on another app with (My scenario). Apple really needs to update the way we test IAPs, I'm running out of emails :0
我可以在 iPhone 上进行应用内购买,但不能在 iPad(11.0.2) 上进行购买。我尝试了所有提到的解决方案,但没有任何帮助。在尝试了所有其他可能性之后,我终于能够让它发挥作用。
当您在 iTunes connect 中创建测试帐户时,请勿验证电子邮件 ID。如果通过验证,iap 将返回“无法连接到 iTunes”错误。这看起来很奇怪,但这对我来说很有效。在 iPhone 中,无论电子邮件验证如何,我都可以使用测试帐户进行购买。
I was able to purchase in-app on iPhone but not on iPad(11.0.2). I tried with all mentioned solution but none helps. After trying all other possibilities, finally I was able to make it work.
When you create a test account in iTunes connect, don't verify the email id. If it is verified, iap returns "Cannot connect to iTunes" error. It looks strange but it is how worked for me. In iPhone, irrespective of email verification, I am able to purchase using test account.
当 SKProductsRequest 传递错误的 NSSet 时也会发生此错误:
错误:
正确:
This error also had occurred when to SKProductsRequest passed wrong NSSet:
Wrong:
Correct:
就我而言,我只是忘记处理
transactionState
中的.failed
。特别是SKPaymentQueueue.default().finishTransaction(transaction)
。In my case, I just forgot to handle
.failed
intransactionState
. In particular,SKPaymentQueueue.default().finishTransaction(transaction)
.我也遇到了同样的问题,我检查了该问题,包括Apple form,但找不到解决方案。
今天,当我检查设备时,我发现
设备设置中出现以下内容 -> iTunes 和App Store发现另一个Apple ID已登录。
所以我尝试注销并再次检查应用内购买,它运行得很好。因此,请检查问题是否链接到相同的。
谢谢&问候,
乌尼克里什南
The same issue got for me, and I had checked on the issue including Apple form, I couldn't find a solution.
Today when I checking the device I found that the following
In Device Settings -> iTunes & App Store found another Apple Id logged In.
So I tried signOut that and checked again the InApp purchase, it worked perfectly. So please check the issue is linked to the same or not.
Thanks & Regards,
Unnikrishnan.P
我必须转到“设置”>“ iTunes 和应用商店,然后滚动到底部的“沙盒帐户”字段并从那里注销。现在它正在工作!
I had to go to Settings > iTunes & App Stores, then scroll to the bottom to the "Sandbox Account" field and Sign out from there. Now it is working!!!
除了此处概述的所有其他方法之外,如果您正在使用订阅,则似乎您需要确保已生成共享密钥:
“要测试或提供自动更新订阅,您必须拥有主共享密钥或使用每个应用程序的特定于应用程序的共享秘密。”
主共享密钥是从 App Store Connect 的“用户和访问”部分的“共享密钥”选项卡生成的。
在您管理应用程序本身的应用内购买时,会生成一个特定于应用程序的共享密钥。
In addition to all the other methods outlined here, if you are working with subscriptions it seems you need to make sure you've generated a shared secret:
"To test or offer auto-renewable subscriptions, you must have a master shared secret or use an app-specific shared secret for each app."
A master shared secret is generated from the 'Shared Secret' tab of the 'Users and Access' section of App Store Connect.
An app-specific shared secret is generated where you manage the in-app purchases of the app itself.
我修好了我的!如果您收到
Error Domain=SKErrorDomain Code=2“无法连接到 iTunes Store”
错误,请确保插入SKPaymentQueue.default().finishTransaction(transaction)
。在我添加SKPaymentQueue.default().finishTransaction(trans)
后,它对我有用:在 Apple 开发者网站中找到,此处
I fixed mine! If you are getting
Error Domain=SKErrorDomain Code=2 "Cannot connect to iTunes Store"
error, make sure you insertSKPaymentQueue.default().finishTransaction(transaction)
. It worked for me after I addedSKPaymentQueue.default().finishTransaction(trans)
in the following:Found in Apple developer website, here