i working in phonegap project android handling notifications. need control light of screen turn on screen when event occurs (arrives notification) or turn off screen after while of inactivity.
i have tried phonegap plugins insomnia, keepscreenon , these plugins keep light of screen on.
please help...
using screendim can turn off , on screen light. here code example of it.
document.getelementbyid('turnoff').addeventlistener('touchstart', function (e) { cordova.screendim.disable(); }); // turn on document.getelementbyid('turnon').addeventlistener('touchstart', function (e) { cordova.screendim.enable(); }); // toggle document.getelementbyid('toggle').addeventlistener('touchstart', function (e) { cordova.screendim.toggle(); });
Comments
Post a Comment