ios SKErrorDomain Code=0 “无法连接到 iTunes Store”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18891548/
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
SKErrorDomain Code=0 “Cannot connect to iTunes Store”
提问by Ansari
My application has just gone live on the iTunes Store, and after that, I am unable to start any purchase. I have tested the application and its working fine in Sandbox envtheitroadnemnt. But Live application gives the error
我的应用程序刚刚在 iTunes Store 上线,之后,我无法开始任何购买。我已经在 Sandbox envtheitroadnemnt 中测试了该应用程序及其工作正常。但是实时应用程序给出了错误
Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store
Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store
enum value = SKErrorUnknown
enum value = SKErrorUnknown
I have tried signing out any test accounts from Store login, but it just doesn't ask for any account login and error keeps on coming. Any clue!
我曾尝试从商店登录中注销任何测试帐户,但它只是不要求任何帐户登录并且错误不断出现。任何线索!
回答by Manthan
This can happen because of the two problems i guess.
这可能是因为我猜的两个问题。
Make sure you have placed the correct "Product Identifier".If that's the case, then you'll get error 0 shortly after calling -[SKPaymentQueue addPayment:], before you get the popup asking you to confirm payment.
Your test user has become invalidated. This can happen if you accidentally log into the App Store with your test user. When this happens, you'll get error 0 after entering your password to confirm your payment.
确保您放置了正确的“产品标识符”。如果是这种情况,那么您将在调用 -[SKPaymentQueue addPayment:] 后不久收到错误 0,然后才会出现要求您确认付款的弹出窗口。
您的测试用户已失效。如果您不小心与测试用户一起登录 App Store,就会发生这种情况。发生这种情况时,您会在输入密码以确认付款后收到错误 0。
To fix problem #1, pass in the correct product ID. To fix problem #2, create a new test user on iTunes Connect, and optionally delete the old test user.
要解决问题 #1,请传入正确的产品 ID。要解决问题 #2,请在 iTunes Connect 上创建一个新的测试用户,并可以选择删除旧的测试用户。
Hope this helps you.
希望这对你有帮助。
回答by l-l
I was getting the same error while testing subscriptions, was able to get it to work by adding a Localization (Subscription Display Name and Description) to the product from iTunes connect.
我在测试订阅时遇到了同样的错误,能够通过从 iTunes 连接向产品添加本地化(订阅显示名称和描述)来使其正常工作。
回答by ChikabuZ
Check if you sign out of the iTunes Store. To sign out, follow these steps:
检查您是否退出了 iTunes Store。要退出,请按照下列步骤操作:
- Open the Settings App
- Tap the “Store” row
- Tap “Sign Out”
- 打开设置应用程序
- 点击“商店”行
- 点击“退出”
回答by Dipen Panchasara
you can check few things and verify it.
你可以检查几件事并验证它。
Verify following things
:
Verify following things
:
(1)
your App's Bundle ID
. it should be same as you created in iTunes store in which you have added In App Purchases.
(1)
您的应用程序的Bundle ID
. 它应该与您在 iTunes 商店中创建的相同,您在其中添加了应用内购买。
(2)
Check Your In App Identifier
Name, which you use in Application.
(2)
检查您In App Identifier
在应用程序中使用的姓名。
If any of these is not matching it would throw Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store
exception.
如果其中任何一个不匹配,它将抛出Error Domain=SKErrorDomain Code=0 “Cannot connect to iTunes Store
异常。
回答by formica
This scenario was exactly mine. After addPayment was called, a dialog box popped up saying "Log in to the iTunes store with an existing or new account". As soon as I selected Login, I got the error above.
这个场景正是我的。调用 addPayment 后,会弹出一个对话框,提示“使用现有帐户或新帐户登录 iTunes 商店”。一旦我选择了登录,我就收到了上面的错误。
I had reinitialised my iPad and signed out of iCloud. No luck. Then, showing a friend, found that there is also an iTunes a& AppStore sign out option which is distinct from this. Clicked on the Touch Id line and it offered me a sign out option. Then, I was prompted to login with a test account on making a purchase. It worked!
我重新初始化了我的 iPad 并退出了 iCloud。没运气。然后给朋友看,发现还有一个和这个不同的iTunes a&AppStore退出选项。单击 Touch Id 行,它为我提供了一个退出选项。然后,我被提示在购买时使用测试帐户登录。有效!
回答by Li Jin
in your Xcode:
在您的 Xcode 中:
- Click on your active scheme name right next to the Stop button
- Click on Edit Scheme....
- in Run (Debug) select the Arguments tab
- in Environment Variables click +
- add variable: OS_ACTIVITY_MODE = disable
- 单击“停止”按钮旁边的活动方案名称
- 单击编辑方案....
- 在 Run (Debug) 中选择 Arguments 选项卡
- 在环境变量中单击 +
- 添加变量:OS_ACTIVITY_MODE = 禁用