cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Santana <csantan...@gmail.com>
Subject Re: Get customized feature parameter value from config.xml
Date Wed, 16 Apr 2014 02:06:49 GMT
Shaz do we have a jira item for this limitation?

Maybe something that can be address short term via plugin dev docs, and
long term maybe with new config.xml/json :-)



On Mon, Apr 14, 2014 at 4:29 PM, Li, Jonathan <jonathan.li@sap.com> wrote:

> That works. Thanks.
>
> On 4/14/14 4:26 PM, "Shazron" <shazron@gmail.com> wrote:
>
> >Yes, that is the known limitation. My suggestion is to prefix the
> >preference name with your plugin name, or whatever you prefer.
> >
> >
> >On Mon, Apr 14, 2014 at 1:12 PM, Li, Jonathan <jonathan.li@sap.com>
> wrote:
> >
> >> Although the preference can be defined in plugin.xml on per platform and
> >> plugin level, but when the information is used to generate config.xml,
> >>the
> >> related preference element will be generated under the root "widget"
> >> element, and so shared by all plugins. This may cause conflict if the
> >>same
> >> preference name is used by multiple plugins.
> >>
> >>
> >>
> >> On 4/14/14 3:48 PM, "Shazron" <shazron@gmail.com> wrote:
> >>
> >> >per platform in the platform tag - yes.
> >> >plugin level  - yes.
> >> >
> >> >
> >> >On Mon, Apr 14, 2014 at 11:34 AM, Li, Jonathan <jonathan.li@sap.com>
> >> >wrote:
> >> >
> >> >> Does "preference" can be set on per platform and plugin level?
> >> >>
> >> >> On 4/14/14 2:27 PM, "Shazron" <shazron@gmail.com> wrote:
> >> >>
> >> >> >Will a <preference />  tag not suffice?
> >> >> >
> >> >> >
> >> >> >On Mon, Apr 14, 2014 at 11:23 AM, Li, Jonathan <jonathan.li@sap.com
> >
> >> >> >wrote:
> >> >> >
> >> >> >> Hi,
> >> >> >> In the following sample plugin.xml and config.xml , the parameter
> >> >> >> "enable-redirect" can be configured by app developers when
they
> >>add
> >> >>the
> >> >> >> plugin to cordova project. However, currently only "ios-package"
> >>and
> >> >> >> "onload" parameters are parsed and stored by config.xml's
settings
> >> >> >>parser,
> >> >> >> other parameters (like "enable-redirect") are ignored by the
> >>settings
> >> >> >> parser, so plugin developer has to parse the config.xml again
by
> >> >> >>themselves
> >> >> >> in order to get the other parameters' value.
> >> >> >>
> >> >> >> Just wonder it maybe a good idea to parse all parameters under
> >> >>feature
> >> >> >> element, and return it as a "param" dictionary, so as to make
it
> >> >>ready
> >> >> >>to
> >> >> >> use by developers within plugin's native code.
> >> >> >>
> >> >> >> Plugin.xml:
> >> >> >>   <platform name="ios">
> >> >> >> <config-file target="config.xml" parent="/widget">
> >> >> >> <feature name="myplugin">
> >> >> >> <param name="ios-package" value="myPlugin"/>
> >> >> >> <param name="onload" value="true"/>
> >> >> >> <param name="enable-redirect" value="$REDIRECT"/>
> >> >> >> </feature>
> >> >> >> </config-file>
> >> >> >>         <source-file src="ios/libs/myPlugin.a" framework="true"/>
> >> >> >>     </platform>
> >> >> >>
> >> >> >> Config.xml
> >> >> >>     <feature name="myplugin">
> >> >> >>         <param name="ios-package" value="myplugin" />
> >> >> >>         <param name="onload" value="true" />
> >> >> >>         <param name="enable-redirect" value="true" />
> >> >> >>     </feature>
> >> >> >>
> >> >> >> Thanks
> >> >> >> Jonathan
> >> >> >>
> >> >>
> >> >>
> >>
> >>
>
>


-- 
Carlos Santana
<csantana23@gmail.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message