使用SKStoreViewController更新我的应用程序,只有完成按钮才能触发完成委托。
我不明白的两件事 (1)Apple文档指示完成和更新同时显示完成委托。 (2)如何知道更新已完成。
在High Sierra上使用iOS 12.1和xCode 10.1
帮助,我在做什么错??????
感谢您的帮助。
这是我的代码:
-(void)loadAppStoreProductViewController
{
NSLog(@"\nloadAppStoreProductViewController");
UIViewController *viewController = self.navigationController.visibleViewController;
SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc]init];
storeViewController.delegate = (id)self;
NSNumber *identifier = [NSNumber numberWithInteger:self.appID];
NSDictionary *parameters = @{ SKStoreProductParameterITunesItemIdentifier:identifier };
[self showWaitMessageView];
[storeViewController loadProductWithParameters:parameters
completionBlock:^(BOOL result, NSError *error) {
if(result) {
[viewController presentViewController:storeViewController
animated:YES
completion:
^{
[self removeWaitMessageView];
}];
} else {
NSLog(@"loadProductWithParameters: %@", error.description);
[self removeWaitMessageView];
}
}
];
[self handleAppIconBadgeNumber];
}
-(void)productViewControllerDidFinish:(SKStoreProductViewController *)storeViewController
{
NSLog(@"\nproductViewControllerDidFinish");
[self removeWaitMessageView];
[storeViewController dismissViewControllerAnimated:YES completion:nil];
[self handleAppIconBadgeNumber];
}