【问题标题】:No products being returned from iTunes Connect没有从 iTunes Connect 退回的产品
【发布时间】:2015-02-12 07:54:11
【问题描述】:

我已经搜索了几天的 stackoverflow,以了解如何让产品从 iTunes Connect 中返回。我找到了很多信息,并试图遵循它。但是,我无法在 SKProductsResponse 中返回任何产品。
我正在使用 Xcode 6.1.1
我试过删除和重新添加产品。
我已经用模拟器和我的 iPhone 5 试过了。
我已经等了 24 小时,看看这是否会导致产品出现。没有。

这是我每次遵循的过程:

  1. 在 developer.apple.com 中:
    1. 检查我是否拥有有效的 iOS 开发证书
    2. 我的 iOS 设备 (iPhone 5) 已注册
    3. 创建一个新的应用程序 ID
      1. 使用显式应用 ID 和捆绑包 ID:com.ftotech.iaptest01
      2. 在应用服务中选中应用内购买复选标记
    4. 创建新的配置文件
      1. iOS 应用开发类型的配置文件
      2. 上面创建的选定应用 ID
      3. 选择了我的 iOS 开发证书
      4. 选择了我的 iOS 设备
      5. 将配置文件命名为与捆绑 ID 相同:com.ftotech.iaptest01
    5. 配置文件显示状态为 Active
  2. 创建具有以下分辨率的图标 PNG,没有 Alpha 通道:
    1. 1024x1024
    2. 76x76
    3. 120x102
    4. 152x152
  3. 创建具有以下分辨率的屏幕截图 PNG,没有 Alpha 通道:
    1. 3.5 英寸为 640x920
    2. 750x1334 为 4.7 英寸
    3. 4 英寸为 640x1096
    4. 5.5 英寸为 1242x2208
    5. 1024x748 适用于 iPad
    6. 640x920 用于产品
  4. 在 Xcode 中创建新的单视图项目:iaptest01
    1. 在项目设置、常规、身份部分:
      1. 已验证捆绑包 ID 为 com.ftotech.iaptest01
      2. 未找到签名身份错误,因此单击修复问题按钮,选择我的开发团队
      3. 错误消失了
    2. 在项目设置、常规、链接框架和库部分,添加了 StoreKit.framework
    3. 在项目设置的 Capabilities 部分中,验证应用内购买项目已打开,并检查两个步骤(链接 stoker.framework 和添加应用内购买权利)
    4. 向资产目录添加图标:
      1. 将 76x76 图标拖到 ipad app 1x
      2. 将 120x120 图标拖到 iphone 应用 2x
      3. 将 152x152 图标拖动到 ipad 应用 2x
    5. 在故事板中,添加了一个标签,在顶部居中,并添加了一个名为 labelProduct 的插座
    6. ViewController.h 下面
    7. ViewController.m 下面
    8. 存档应用并提交 - 成功
  5. 在 iTunes Connect 中创建新的 iOS 应用
    1. 选定的捆绑包 ID com.ftotech.iaptest01
    2. 完整的定价部分
    3. 在应用内购买部分,创建一个消耗品
      1. 产品编号:com.ftotech.iaptest01.product1
      2. 已批准出售 - 是
      3. 设置语言设置
      4. 添加截图
      5. 产品展示状态为“准备提交”
    4. 在版本部分
      1. 填写所有必填字段
      2. 上传截图和图标
      3. 将产品添加到应用内购买部分
      4. 将构建添加到构建部分
    5. 已提交审核 - 已成功,正在等待审核

ViewController.m:

//
//  ViewController.m
//  iaptest01
//
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    activityIndicatorView = [[UIActivityIndicatorView alloc]
                             initWithActivityIndicatorStyle:
                               UIActivityIndicatorViewStyleWhiteLarge];
    activityIndicatorView.center = self.view.center;
    [activityIndicatorView hidesWhenStopped];
    [self.view addSubview:activityIndicatorView];
    [activityIndicatorView startAnimating];
    [self fetchAvailableProducts];
}

