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

。_饼干妹妹 提交于 2019-12-24 01:13:24

问题


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.



来源:https://stackoverflow.com/questions/21194050/ios7-xcode5-how-to-resolve-invalid-product-id-for-in-app-purchases-in-2014

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!