ios “无法连接到 iTunes Store”应用内购买

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7402801/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 21:29:56  来源:igfitidea点击:

"Cannot connect to iTunes Store" in-app purchases

ioscocoa-touchin-app-purchase

提问by gdetari

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.

我在测试我的应用内购买时遇到问题。我取回了有效的产品标识符,但在购买时收到了可怕的“无法连接到 iTunes Store”。有趣的是,恢复购买似乎有效 - 弹出 iTunes 登录。

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

我已经: - 检查我的应用内购买是否已清除出售 - 检查,重新检查我的源代码以与 Apple 的文档同步 - 添加了适当的测试用户 - 应用 ID 不包含通配符 - 应用内购买链接到应用程序(应用程序本身处于开发者拒绝状态,购买准备提交) - 等待 - 重新安装应用程序,清理解决方案,所有巫毒教的东西

回答by stevel

Make sure you have signed out of any production iTunes accounts on the device.

确保您已退出设备上的任何生产 iTunes 帐户。

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 帐户登录的测试手机上收到此错误。您无法使用生产 iTunes 帐户测试应用程序,因此会出现错误。我只是希望苹果提供一个更好的错误,以避免这种猜测......

回答by DShah

see In-App Purchase FAQ: Cannot connect to iTunes Store

请参阅应用内购买常见问题解答:无法连接到 iTunes Store

Your app is running in the Simulator, which does not support In-App Purchase

For testing in app purchases always use real devices.

对于在应用程序购买中的测试,始终使用真实设备。

回答by Dielson Sales

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.

对于新手,请确保您的应用内购买产品的状态为Ready to Submit,没有“缺少元数据”。就我而言,缺少的是订阅组的本地化。

enter image description here

enter image description here

回答by James Webster

I've been having this problem and I'm convinced its a bug. I've filed a bug report with Bug Id 10108270

我一直有这个问题,我确信这是一个错误。我已提交错误报告,错误 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.

我的解决方法是创建一个新的测试用户,但在 Apple 回复我之前,我无法提供任何更好的解决方案。当我收到回复时,我会更新这个答案。

回答by ArthurVonBabylon

This problem remains persistent in 2016. Incredible. Here was my solution:

这个问题在 2016 年仍然存在。难以置信。这是我的解决方案:

Add a build number. Target > General > Identities > Build.

添加内部版本号。目标 > 常规 > 身份 > 构建。

回答by PicSonics

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.

就我而言,我能够在我的设备上测试应用内购买直到昨天,但它今天停止工作。原来,Apple 推动了一项“付费应用程序修正案”,供我查看并同意。一旦我同意了修正案(当然没有阅读它),一切又开始了。不必创建新的测试用户或任何其他解决方法。

There may be many reasons for in-app purchases to not work but make sure you are correctly set up on itunesconnector you won't be able to test in-app purchases.

应用内购买无法运行的原因可能有很多,但请确保您已正确设置,itunesconnect否则您将无法测试应用内购买。

回答by Juan Fran Jimenez

I'm hitting the same issue. For me it happens after this secuence:

我遇到了同样的问题。对我来说,它发生在这个 secuence 之后:

  • Install app on a device logged into a UK account on iTunes
  • Launch the app and use a test user set in USA
  • Message is shown saying account is only valid in USA. Closes the app and auto launches iTunes
  • Open your app again and retry purchase. Receive products but no other callback or error.
  • 在 iTunes 上登录英国帐户的设备上安装应用程序
  • 启动应用程序并使用美国的测试用户集
  • 显示消息说帐户仅在美国有效。关闭应用程序并自动启动 iTunes
  • 再次打开您的应用程序并重新尝试购买。收到产品但没有其他回调或错误。

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.

我不知道这是否是 IAP 平台上的问题,但我想在我的代码中以某种方式得到一个错误/回调来处理它。

To carry on testing your IAPs try any of these:

要继续测试您的 IAP,请尝试以下任一方法:

  1. Remove Provisioning Profile in Settings area, remove App and log out from Store in Settings. Then go to XCode and change the signing identities to "Do Not Sign" to then put them back (I know how it sounds :) but try) OR
  2. Hard reset all Settings on your device (Settings -> General...). Obviously you will loose any settings on that device...
  3. Kill iTunes app on the device (multitask menu) and log out from the Store on the Settings
  1. 在设置区域删除配置文件,删除应用程序并从设置中的商店注销。然后转到 XCode 并将签名身份更改为“请勿签名”,然后将它们放回原处(我知道这听起来如何:) 但请尝试)或
  2. 硬重置设备上的所有设置(设置 -> 常规...)。显然,您将丢失该设备上的所有设置...
  3. 杀死设备上的 iTunes 应用程序(多任务菜单)并从“设置”中的“商店”注销

If none of the above work, it might be an issue on IAP platform, see my comments below.

如果以上都不起作用,则可能是 IAP 平台上的问题,请参阅下面的评论。

回答by hguzman

Make sure the system status is ready https://www.apple.com/support/systemstatus/

确保系统状态准备就绪https://www.apple.com/support/systemstatus/

I have an Iphone, Restart it worked for me

我有一部 Iphone,重新启动它对我有用

回答by David Baez

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

重用旧沙箱帐户时,您也可能会收到此错误,您在另一个应用程序上使用(我的场景)测试了以前的 IAP。Apple 真的需要更新我们测试 IAP 的方式,我的电子邮件快用完了:0

回答by Anish

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.

我可以在 iPhone 上购买应用程序内,但不能在 iPad(11.0.2)上购买。我尝试了所有提到的解决方案,但没有任何帮助。在尝试了所有其他可能性之后,我终于能够让它发挥作用。

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.

在 iTunes Connect 中创建测试帐户时,不要验证电子邮件 ID。如果验证通过,iap 将返回“无法连接到 iTunes”错误。这看起来很奇怪,但这对我来说是有效的。在 iPhone 中,无论电子邮件验证如何,我都可以使用测试帐户进行购买。