doorxp-blog

doorxp.com

Rate for App 代码实现

在app内部实现评价。App实现评价一般有下面几种方式:

1. 代码直接调用


[SKStoreReviewController requestReview];//ios10.3

Simulator Screen Shot - iPhone 7 Plus - 2017-08-07 at 17.38.40.png

Simulator Screen Shot - iPhone 7 Plus - 2017-08-07 at 17.38.35.png


优点:程序内,方便用户.


2.url 跳转

 NSString *strUrl = @"itms-apps://itunes.apple.com/app/id{APPID}?action=write-review";
 NSURL *url  = [NSURL URLWithString:strUrl];
 [[UIApplication sharedApplication] openURL:url];

优点:可以写评论,也能评星


3.SKStoreProductViewController

SKStoreProductViewController *product = [[SKStoreProductViewController alloc] init];
product.delegate = self;

//SKStoreProductParameterITunesItemIdentifier //iOS6.0
//SKStoreProductParameterProductIdentifier //iOS11

[product loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:@"APP ID"} 
completionBlock:^(BOOL result, NSError *error) {
}];

UIViewController *rooter = [UIApplication sharedApplication].delegate.window.rootViewController;
[rooter presentViewController:product animated:true completion:nil];

    


发表评论:

Powered By Z-BlogPHP 1.5.1 Zero

Copyright doorxp.com Rights Reserved.