Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何在iTunes connect中测试我的InApp购买_Iphone_Ios_Xcode - Fatal编程技术网

Iphone 如何在iTunes connect中测试我的InApp购买

Iphone 如何在iTunes connect中测试我的InApp购买,iphone,ios,xcode,Iphone,Ios,Xcode,我正在iOS sdk中进行iApp购买,我已经完成了所有步骤,如在iTunes中创建应用程序和在iTunes connect上管理iApp购买中的非消费性应用程序。我的应用程序状态为等待上载,如下图所示: 我的未购买状态为准备提交 代码智能inapp购买功能已完成,但我的应用程序已测试为SKProductsRequest未返回任何产品 我的主应用程序包id类似于com.mycompany.myapp 我的应用程序内捆绑包id类似于com.mycompany.paidapp 他们是如何测试in

我正在iOS sdk中进行iApp购买,我已经完成了所有步骤,如在iTunes中创建应用程序和在iTunes connect上管理iApp购买中的非消费性应用程序。我的应用程序状态为等待上载,如下图所示:

我的未购买状态为准备提交

代码智能inapp购买功能已完成,但我的应用程序已测试为SKProductsRequest未返回任何产品

我的主应用程序包id类似于com.mycompany.myapp

我的应用程序内捆绑包id类似于com.mycompany.paidapp

他们是如何测试inapp购买步骤的,有谁能指导我吗

我的示例代码如下:

- (void)loadStore {

    if ([SKPaymentQueue canMakePayments]) {
        NSLog(@"Parental-controls are disabled");

        request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:@"com.mycompany.paidapp"]];
        //request.delegate = self;
        [request setDelegate:self];
        [request start];


    }
    else {
        NSLog(@"Parental-controls are enabled");
    }

}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response {

    SKProduct *validProduct = nil;
    int count = [response.products count];
    if (count > 0) 
    {
        validProduct = [response.products objectAtIndex:0];
        NSLog(@"Products found!");
        [[NSNotificationCenter defaultCenter] postNotificationName:kProductsLoadedNotification object:@"Product Found..!"];

    } else if (!validProduct) 
    {
        NSLog(@"No products available");
        [[NSNotificationCenter defaultCenter] postNotificationName:kProductsLoadedNotification object:@"Product Not Found..!"];

    }

}
命令提示符返回nslog始终低于输出:


没有可用的产品
应用程序包名称和iTunes应用程序包名称应相同。而且产品必须存在于iTunes上。 请尝试以下代码:

[productIdentifierList addObject:@"CB001"];
[productIdentifierList addObject:@"CB002"];
[productIdentifierList addObject:@"CB003"];

        SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithArray:productIdentifierList]];
        request.delegate = self;
        [request start];
CB001、CB002是iTunes上的产品id


它对我来说很好。

为了测试应用程序内的内容,你可以创建一个AppID和一些应用程序内的内容,在发布应用程序之前,你应该好好检查一下

因此,我遵循的政策如下: 1.首先上传一个应用程序。 2.添加应用程序内容。 3.自己拒绝二进制文件。 一旦你的应用内测试合格,然后将新的二进制文件重新加载到iTunes


希望这有帮助。

com.mycompany.paidapp产品存在于应用程序内购买商店中?@Mitesh Khatri不存在于应用程序内购买商店中。。。!然后将其添加到您的iTunes in-App Purchase中,然后重试。@Mitesh Khatri如果我测试in-App Purchase,则必须将二进制文件上载到appstore?否。您不需要在App store.my in-App bundle id com.mycompany.inapp上上载二进制文件来替换以分配类似[productIdentifierList addObject:@“com.mycompany.inapp”];?