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?

错误

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];

  }];

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.


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.


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.

链接地址: http://www.djcxy.com/p/82460.html

上一篇: 溢出为文本的背景颜色

下一篇: SKStoreProductViewController错误ITMLKITErrorDomain 101