iOS应用跳转至app store 评分页

// 打开AppStore应用程序,进入评分区

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://itunes.apple.com/cn/app/fang-pin-hui-kan-fang-mai/id1031818254?mt=8"]];

// 打开新的控制器,进入评分区
// 苹果提供的框架

StoreKit.framework


SKStoreProductViewController *storeVC = [[SKStoreProductViewController alloc] init];
    storeVC.delegate = self;
    [storeVC loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier :@"1031818254"}completionBlock:^(BOOL result, NSError * _Nullable error) {
        //block回调
        if(error){
            NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
        }else{
            //模态弹出appstore
            [self presentViewController:storeVC animated:YES completion:^{
                
            }
             ];
        }
    }];



// 评分完成调用
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

你可能感兴趣的:(iOS应用跳转至app store 评分页)