当前位置:   article > 正文

ios android 跳转商店评分

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();
    }
}
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/738405
推荐阅读
相关标签
  

闽ICP备14008679号