// 导入StoreKit.framework,
// 控制器里面添加框架#import
// 实现代理SKStoreProductViewControllerDelegate
- (void)goAppStoreAppPage {
SKStoreProductViewController *storeVC = [[SKStoreProductViewControlleralloc] init];
storeVC.delegate = self;
__weak typeof(ViewController) *weakVC = self;
//加载一个新的视图展示
[storeVC loadProductWithParameters:
@{SKStoreProductParameterITunesItemIdentifier : @"输入您的 appId "}completionBlock:^(BOOL result, NSError *error) {
if(error){
DLog(@"错误%@",error);
}else{
DLog(@"app store");
[weakVC.navigationController presentViewController:storeVCanimated:YES completion:nil];
}
}];
}
#pragma mark - 评分取消按钮监听
//取消按钮监听
- (void)productViewControllerDidFinish:(SKStoreProductViewController*)viewController {
[self dismissViewControllerAnimated:YES completion:nil];
}