cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <>
Subject Re: [DISCUSS] Local plugin configuration
Date Tue, 01 Sep 2015 23:33:29 GMT
> So what I'm missing from the plugin spec is the possibility to
> describe what preferences are available/required for the plugin to
> work.
It being under <feature> would imply this but I think you are asking about
the way currently things are. Yeah right now if preference is not added
under the <platform> a user wouldn't know about it.

> > All relevant platforms
> > will now need to support reading of these new tags, and have a way for
> > plugins to access them. This would be a major platform version bump
> because
> > of a new API needed for plugins (which is next for cordova-osx and
> > cordova-ios but the other platforms already have their major version
> > bumps). We could avoid a major version bump if we could shoehorn
> > namespacing the plugin preferences into the current settings [1].
> Is there already a JS API defined for plugins, that hey should expose?
> i.e we could then add the
> /* {object} */ Plugin.getConfiguration();
> to it.

No there is no API for this currently.

> >
> > The problem would be, if the new tags are specified in plugin.xml, and
> you
> > didn't have the newer platform installed, the plugin won't be configured
> > properly. This could be mitigated by having the required platform version
> > specified in an <engine> tag, but this will exclude your plugin from
> older
> > platforms.
> I think the plugins need to be backward compatible, you could add a
> fallback information, like
> <feature>
>    <param name="splashImage" defaultPreference="SplashScreenImage"
> default="cordova.png" />
> </feature>
> and plugman should copy over all params anyways, right?

They still won't be configured properly, since older platforms won't know
what to do with these new attributes, and won't save them for plugins to
access. The config parser is part of the platform. The plugin however,
could read this config.xml themselves of course but we're trying to solve
this in a generic way that is easier for plugin authors.

Also, I found an issue already filed (by me) essentially already asking for
what you want:

Perhaps we could continue on that issue, I've tentatively labeled the issue
for cordova-ios-5.0.x

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