美文网首页
iOS跳转到评分页面

iOS跳转到评分页面

作者: NextStepPeng | 来源:发表于2019-07-25 16:16 被阅读0次

    跳转到app应用评价页面

    NSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@&pageNumber=0&sortOrdering=2&mt=8", APPID];
    
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]];
    

    跳转到app在App Store中的应用下载页面

    NSString *urlStr = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", appId];
    // 跳转
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlStr]]; 
    

    在应用内,内置AppStore进行评分

    - (void)loadAppStoreController
    {
    // 初始化控制器
    SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
    // 设置代理请求为当前控制器本身
    storeProductViewContorller.delegate = self;
    [storeProductViewContorller loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:kAppId}  completionBlock:^(BOOL result, NSError *error)   {
    if(error)
    {
    NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
    }  else
    {
    // 模态弹出appstore
    [self presentViewController:storeProductViewContorller animated:YES completion:^{
    }];
    }
    //AppStore取消按钮监听
    - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
    {
    [self dismissViewControllerAnimated:YES completion:^{
    }];
    }
    
    

    相关文章

      网友评论

          本文标题:iOS跳转到评分页面

          本文链接:https://www.haomeiwen.com/subject/yvwhrctx.html