简体   繁体   English

应用内购买首次使用沙盒失败,下次可以正常使用

[英]In app purchase is failing first timewith sandbox , works fine next time

Error Domain=SKErrorDomain Code=0 "Cannot connect to iTunes Store" UserInfo=0x339120 {NSLocalizedDescription=Cannot connect to iTunes Store} 错误域= SKErrorDomain代码= 0“无法连接到iTunes Store” UserInfo = 0x339120 {NSLocalizedDescription =无法连接到iTunes Store}

So I have been trying to resolve this error for last few days. 因此,最近几天我一直在尝试解决此错误。 I am logging out logged user from cloud and iTunes from settings app then I click the in app purchase in the app , when it asks me to sign with existing or new user , I click on existing user then I enter correct sandbox credentials in that . 我从设置应用程序中从云和iTunes中注销登录的用户,然后单击该应用程序中的应用程序内购买,当它要求我用现有或新用户签名时,单击现有用户,然后在其中输入正确的沙箱凭据。 It asks the same information once more then It gives me above error. 它再次询问相同的信息,然后给我上述错误。

Strange thing is that this happens with every new sandbox user for first time but when I click on in app button again then it works fine. 奇怪的是,这是每个新沙盒用户第一次发生的情况,但是当我再次在应用程序按钮中单击时,它可以正常工作。 Can you please guys point me to right direction? 你们能给我指出正确的方向吗?

I assume you've done the standard sanity checks: double-checking your code, confirming your product IDs, comparing your code to the In-App Purchase Programming Guide, etc. 我认为您已经完成了标准的健全性检查:仔细检查代码,确认产品ID,将代码与应用内购买编程指南进行比较等。

This may be ridiculous, but -- if you're certain your code is correct -- do a hard reset (full wipe) of your iPod (Settings => General => Reset => Erase All Content and Settings). 这可能很荒谬,但是-如果您确定自己的代码正确-则对iPod进行硬重置(完全擦除)(设置=>常规=>重置=>擦除所有内容和设置)。 I puzzled over this exact problem for hours -- it turned out my code was correct and the hard reset was the solution. 我为这个确切的问题困扰了好几个小时-事实证明我的代码是正确的,硬重置是解决方案。

This doesn't cause any problem in production. 这不会在生产中造成任何问题。 Sandbox is buggy. 沙盒是越野车。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM