Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SKStoreProductViewController display apps from developer

Tags:

ios

iphone

ios7

i'm using SKStoreProductViewController to implement "more apps" functionality, but when I tap on a product on the list, i'm getting only blank screen, there is also a warning in console:

Could not request view controller: Error Domain=_UIViewServiceInterfaceErrorDomain Code=2 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 2.)"

this happens only on ios 7, in ios 6 it simply redirects to app store, here is my code:

SKStoreProductViewController *productVC = [[SKStoreProductViewController alloc] init];
productVC.delegate = self;
NSDictionary *productParameters = @{ SKStoreProductParameterITunesItemIdentifier :  <itunes developer ID>};
[productVC loadProductWithParameters:productParameters completionBlock:^(BOOL result, NSError *error) {
    if(error)
    {
       [[UIAlertView alloc] initWithTitle:[error localizedDescription]
                                                            message:nil
                                                           delegate:nil
                                                  cancelButtonTitle:@"Ok"
                                                  otherButtonTitles:nil, nil] show];


    }

    if (result )
    {
        [self presentViewController:productVC animated:NO completion:nil];
    }

}];

i think this is ios 7 bug, any help greatly appricated

like image 308
sheraza Avatar asked Nov 01 '22 08:11

sheraza


1 Answers

This is a bug in iOS 7. See https://devforums.apple.com/message/951745 (requires Apple dev login) where an Apple employee confirms that "The SKSPVC does not support this currently. It currently only supports showing an individual product."

Pretty annoying, since this used to work great and was a great way for a company to show users its other apps. Back to the drawing board!

like image 158
Jack Nutting Avatar answered Nov 15 '22 05:11

Jack Nutting