PomepuyN / discreet-app-rate

A lightweight non intrusive app rate reminder for Android
http://nicolaspomepuy.fr/non-intrusive-app-rate
Apache License 2.0
464 stars 51 forks source link

Add support for other Android markets as well. #5

Open alexeyvasilyev opened 10 years ago

alexeyvasilyev commented 10 years ago

Add support for Amazon AppStore, Blackberry AppWorld (BB10 devices), Samsung Apps.

The algorithm should be:

  1. Is Google Play installed => rate via Google Play.
  2. Is Amazon AppStore installed => rate via Amazon AppStore.
  3. etc.

Intents to be used: // Amazon AppStore Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse("http://www.amazon.com/gp/mas/dl/android?p=" + packageName)); activity.startActivity(intent); // More info at https://developer.amazon.com/appsandservices/resources/marketing-tools/using-badges // Maybe using "amzn://android?p=" + packageName is better

// BlackBerry AppWorld Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName)); activity.startActivity(intent);

// Samsung Apps Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse("samsungapps://ProductDetail/" + packageName)); activity.startActivity(intent); // More info at http://developer.samsung.com/android/technical-docs/Samsung-Apps-Deeplink-Guide

PomepuyN commented 10 years ago

Thanks for the doc. It will be added.

alexeyvasilyev commented 10 years ago

Let me know when you done. I will make the testing.

MufriA commented 10 years ago

Correct approach to detect the app store is to use installer package name.

Say in Galaxy S4, Google Play Store / Amazon App Store and Samsung App store can coexist, and app can be downloaded from any of these app store. We are supposed to redirect to respective app stores.

public static boolean isPlayStore(Context context) {
        String installer = context.getPackageManager()
                .getInstallerPackageName(context.getPackageName());
        if (installer == null || (installer != null && (installer.equals("com.android.vending")
                || installer.equals("com.google.android.feedback")))) {
            return true;
        } else {
            return false;
        }
    }

PlayStore - com.android.vending / com.google.android.feedback Amazon App Store - com.amazon.venezia

No reliable way to find our samsung app store.

alexeyvasilyev commented 10 years ago

Just some notes regarding Amazon Fire TV apps. "the the ability to rate apps is not currently supported by Amazon Fire TV. Your app should not prompt the user for a rating." https://developer.amazon.com/sdk/asb/faq.html

I guess the AppRate should detect if the current model is Amazon Fire TV and should not show rate me dialog.

Q: What is the model for Amazon Fire TV (android.os.Build.MODEL)? A: "AFTB". For forward-compatibility with future devices, check only the first three characters ("AFT"). Ensure that you also check that the manufacturer (android.os.Build.MANUFACTURER) is "Amazon".

alorma commented 10 years ago

Any option to provide custom Markets? Just as add my own server checks? (Provider url, check method)...