iOS7 xCode5 how to resolve “invalid product ID” fo

2019-07-16 06:56发布

问题:

I'm trying to implement in-app purchases in one of my apps, and have an issue where I get no products returned when I send a product request for sandbox testing. I see a lot of very old posts, like this one (invalid product id from 2010). What am I doing wrong with my in app purchase setup? Is there any recent tutorials on how to configure xCode5 to use in app purchasing?

- (void)requestProUpgradeProductData
{

    NSSet *productIdentifiers = [NSSet setWithObject:self.productID ];
    productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers];
    productsRequest.delegate = self;
    [productsRequest start];

    // we will release the request object in the delegate callback
}

Here's the callback for the product request:

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

    NSArray *products = response.products;

    for(id object in products)
    {
//handle valid products
    }

    for (NSString *invalidProductId in response.invalidProductIdentifiers)
    {
        NSLog(@"Invalid product id: %@" , invalidProductId);
    }
    [hud hide:YES];

}

Using this option created a duplicate app id with the same number, but different name on hte developer portal. I cannot delete that app ID.

This is the first consumable in app purchase, no need to host content. The app is in "ready to upload binary stage". It has been over 24 hours since I created the in app purchase via itunesconnect

回答1:

Found a solution here:

http://www.raywenderlich.com/21081/introduction-to-in-app-purchases-in-ios-6-tutorial

Turns out when I created the product in iTunesConnect, I called it "product", when it should've been "com.mysite.product"



回答2:

The solution for me was that I had to set up banking info and start the paid contracts in the developer portal, which takes a usual 15 minutes when processing.