android config.xml to extensibility json

android config.xml to extensibility json

  


How can I set in the Extensibility config in JSON the following properties:

Configuring the plugin

The plugin requires configuration within your App's config.xml:

  <plugin name="cordova-background-geolocation">
    <variable name="LICENSE" value="YOUR_LICENSE_KEY" />
  </plugin>


Most important is linking the variable LICENSE to the plugin name.

So it looks like 

"preferences": {
        "global": [{
            "name": "<preference_name>",
            "value": "<preference_value>"
        }],
        "android": [{
// somewhere here the plugin name and Licence variable
            "name": "<preference_name>",
            "value": "<preference_value>"
        }]
    }

Hi Patrice,

Did you check this documentation topic?

Regards,

António Pereira

Ok, no that one I overlooked. I suppose the answer is something like:

"plugin": 
    {
        "identifier": "cordova-plugin",
       
        // If the plugin requires additional settings
        "variables": [{
            "name": "LICENSE",
            "value": "blabla1234"
        }
    }


But now comes the tricky part:

The plugin I use has this licence key, which is based on the app's generated namespace or App-identifier.

So when I use this plugin in another app with another App-identifier, the key will be invalid.
Thus, I'm trying to set the licence key in the Consuming app!
Is this going to work this way?


This is set in the consumer app:

"preferences": {
        "global": [{
            "name": "<preference_name>",
            "value": "<preference_value>"
        }],
        "plugin": {
            "identifier": "cordova-background-geolocation",
             "variables": [{
               "name": "LICENSE",
               "value": "blabla1234"
             }]
    }

This is set in the actual plugin eSpace:

{     "plugin":     {     "url": "https://github.com/Mygithubstuff/cordova-background-geolocation.git"     } }

Cheers,

Patrice

Hi Patrice,


Sorry for the late reply.


Unfortunately, in OutSystems you cannot have plugin variables by application yet. If you want to use the plugin with other apps, you will have to manually change the plugin variable each time you want to generate a new build.


Thank You,

Bruno