demo: http://www.cocoachina.com/ios/20160517/16299.html

 

 

 

第一种:跳转到Appstore打开评分

NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@?action=write-review", KAPPID];
    [[UIApplication sharedApplication]openURL:[NSURL URLWithString:str]];

  

第二种:APP内部打开页面跳转到评分 

  /*
     >>>>>苹果IOS6.0提供了一个框架StoreKit.framework,
     1.导入StoreKit.framework,
     2.在需要跳转的控制器里面添加头文件 #import <StoreKit/StoreKit.h>,
     3.实现代理方法:< SKStorePRoductViewControllerDelegate >
     */

 SKStoreProductViewController *storeProductViewController;

 [storeProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:KAPPID} completionBlock:^(BOOL result, NSError * _Nullable error) {
        
        if (error)
            DLog(@"error %@ with userInfo %@",error,[error userInfo]);
        else
            [self presentViewController:storeProductViewController animated:YES completion:nil];
    }];



//Appstore 取消按钮的回调
-(void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
{
    [storeProductViewController dismissViewControllerAnimated:YES completion:nil];
}

  

第三种:APP内打开评分弹框(IOS10.3之后的方法)

  //   导入StoreKit.framework,#import "Availability.h"(用于判断 ios 版本)

  if (__IPHONE_10_3)
        //一句话实现在App内直接评论了。然而需要注意的是:打开次数一年不能多于3次。(当然开发期间可以无限制弹出,方便测试)
        [SKStoreReviewController requestReview];
    else
        [JDMessageView showMessage:@"版本不支持此方法"];
    

  

  

相关文章:

  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
  • 2021-07-10
猜你喜欢
  • 2022-12-23
  • 2021-12-03
  • 2021-04-19
  • 2021-12-17
  • 2021-11-21
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案