赞
踩
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(); } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。