无法连接到iTunes Store(获取应用内购买列表) [英] Cannot connect to iTunes Store (to get in-app purchase listing)

查看:426
本文介绍了无法连接到iTunes Store(获取应用内购买列表)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从我的应用程序的应用内购买商品商店中获取商品。以下是我的工作:

I am trying to get the listing from the store of in-app purchase items for my app. Here is what I have done:


  • 安装了新的配置文件,启用了应用内购买。 (更换配置文件很棘手,但我认为我说得对。)

  • 验证了税务和银行信息是否正常。 (该应用程序已在商店中出售)。

  • 创建测试用户

  • 在测试设备上使用测试用户登录

  • (设备未被囚禁)

  • 创建了应用内购买商品,并将已清仓设置为是。 (项目处于准备提交状态)。

  • 等待几个小时

  • 使用完整的产品ID和请求。

  • installed new provisioning profile with In-App Purchases enabled. (Replacing the provisioning profile was tricky but I think I have it correct)
  • verified that tax and banking info is OK. (The app is already for sale in the store).
  • created test user
  • logged in with test user on test device
  • (device is not jail-broken)
  • created in-app purchase items and set Cleared for Sale to Yes. (Items are in Ready to Submit status).
  • waited several hours
  • using the full product IDs with the requests.

我对前一个问题的答案唯一不确定(无法连接到iTunes商店错误)部分说:
3)您的项目的.plist捆绑ID是否与您的应用ID相匹配?

The only thing I'm not sure about from the answer to this previous question (Cannot connect to iTunes store error) is the part that says: 3)Does your project’s .plist Bundle ID match your App ID?

Bundle ID列为NA。$ {PRODUCT_NAME:rfc1034identifier}所以我不知道如何扩展它以查看它是否匹配。但是,由于这个应用程序在商店出售,我不知道如何关闭。

The Bundle ID is listed as N-A.${PRODUCT_NAME:rfc1034identifier} so I'm not sure how to expand that out to see that it matches. However, since this app is in the store for sale, I'm not sure how this could be off.

商店的错误是代码0,无法连接到iTunes Store。

The error from the store is Code 0, "Cannot connect to iTunes Store".

感谢您的帮助!

推荐答案

事实证明这个问题不是清单上的任何项目,而是由于我对Swift缺乏经验而导致的语法错误。同样的问题不太可能发生在其他人身上,但为了完整起见我提出了以下解决方案:

The problem turned out to be none of the items on the checklist, but rather a syntactical blunder resulting from my inexperience with Swift. The same issue is not likely to happen to others but I present the solution below for the sake of completeness:

func fetchAvailableProducts() {
    // wrong syntax (but able to compile):
    // let productIDs:NSSet = NSSet(objects: ["com.mysite.IAP1MONTH", "com.mysite.IAP6MONTH"])

    // correct syntax:
    let productIDs:NSSet = NSSet(objects: "com.mysite.IAP1MONTH", "com.mysite.IAP6MONTH")
    let productsRequest:SKProductsRequest = SKProductsRequest(productIdentifiers: productIDs);
    productsRequest.delegate = self;
    productsRequest.start();
}

这篇关于无法连接到iTunes Store(获取应用内购买列表)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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