iOS 评论APP撰写评论

本文介绍了一种在iOS应用中实现应用评分的方法,包括通过跳转到App Store和使用模态视图控制器两种方式,提供了具体的Swift代码示例。

---- 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];

转载于:https://www.cnblogs.com/wq-gril/p/4874946.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值