-(void)fetchAvailableProducts{
    NSSet *productIdentifiers = [NSSet
                                 setWithObjects:@"com.ftotech.iaptest01.product1", 
                                 nil];
    productsRequest = [[SKProductsRequest alloc]
                       initWithProductIdentifiers:productIdentifiers];
    productsRequest.delegate = self;
    [productsRequest start];
}

-(void)productsRequest:(SKProductsRequest *)request
    didReceiveResponse:(SKProductsResponse *)response
{
    SKProduct *validProduct = nil;
    int count = (int)[response.products count];
    [_labelProduct setText:response.description];
    if ( count > 0 ) {
        validProducts = response.products;
        validProduct = [response.products objectAtIndex:0];
        [_labelProduct setText:[NSString stringWithFormat:
                                @"found product: %@",validProduct.localizedTitle]];
        UIAlertView *tmp = [[UIAlertView alloc]
                            initWithTitle:@"Available"
                            message:@"Found products"
                            delegate:self
                            cancelButtonTitle:nil
                            otherButtonTitles:@"Ok", nil];
        [tmp show];
    } else {
        UIAlertView *tmp = [[UIAlertView alloc]
                            initWithTitle:@"Not Available"
                            message:[@"No products: " stringByAppendingString:
                              [NSString stringWithFormat:@"%d", count]]
                            delegate:self
                            cancelButtonTitle:nil
                            otherButtonTitles:@"Ok", nil];
        [tmp show];
    }
    NSArray *products = response.invalidProductIdentifiers;

    for (SKProduct *product in products)
    {
        NSLog(@"Product not found: %@", product);
    }

    [activityIndicatorView stopAnimating];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

ViewController.h:

//
//  ViewController.h
//  iaptest01
//
//

#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>

@interface ViewController : UIViewController<SKProductsRequestDelegate>
{
    SKProductsRequest *productsRequest;
    NSArray *validProducts;
    UIActivityIndicatorView *activityIndicatorView;
}

@property (weak, nonatomic) IBOutlet UILabel *labelProduct;

- (void)fetchAvailableProducts;

@end

谁能看到我遗漏的步骤或我配置不正确的东西?

谢谢!

【问题讨论】:

  • this extremely thorough answer 有帮助吗?特别是,您似乎没有在任何时候提到创建测试用户,我猜这意味着您不会看到未经批准的产品?
  • 测试用户似乎是为了进行(虚拟)购买。检索产品似乎不需要测试用户帐户。这是有道理的,因为您不必登录即可简单地获取产品列表。但是,感谢您提供该链接。我会搜索可能的答案。
  • 在查看了 Matt Gibson 建议的链接后,我添加了一些代码来列出请求中的无效产品。这促使我再次查看我在 iTunes Connect 中的产品。该产品是“等待审查”,这似乎很奇怪。我点击产品,顶部有一条消息:“您目前没有有效的 iOS 付费应用合同。”我之前忽略了这一点。也许这就是问题所在。我已经完成了银行和税务信息,合同正在处理中。一旦完成,也许产品会出现?

标签: ios xcode6 app-store-connect


【解决方案1】:

问题是我的银行和税务信息不完整。
为使上述过程正常进行,请转到 iTunes Connect 中的“协议、税务和银行业务”区域并验证“iOS 付费应用程序”合同是否有效。
完成信息后大约需要 15 分钟,但在合同生效后,产品被 SKProductsResponse 正确返回。

感谢马特·吉布森 (Matt Gibson) 提供的提示,让我踏上了解决问题的道路!

顺便说一句,它确实可以在 iOS 模拟器 8.1 中使用。

【讨论】:

    猜你喜欢
    • 2011-09-15
    • 1970-01-01
    • 1970-01-01
    • 2017-11-20
    • 1970-01-01
    • 2018-07-23
    • 1970-01-01
    • 1970-01-01
    • 2016-01-25
    相关资源
    最近更新 更多