Android ユーザーにアプリケーションの評価を促すベスト プラクティス アプローチはありますか? Amazon.com や Google マーケットプレイスから入手できることを考えると、ユーザーが投票できるようにこれを処理する最善の方法は何ですか?
9 に答える
Google マーケットプレイスについては、こちらのコード スニペットをご覧ください。代わりに、またはそれに加えて、Amazon Appstore を起動するように変更できると確信しています。
編集:サイトの URL 構造が変更されたように見えるので、上記のリンクを更新して現在は機能するようにしました。サイトが再びダウンした場合に備えて、 Wayback Machineにある古いコピーを次に示します。追加のバックアップとして投稿の主な内容を以下に貼り付けますが、リンクにアクセスしてコメントを読んだり、最新情報を入手したりすることもできます.
このコードは、エンゲージしているユーザーに、Android マーケットでアプリを評価するように促します (iOS Appirater に触発されています)。評価ダイアログが表示されるまでに、アプリの起動回数とインストールからの日数が必要です。
ニーズに合わせて調整APP_TITLE
しAPP_PNAME
ます。と も微調整する必要がありDAYS_UNTIL_PROMPT
ますLAUNCHES_UNTIL_PROMPT
。
AppRater.showRateDialog(this, null)
それをテストし、ダイアログの外観を微調整するために、Activity から呼び出すことができます。通常の使用法はAppRater.app_launched(this)
、アクティビティが呼び出されるたびに呼び出すことです (たとえば、onCreate メソッド内から)。すべての条件が満たされると、ダイアログが表示されます。
public class AppRater {
private final static String APP_TITLE = "YOUR-APP-NAME";
private final static String APP_PNAME = "YOUR-PACKAGE-NAME";
private final static int DAYS_UNTIL_PROMPT = 3;
private final static int LAUNCHES_UNTIL_PROMPT = 7;
public static void app_launched(Context mContext) {
SharedPreferences prefs = mContext.getSharedPreferences("apprater", 0);
if (prefs.getBoolean("dontshowagain", false)) { return ; }
SharedPreferences.Editor editor = prefs.edit();
// Increment launch counter
long launch_count = prefs.getLong("launch_count", 0) + 1;
editor.putLong("launch_count", launch_count);
// Get date of first launch
Long date_firstLaunch = prefs.getLong("date_firstlaunch", 0);
if (date_firstLaunch == 0) {
date_firstLaunch = System.currentTimeMillis();
editor.putLong("date_firstlaunch", date_firstLaunch);
}
// Wait at least n days before opening dialog
if (launch_count >= LAUNCHES_UNTIL_PROMPT) {
if (System.currentTimeMillis() >= date_firstLaunch +
(DAYS_UNTIL_PROMPT * 24 * 60 * 60 * 1000)) {
showRateDialog(mContext, editor);
}
}
editor.commit();
}
public static void showRateDialog(final Context mContext, final SharedPreferences.Editor editor) {
final Dialog dialog = new Dialog(mContext);
dialog.setTitle("Rate " + APP_TITLE);
LinearLayout ll = new LinearLayout(mContext);
ll.setOrientation(LinearLayout.VERTICAL);
TextView tv = new TextView(mContext);
tv.setText("If you enjoy using " + APP_TITLE + ", please take a moment to rate it. Thanks for your support!");
tv.setWidth(240);
tv.setPadding(4, 0, 4, 10);
ll.addView(tv);
Button b1 = new Button(mContext);
b1.setText("Rate " + APP_TITLE);
b1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + APP_PNAME)));
dialog.dismiss();
}
});
ll.addView(b1);
Button b2 = new Button(mContext);
b2.setText("Remind me later");
b2.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
ll.addView(b2);
Button b3 = new Button(mContext);
b3.setText("No, thanks");
b3.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (editor != null) {
editor.putBoolean("dontshowagain", true);
editor.commit();
}
dialog.dismiss();
}
});
ll.addView(b3);
dialog.setContentView(ll);
dialog.show();
}
}
Uri uri = Uri.parse("market://details?id=" + context.getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
context.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
UtilityClass.showAlertDialog(context, ERROR, "Couldn't launch the Google Playstore app", null, 0);
}
RateMeMaybe を使用することもできます: https://github.com/Kopfgeldjaeger/RateMeMaybe
構成するためのかなりのオプションが提供されます(最初のプロンプトまでの最小日数/起動、ユーザーが「今はしない」を選択した場合の次の各プロンプトまでの最小日数/起動、ダイアログのタイトル、メッセージなど)。使い方も簡単です。
README からの使用例:
RateMeMaybe rmm = new RateMeMaybe(this);
rmm.setPromptMinimums(10, 14, 10, 30);
rmm.setDialogMessage("You really seem to like this app, "
+"since you have already used it %totalLaunchCount% times! "
+"It would be great if you took a moment to rate it.");
rmm.setDialogTitle("Rate this app");
rmm.setPositiveBtn("Yeeha!");
rmm.run();
編集:プロンプトを手動でのみ表示したい場合は、RateMeMaybeFragment を使用することもできます
if (mActivity.getSupportFragmentManager().findFragmentByTag(
"rmmFragment") != null) {
// the dialog is already shown to the user
return;
}
RateMeMaybeFragment frag = new RateMeMaybeFragment();
frag.setData(getIcon(), getDialogTitle(), getDialogMessage(),
getPositiveBtn(), getNeutralBtn(), getNegativeBtn(), this);
frag.show(mActivity.getSupportFragmentManager(), "rmmFragment");
getIcon() を使用したくない場合は、0 に置き換えることができます。残りの getX 呼び出しは文字列に置き換えることができます
コードを変更して Amazon マーケットプレイスを開くのは簡単なはずです
たぶん、「いいね」オプションなどを使ってファンページへのFacebookリンクを設定しますか?メインメニューに小さなラベルが付いたアイコンで十分であり、ポップアップリマインダーほど煩わしいものではありません。
この 2 行のコードを [このアプリをランク付け] ボタンの下に記述するだけで、アプリをアップロードした Google ストアに移動します。
String myUrl ="https://play.google.com/store/apps/details?id=smartsilencer";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(myUrl)));
ここでの解決策は、ユーザーをアプリのWebページにリダイレクトすることだけだと思います。
Play ストアのポリシーでは、ユーザーにアプリで何らかのアクションを実行するよう通知する場合、ユーザーがそのアクションを実行したくない場合は、ユーザーが操作をキャンセルできるようにする必要があります。そのため、Play ストアでアプリの更新やアプリの評価を「はい (今すぐ)」でユーザーに依頼する場合は、「いいえ (後で、今はしない)」などのオプションも提供する必要があります。
rateButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
r.showDefaultDialog();
}
});
ここで、r は showDefaultDialog メソッドを含むクラスです
public void showDefaultDialog() {
//Log.d(TAG, "Create default dialog.");
String title = "Enjoying Live Share Tips?";
String loveit = "Love it";
String likeit = "Like it";
String hateit = "Hate it";
new AlertDialog.Builder(hostActivity)
.setTitle(title)
.setIcon(R.drawable.ic_launcher)
//.setMessage(message)
.setPositiveButton(hateit, this)
.setNegativeButton(loveit, this)
.setNeutralButton(likeit, this)
.setOnCancelListener(this)
.setCancelable(true)
.create().show();
}
完全な例をダウンロードするには [androidAone]: http://androidaone.com/11-2014/notify-users-rate-app-playstore/
簡単な解決策については、このライブラリを試して ください https://github.com/kobakei/Android-RateThisApp
ダイアログ、タイトル、メッセージを表示する基準などの構成を変更することもできます
いずれにせよ:例えばボタン
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData
(Uri.parse("market://details?id="+context.getPackageName()));
startActivity(intent);