ios android 跳转商店评分

ios跳转商店,商店内评分只支持ios 10.3以上的系统

+(void)openAppStore:(NSDictionary*) param

{

        if (@available(iOS 10.3, *))

         {

                //-- 系统支持非deeplink打开商城评论 --

                [SKStoreReviewController requestReview];

        }

        else

        {

                //-- 采用默认OpenUrl方法  --

                #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS )

                NSString* rateUsUrl = [param objectForKey:@"url"];

                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:rateUsUrl]];

                #endif

        }

}

android 谷歌打开商店评分(测试只能在测试轨道跟正式服上

参考谷歌文档

https://developer.android.google.cn/guide/playcore/in-app-review/kotlin-java?hl=th#java

​​​​​​​public static void openAppStoreReview() {
    try {
        ReviewManager manager = ReviewManagerFactory.create(Cocos2dxHelper.getActivity().getApplicationContext());
        Task<ReviewInfo> request = manager.requestReviewFlow();
        request.addOnCompleteListener(task -> {
            if (task.isSuccessful()) {
                
                // 打开商店成功
                ReviewInfo reviewInfo = task.getResult();
                Task<Void> flow = manager.launchReviewFlow(Cocos2dxHelper.getActivity(), reviewInfo);
                flow.addOnCompleteListener(taskFlow -> {
                    // The flow has finished. The API does not indicate whether the user
                    // reviewed or not, or even whether the review dialog was shown. Thus, no
                    // matter the result, we continue our app flow.
                    ");
                });
            } else {
                // There was some problem, log or handle the error code.
                @ReviewErrorCode int reviewErrorCode = ((ReviewException) task.getException()).getErrorCode();
                Log.v("TAG", "---- openAppStoreReview reviewErrorCode = " + reviewErrorCode);
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值