InApp purchase on iOS 5 vs iOS 6

自闭症网瘾萝莉.ら 提交于 2020-01-02 10:04:23

问题


I've been testing the new version of my app, which will include an in-app purchase in the next update, for one month.

Everything worked fine both on iOS 6 and 5, but recently I'm starting to get an empty SKProducts array back from the requests I make from iOS 5.

The strange thing is that, by executing the same application on iOS 6, I get the correct products array with all the elements I've set up in iTunes connect.

Anyone having the same problem? What can it be?


回答1:


You used Jail Break device to test, didnt u? You can add this to productsRequest method to check the invalid identifier

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

    NSLog(@"Loaded list of products...");
    _productsRequest = nil;

    NSArray * skProducts = response.products;
    NSLog(@"Number of products: %d", [skProducts count]);
    for (SKProduct * skProduct in skProducts) {
        NSLog(@"Found product: %@ %@ %0.2f",
              skProduct.productIdentifier,
              skProduct.localizedTitle,
              skProduct.price.floatValue);
    }
    for (NSString *invalidProductId in response.invalidProductIdentifiers)
    {
        NSLog(@"Invalid product id: %@" , invalidProductId);
    }

    _completionHandler(YES, skProducts);
    _completionHandler = nil;


}

Follow this post http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/



来源:https://stackoverflow.com/questions/12652301/inapp-purchase-on-ios-5-vs-ios-6

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