Trying my hands on writing Blackberry Webworks plugins. I want to check the network status while on the "server" side of the cordova plugin. How do I add the network info API org.apache.cordova.network-information
so it'll be available in my plugin? I get the network-info to work if I use it in an app, but don't know how to make it work at my plugin level.
I tried adding <dependency id="org.apache.cordova.network-information" />
or
<feature name="NetworkStatus"> <param name="android-package" value="org.apache.cordova.networkinformation.NetworkManager" /> </feature>
in plugin.xml but neither works. Using the <dependency>
tag will make Webworks automatically include the network-info in the app build and install, but navigator.connection
is still undefined at the plugin server-side level. Help please!
Ok I figured out. Forget about using another pluging in my plugin.
The only line needed is window.qnx.webplatform.device.activeConnection
, which is defined whenever there is an active connection and can be used to check connection type.
The network plugin org.apache.cordova.network-information
is basically using that same call on the server side.