cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Cruz Viotti <juanchivio...@gmail.com>
Subject Access config.xml preferences from the JavaScript side of a plugin
Date Wed, 06 Aug 2014 02:15:21 GMT
Hi everyone,

I’ve stumbled in the situation where I want to read the value of a preference present in
config.xml from the JavaScript side of a Cordova plugin. 

My current approach is the following:

-  Create a native service (iOS in this case) with a method called `getPreference` which queries
`self.commandDelegate.settings`.
- Wait on the `deviceready` event from the plugin’s JavaScript file.
- Call `getPreference` with `cordova.exec`.

I’d like to avoid this complexity and overhead and just be able to query the preferences
from the JavaScript side of the plugin, without depending on the native side.

I’ve created a StackOverflow question (http://stackoverflow.com/questions/24939920/access-config-xml-preferences-from-javascript-plugins)
some time ago (tagged as Cordova) but it was never answered. I’ve also found a very similar
question that wasn’t answered neither: http://stackoverflow.com/questions/22744269/is-there-a-cordova-plugin-to-read-values-from-config-xml?lq=1.

I’ve looked at Cordova modules such as argscheck, channel, utils, etc in the GitHub repo
(https://github.com/apache/cordova-js) however I couldn’t find what I’m looking for.

Can someone point me in the right direction?

Thanks a lot in advance.

Regards,

---
Juan Cruz Viotti, Software Engineer
juanchiviotti@gmail.com








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