incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon MacDonald <simon.macdon...@gmail.com>
Subject Re: Plugin loading - on startup and on demand
Date Thu, 07 Jun 2012 13:08:58 GMT
On Android if you want to load a plugin on start up of the app you
just need to tag the plugin with the "onload" attribute set to "true".
For instance:

<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"
onload="true"/>

Note: this is an example. The SplashScreen plugin is not setup this
way in plugins.xml.

Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Jun 6, 2012 at 5:01 PM, Shazron <shazron@gmail.com> wrote:
> How are plugins loaded in the other platforms?
>
> Right now in iOS, a plugin is lazily loaded, that is - it is loaded
> only on first time use. There is a case for loading plugins at startup
> - like my iOS 5.1 local storage fix (CDVLocalStorage). Right now that
> plugin is hard-coded to load at startup, but I would like there to be
> a general plugin loading at startup feature in Cordova (at least iOS).
>
> In iOS, we have the "Plugins" key in Cordova.plist. Unfortunately - we
> can't just add a checkbox to the list since it's an Array. What I'm
> proposing (as a quick thing) is to add another Array in Cordova.plist
> for plugins that should be loaded at startup, say, a key called
> "Startup".
>
> The alternative is to change the "Plugins" Array of Strings to a
> Dictionary - then the Dictionary key will be the plugin Name and the
> Dictionary value would be a boolean saying whether it should be loaded
> at startup. But I tried it in Xcode, and the checkbox could be
> confused with whether the plugin is "enabled" or not.
>
> Yet another alternative is to change the "Plugins" Array of Strings to
> a "Plugins" Array of Dictionaries. Each dictionary would have two
> keys: "Name" (String), and "LoadOnStartup" (Boolean). Then it won't be
> ambiguous.
>
> Having a separate "Startup" list would be advantageous:
>
>    1. We don't have to make users upgrade their Cordova.plist/Plugins
> (backwards compatibility)
>    2. It is unambiguous what it is for (vs the changing
> Cordova.plist/Plugins to a Dictionary)

Mime
View raw message