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); }
Comments
Post a Comment