Iphone iAp [response.products count]是空的

时间:2011-11-28 03:48:24

标签: iphone ios4 in-app-purchase

这就是问题 - 我对iAp产品的回复中没有产品。 我在这里阅读了很多关于它的主题,在stackoverflow,加上这里: http://troybrant.net/blog/2010/01/invalid-product-ids/ 而这一切都是“是”。但它仍然无法运作。 我的appid iAps打开,我的配置新,我的iapps连接到应用程序,并清除待售,所以...... 请帮忙。

PS。我发送的所有标识符都在response.invalidProductIdentifiers数组中返回

PPS。 itunes connect帐户在澳大利亚链接。 (但在帐户中所有商店都包括在内)

  - (void)sendProductRequest:(NSString *)ID {
    SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:ID]]; 
    request.delegate = self;
    [APPDELEGATE increaseNetworkUseCount];
    [request start]; 
}

- (void)sendProductRequestForCourseTests {
    [self sendProductRequest:@"au.bla.blabla.blablabla.inapptesting"]; // for example. 100% matching with my productID at itunes connect
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { 
    for (int i = 0; i < [response.invalidProductIdentifiers count]; i ++) {
        NSLog(@"%@", [response.invalidProductIdentifiers objectAtIndex:i]); // here we have my Product id
    }

    DbgLog(@"Products count in received responce: %d", [response.products count]); // here i've got Zero!
    SKProduct* product = [response.products count] > 0 ? [response.products objectAtIndex:0] : nil;
    if (product) {
        //NSString *storeProductID = myProduct.productIdentifier;

        //SKPayment *payment = [SKPayment paymentWithProductIdentifier:storeProductID];
        SKPayment *payment = [SKPayment paymentWithProduct:product];
        DbgLog(@"Payment request sent for product with id: %@", product.productIdentifier);
        [[SKPaymentQueue defaultQueue] addPayment:payment];
    } else {
        [APPDELEGATE decreaseNetworkUseCount];
        for (id <IAPManagerObserver> observer in observers) {
            [observer IAPManager:self didFinishSuccessfully:NO withTransaction:nil];
        }
    }
    [request autorelease];
} 

1 个答案:

答案 0 :(得分:2)

检查以下几点,

  1. 您的项目的.plist捆绑ID是否与您的应用ID相匹配
  2. 您在制作SKProductRequest时是否使用完整的产品ID
  3. 这是正常的情景问题。请检查这些项目,它应该解决问题。