On Wed Mar 5 04:13 PM, Michal Mocny wrote:
> For cli workflow: hooks (including plugin hooks) can access config.xml
> <preference>'s for things like the sqllite compile example (recompile only if
> settings changed would be nice), and access <preference> at runtime for the
> console example.
> 
> For old workflow, perhaps sqllite is documented to manually run the hook to
> recompile whenever you want to change the default setting?
> 
> Just thinking about alternatives and/or solutions that are actually feasible 
> short
> term.
> 

Ya it could work, maybe something like:
<preference name="cordova-plugin-console@install" value="--prefer-console true" 
/> (passed to an install script)

Keep in mind 'install' options/config (only used once during the install 
process) aren't the same as 'runtime' options/config (dynamic, changed by user)

<preference name="cordova-plugin-console:use-console" value="true" /> (runtime 
options?)
<preference name="cordova-plugin-console:color" value="pink" />

Some high level code at how the install script could work:
https://github.com/jbondc/cordova-labs/blob/master/cordova-plugin-echo/plugin.xml#L14
https://github.com/jbondc/cordova-labs/blob/master/cordova-plugin-echo/src/preinstall.js

Not sure if we need a 'postinstall' script, instead in the preinstall.js could 
do something like:
project.onPostInstall('plugin.name', function(hookApi){

 // do something else..

});

Many ways it could work, this is more pursuing the sandbox idea. 

Reply via email to