apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 210 forks source link

Android suiteName compare null with empty string (0.99) #100

Closed ajfaura closed 7 years ago

ajfaura commented 7 years ago

Cordova is getting version 0.99 if no version is specified at package.json, instead of 0.7.7. This version (0.99) doesn't work at all at least in Android. Please fix this issue.

Plugin version:

Toolchain:

Platforms affected:

What the scope of your problem:

ajfaura commented 7 years ago

--> Ionic 2 cli

ajfaura commented 7 years ago

There bug is at execute method

`String suiteName = options.optString("suiteName");

    SharedPreferences sharedPrefs;
    if (suiteName != null) {
        sharedPrefs = cordova.getActivity().getSharedPreferences(suiteName, Context.MODE_PRIVATE);
    } else {
        sharedPrefs = PreferenceManager.getDefaultSharedPreferences(cordova.getActivity());
    }`

suiteName is never null. Correct code: String suiteName = options.optString("suiteName", null);

apla commented 7 years ago

fixed with version 0.99.1

apla commented 7 years ago

No feedback for over two months, closing