---- iOS 应用评分
UIAlertAction *alertAction1 = [UIAlertAction actionWithTitle:@"方式1 跳转到app商店" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSString *APPid = @"应用的ID";
NSString *strloc = [NSString stringWithFormat: @"https://itunes.apple.com/us/app/qu-qi-wen-da/id%@?ls=1&mt=8",APPid];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:strLoc]];
}];
UIAlertAction *alertAction2 = [UIAlertAction actionWithTitle:@"方式2 以模态跳转的方式应用内进行评分" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
storeProductViewContorller.delegate = self;
[storeProductViewContorller loadProductWithParameters: @{SKStoreProductParameterITunesItemIdentifier : @"应用的ID"} completionBlock:^(BOOL result, NSError *error) {
if (result) {
[self presentViewController:storeProductViewContorller animated:YES completion:nil];
}
}];
}];
UIAlertAction *alertAction3 = [UIAlertAction actionWithTitle:@"残忍的拒绝" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"残忍的拒绝");
}];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"为”APP“评分" message:@"如果你觉得APP好用,可否为其评一个分数,评分过程只需花很少的时间,感谢您的支持!" preferredStyle:UIAlertControllerStyleActionSheet];
[alertController addAction:alertAction1];
[alertController addAction:alertAction2];
[alertController addAction:alertAction3];
[self presentViewController:alertController animated:YES completion:nil];