应用程序内购买错误代码0 [英] In-App Purchase Error Code 0

查看:273
本文介绍了应用程序内购买错误代码0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解决为什么我收到无法连接到iTunes Store的错误代码为0。



我知道我的应用程序标识符很好,因为我检索应用程序启动时的产品信息并记录结果,我从iTunes获得正确的产品标识符和价格。当我将我的应用程序标识符更改为愚蠢的东西时,这会失败。



我知道我的产品标识符也是正常的,但由于上述原因(否则它将不起作用,我加倍已经尝试通过以下两种方式创建SKPayment来解雇购买:



第一种方式

  SKPayment * payment = [SKPayment paymentWithProductIdentifier:productIdentifier]; //这在ios 5中已弃用但应该有效
[[SKPaymentQueue defaultQueue] addPayment:payment];

第二种方式

  SKPayment * payment = [SKPayment paymentWithProduct:foundProduct]; 
[[SKPaymentQueue defaultQueue] addPayment:payment];

(foundProduct来自SKProductsRequest返回的SKProducts数组)



两种方式都失败,错误代码为0。



我在我的iPhone 4S上运行时都尝试了这两种方法iOS 5.0.1和iOS 5中的模拟器。



我读过硬重置工作( 2359739 )这看起来很疯狂,但我继续在模拟器中尝试过(iOS模拟器=>重置内容和设置...无济于事。



我唯一能想到的就是iTunes沙盒服务器可能很糟糕...

解决方案

尝试使用错误的iTunes Connect测试帐户也可能导致此错误。如果您尝试将测试帐户用于另一个团队而不是您正在测试的应用程序注册的团队,则会导致相同的错误而没有更具体的消息。


I'm trying to troubleshoot why I'm getting "Cannot connect to iTunes Store" with error code 0.

I know my app identifier is fine because I retrieve product information on app launch and log the results and I get the correct product identifiers and prices from iTunes. When I change my app identifier to something stupid this fails.

I know my product identifiers are fine as well for the above reasons (it wouldn't work otherwise and I double checked).

I have tried firing the purchase by creating an SKPayment in 2 different ways:

FIRST WAY

SKPayment *payment = [SKPayment paymentWithProductIdentifier:productIdentifier]; // This is deprecated in ios 5 but should work
[[SKPaymentQueue defaultQueue] addPayment:payment];

SECOND WAY

SKPayment *payment = [SKPayment paymentWithProduct:foundProduct];
[[SKPaymentQueue defaultQueue] addPayment:payment];

(foundProduct is from the array of SKProducts that get returned from an SKProductsRequest)

Both ways fail with error code 0.

I've tried this both on my iPhone 4S running iOS 5.0.1 and in Simulator on iOS 5.

I've read that hard resets work (2359739) which seems insane, but I went ahead and tried it in Simulator (iOS Simulator => Reset Content and Settings...) to no avail.

Only thing I can think of is that maybe the iTunes sandbox servers are being wonky...

解决方案

This error can also be caused by trying to use the incorrect iTunes Connect test account. If you attempt to use a test account for another team than the one the app you are testing is registered to, it will cause the same error with no more specific message.

这篇关于应用程序内购买错误代码0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