JackAppDev / flutter_iap

Flutter iap plugin
MIT License
100 stars 15 forks source link

Support IAP in kindle devices #11

Closed Rockvole closed 6 years ago

Rockvole commented 6 years ago

Hi, Do you plan to add support for Amazon Kindle devices ?

JackAppDev commented 6 years ago

Are they not supported because they don't use Google play?

Rockvole commented 6 years ago

The Apple App Store does not use Google Play.

I expect you can detect what store is installed and provide IAP for either store. https://developer.amazon.com/docs/in-app-purchasing/iap-overview.html

https://developer.amazon.com/docs/in-app-purchasing/iap-migrate-from-google-iab-to-amazon-iap.html

Rockvole commented 6 years ago

Apparently, Amazon has 10% of the tablet market share (admittedly not a huge market). https://techcrunch.com/2018/02/06/apple-continues-to-dominant-the-tablet-market/

Although IMO Amazon devices have a very high percentage with purchasing enabled since it is all connected to their Amazon account.

JackAppDev commented 6 years ago

Its easy to know what platform the flutter app is running on (iOS/Android) but im not sure if there is an easy way for detecting amazon devices.

Rockvole commented 6 years ago

I believe you would detect which store is installed. So to detect the play store, you can do :

if(AndroidTools.isPackageInstalled(context, AndroidTools.C_PLAY_STORE) {
  // Play store available
}

public static final String C_PLAY_STORE = "com.android.vending";
public static final boolean isPackageInstalled(Context ctx, String packageName) {
    try {
        ctx.getPackageManager().getPackageInfo(packageName, 0);
    } catch (PackageManager.NameNotFoundException e) {
        return false;
    }
    return true;
}
Rockvole commented 6 years ago

Looks like Amazon is com.amazon.venezia

https://stackoverflow.com/questions/17629787/how-android-app-can-detect-what-store-installed-it

JackAppDev commented 6 years ago

I suggest you submit a PR. I do not plan on adding this myself.

Rockvole commented 6 years ago

I asked amazon : https://forums.developer.amazon.com/questions/180254/support-flutter-iap-for-kindle-devices.html

Rockvole commented 5 years ago

Incase anyone is looking for it, the dooboolabs plugin now supports Amazon kindle devices. https://github.com/dooboolab/flutter_inapp_purchase