我想打开一个确认窗口,该窗口会在应用启动时弹出。如果单击确定,则应将您重定向到Google Play商店以对该应用进行评分。 InAppView是非常糟糕的解决方案,无法对应在本机应用程序商店应用程序中实际打开的应用程序进行评分。
我试过了,但是没有用:
window.open("market://details?id=com.publishername.myapp");
还有这个:
window.open("https://play.google.com/store/apps/details?id=com.YourApp", "_system");
我已经阅读了其他一些主题,但是“解决方案”没有用。
是否可以将用户重定向到Play商店以对应用进行评分?
谢谢您的帮助!
最佳答案
基本上,评级代码应从android端处理。
以下是该代码:
public static void showRateDialog(final Context mContext) {
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setMessage(
"If you enjoy using "
+ APP_TITLE
+ ", please take a moment to rate it. Thanks for your support!")
.setTitle("Rate " + APP_TITLE)
.setCancelable(false)
.setIcon(R.drawable.ic_launcher)
.setPositiveButton("Rate TempleRun2",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
mContext.startActivity(new Intent(
Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/store/apps/details?id=com.imangi.templerun2")));
dialog.dismiss();
}
})
.setNegativeButton("Remind me later",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
})
.setNeutralButton("No\nThanks",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
希望这可以帮助。