You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make brightness.js file with this lines:
document.addEventListener('deviceready', onDeviceReady);
function onDeviceReady() {
window.brightness = cordova.require("cordova.plugin.Brightness.Brightness");
}
function setBrightness(value) {
brightness.setBrightness(value, win, fail);
}
function getBrightness() {
brightness.getBrightness( win, fail);
}
function win(status) {
alert('Message: ' + status);
}
function fail(status) {
alert('Error: ' + status);
}
call setBrightness(0.6);
All i have in ADB is "D/CordovaLog( 2007): file:///android_asset/www/js/brightness.js: Line 8 : Uncaught ReferenceError: brightness is not defined"
This error point to the "brightness.setBrightness(value, win, fail);" line.
I try to remake project, clean plugin dir and redownload it, and many other things...
Where is my mistake?
Thank you!
The text was updated successfully, but these errors were encountered:
sometimes phonegap projects fail to use plugins. it occures randomly for unknown reason. I have found the way to solve this problem. You should use plugman instead of built in phonegap plugin manager. I'm in doubt wheither it will solve the problem or not since I didn't use the plugin for about year.
Hello!
Don't know why but i can't make it work for Android.
What i have already:
document.addEventListener('deviceready', onDeviceReady);
function onDeviceReady() {
window.brightness = cordova.require("cordova.plugin.Brightness.Brightness");
}
function setBrightness(value) {
brightness.setBrightness(value, win, fail);
}
function getBrightness() {
brightness.getBrightness( win, fail);
}
function win(status) {
alert('Message: ' + status);
}
function fail(status) {
alert('Error: ' + status);
}
All i have in ADB is "D/CordovaLog( 2007): file:///android_asset/www/js/brightness.js: Line 8 : Uncaught ReferenceError: brightness is not defined"
This error point to the "brightness.setBrightness(value, win, fail);" line.
I try to remake project, clean plugin dir and redownload it, and many other things...
Where is my mistake?
Thank you!
The text was updated successfully, but these errors were encountered: