Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11951

Plugin preference default value is not being saved to <platform>.json

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.3.1
    • None
    • cordova-cli, cordova-lib
    • None
    • Windows 10 with anniversary update

    Description

      Plugin preference default value is not being saved to <platform>.json

      cordova create foo
      cd foo
      cordova platform add android
      cordova plugin add cordova-plugin-ms-azure-mobile-engagement --variable AZME_ANDROID_CONNECTION_STRING=Endpoint=0;AppId=0;SdkKey=0 --variable AZME_ENABLE_PLUGIN_LOG=false
      

      check out `./platforms/android/android.json` or `./pluguns/android.json`
      it has the following lines:

      "installed_plugins": {
              <...>
              "cordova-plugin-ms-azure-mobile-engagement": {
                  "AZME_ENABLE_PLUGIN_LOG": "false",
                  "AZME_ANDROID_GOOGLE_PROJECT_NUMBER": "null",
                  "AZME_ANDROID_REACH_ICON": "icon",
                  "AZME_ANDROID_CONNECTION_STRING": "Endpoint=0;AppId=0;SdkKey=0",
                  "PACKAGE_NAME": "io.cordova.hellocordova"
              }
          },
      

      You can see that "AZME_ENABLE_PLUGIN_LOG" is saved here, while "AZME_ENABLE_NATIVE_LOG" is not.

      They both can be found in the plugin section of the plugin's `plugin.xml` file:
      https://github.com/Azure/azure-mobile-engagement-cordova/blob/master/plugin.xml#L29

      Note that the Android-specific preferences have been saved correctly.

      cordova@6.3.0 doesn't have this issue.

      Attachments

        Issue Links

          Activity

            People

              Nikita Matrosov Nikita Matrosov
              alsorokin Alexander Sorokin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: