iPhone Store Kit“无法连接到iTunes Store” [英] iPhone Store Kit "Cannot connect to iTunes Store"

查看:391
本文介绍了iPhone Store Kit“无法连接到iTunes Store”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力将应用内购买添加到我的应用中。

I am working on adding In-App purchases to my app.

我能够收到 productsRequest:didReceiveResponse 方法,并接收产品数组。

I am able to receive the productsRequest:didReceiveResponse method, and receive the array of products.

当我向 SKPaymentQueue添加 SKPayment 时出现问题。将产品添加到队列后,在 paymentQueue:updatedTransactions 方法中,事务的状态始终为 SKPaymentTransactionStateFailed

My problem arises when I add a SKPayment to the SKPaymentQueue. After I add the product to the queue, in the paymentQueue:updatedTransactions method the transactions always have the state SKPaymentTransactionStateFailed.


我NSLogtransaction.error,这就是它返回的内容:错误
Domain = SKErrorDomain Code = 0 UserInfo = 0x165000无法连接到
iTunes Store

I NSLog the "transaction.error" and this is what it returns: Error Domain=SKErrorDomain Code=0 UserInfo=0x165000 "Cannot connect to iTunes Store"

我已经在设置应用中退出了商店,但尝试在我的应用中购买产品后它从未要求我使用我的测试帐户登录。它只是因上述错误而失败。

I have logged out of the Store in the Settings app, but after trying to purchase a product in my app it never asks me to log in with my test account. It just fails with the above error.

推荐答案

我假设您已经完成了标准的健全性检查:仔细检查您的代码,确认您的产品ID,将您的代码与应用程序内购买编程指南进行比较等。

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.

这可能很荒谬,但是 - 如果您确定您的代码是正确 - 执行iPod的硬重置(完全擦除)(设置=>常规=>重置=>删除所有内容和设置)。几个小时我对这个确切的问题感到困惑 - 事实证明我的代码是正确的,硬重置是解决方案。

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). I puzzled over this exact problem for hours -- it turned out my code was correct and the hard reset was the solution.

这篇关于iPhone Store Kit“无法连接到iTunes Store”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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