ios7in-app-purchasexcode5skproduct

iOS7 xCode5 how to resolve "invalid product ID" for in app purchases in 2014?


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. enter image description here

enter image description here

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

enter image description here


Solution

  • 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"

    enter image description here