javascript - openSettings plugin cordova -


i installed plugin opensettings via node.js command in project:

cordova plugin add https://github.com/erikhuisman/cordova-plugin-opensettings.git 

but when use method opensettings.setting() logcat return me error:

opensettings.settings error @ file:///android_asset/www/plugins/nl.tapme.cordova.opensettings/www/opensettings.js:23

this opensettings.js:

cordova.define("nl.tapme.cordova.opensettings.opensettings", function(require, exports, module) { module.exports = opensettings = {};  opensettings.settings = function(app, callback) {     cordova.exec(         // success callback         callback,         // failure callback         function(err) { console.log('opensettins.settings error'); },         // native class name         "opensettings",         // name of method in native class.         "settings",         // array of args pass method.         []     ); };  opensettings.bluetooth = function (app, callback) {     cordova.exec(         // success callback         callback,         // failure callback         function(err) { console.log('opensettings.bluetooth error'); },         // native class name         "opensettings",         // name of method in native class.         "bluetooth",         // array of args pass method.         []     ); };  opensettings.bluetoothstatus = function (app, callback) {     cordova.exec(         // success callback         callback,         // failure callback         function(err) { console.log('opensettins.bluetoothstatus error'); },         // native class name         "opensettings",         // name of method in native class.         "bluetoothstatus",         // array of args pass method.         []     ); };  opensettings.bluetoothchange = function (callback) {     cordova.exec(         // success callback         callback,         // failure callback         function(err) { console.log('opensettins.bluetoothchange error'); },         // native class name         "opensettings",         // name of method in native class.         "bluetoothchange",         // array of args pass method.         []     ); };  return opensettings;  }); 

anyone can me?

i suggest test plugin -> https://github.com/selahssea/cordova-open-native-settings first 1 posted did not work me too.

install this:

cordova plugin add https://github.com/selahssea/cordova-open-native-settings.git 

and use this:

cordova.plugins.settings.open(settingssuccess,settingsfail); 

full snippet:

function settingssuccess() {     console.log('settings opened'); }  function settingsfail() {     console.log('open settings failed'); }  function opensettingsnow() {     cordova.plugins.settings.open(settingssuccess,settingsfail); } 

the plugin open overview: enter image description here


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -