Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SKStoreProductViewController error ITMLKITErrorDomain 101

In my app I show more apps with SKStoreProductViewController, but the Apple store review team rejects it with the reason:

"An error message displays when tapping on the more apps button."

Everything works fine when I test it on my devices.

Below is the screenshot Apple sent me, what could be the problem?

error

Sample code:

 __weak typeof(self) weakSelf = self;
  SKStoreProductViewController* vc = [[SKStoreProductViewController alloc] init];
  vc.delegate = self;
  [vc loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : @1000000000} completionBlock:^(BOOL result, NSError * _Nullable error) {
    if(result==NO){
      //handle failure
      return;
    }
    [weakSelf presentViewController:vc animated:YES completion:nil];

  }];
like image 590
kjhkjhkjh Avatar asked Nov 03 '14 17:11

kjhkjhkjh


3 Answers

ITMLKitErrorDomain errors frequently occur when a SKStoreProductViewController tries to call loadProductWithParameters with invalid parameters. Example full error:

<Warning>: [SKStoreProductViewController]: Did fail with error: Error Domain=ITMLKitErrorDomain Code=101 "The operation couldn’t be completed. (ITMLKitErrorDomain error 101.)" UserInfo={ ... } {ITMLKitErrorHTTPStatus=400}

Verify you do not have any typos or unexpected keys in your parameters dictionary when calling loadProductWithParameters. Verify the values for keys such as SKStoreProductParameterITunesItemIdentifier and SKStoreProductParameterAffiliateToken are valid.

like image 137
JAL Avatar answered Nov 15 '22 05:11

JAL


If you are not experiencing this issue on test devices, just send it to review again, this could be a temporary issue with itunes site (it is used to show these "more apps", isn't it?). There are several mentions of that problem over the internet without any solution.

like image 23
Grief Avatar answered Nov 15 '22 04:11

Grief


During investigation of youre issue it is possible to conclude that is quite rare case that could be connected with wrong product id in case of SkProductViewController. Also you should check if you are trying to show single app or amount of them. Because Apple have bug that is connected with showing of multiple items.

I am using SKStoreProductViewController in this way. This is code block that show app in App Store:

SKStoreProductViewController *storeProductViewController = [[SKStoreProductViewController alloc] init];

    [storeProductViewController setDelegate:self];
    [storeProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : @"xxxxx"} completionBlock:^(BOOL result, NSError *error) {
        if (error) {
            NSLog(@"Error %@ with User Info %@.", error, [error userInfo]);

        } else {
            [self presentViewController:storeProductViewController animated:YES completion:nil];
        }
    }];

Then i use delegate SKStoreProductViewControllerDelegate like this:

- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
    [self dismissViewControllerAnimated:YES completion:nil];
}

Also i use [button setExclusiveTouch:YES]; because customers some times press few buttons with products. Also test you're id if it is single product.

like image 1
Oleg Gordiichuk Avatar answered Nov 15 '22 04:11

Oleg Gordiichuk