当前位置:   article > 正文

AppStore应用评分_oc 开发 appstore 简易 评分

oc 开发 appstore 简易 评分

1、首先设置网络访问http
这里写图片描述

2、进行AppStore应用评分需要设置地址格式:

itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=APP_ID
  • 1

APP_ID为itunesConnect里面应用程序的Apple ID。

第一种方式:
跳转AppStore进行应用评分代码如下:

NSString *evaluateString = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",APP_ID];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:evaluateString]];
  • 1
  • 2

注意:使用真机测试,模拟器会报错误:

LaunchServices: ERROR: There is no registered handler for URL scheme itms-apps
  • 1

第二种方法:
添加StoreKit.framework
这里写图片描述

导入#import

 //方法二
    //初始化控制器
    SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
    //设置代理请求为当前控制器本身
    storeProductViewContorller.delegate = self;
    //加载一个新的视图展示
    [storeProductViewContorller loadProductWithParameters:
     //appId唯一的
     @{SKStoreProductParameterITunesItemIdentifier : APP_ID} completionBlock:^(BOOL result, NSError *error) {
         //block回调
         if(error){
             NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
         }else{
             //模态弹出appstore
             [self presentViewController:storeProductViewContorller animated:YES completion:^{

             }
              ];
         }
     }];
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

代理事件

#pragma mark-SKStoreProductViewControllerDelegate
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController{
    [self dismissViewControllerAnimated:YES completion:^{

    }];
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号