katzer / cordova-plugin-background-mode

Keep app running in background
Apache License 2.0
1.38k stars 1.02k forks source link

cordova.plugins.backgroundMode.isScreenOff is not a function #348

Open FPeters84 opened 6 years ago

FPeters84 commented 6 years ago

Hi all,

I am trying to get the 'isScreenOff' function from the README to work, but I keep getting: "cordova.plugins.backgroundMode.isScreenOff is not a function"

This is my code: function screenoff_test() { cordova.plugins.backgroundMode.isScreenOff(function(bool) { if (bool == true){ console.log('SCREENOFF_test: screen is OFF'); } else if (bool == false){ console.log('SCREENOFF_test: screen is ON'); } else { console.log('SCREENOFF_test: bool is ' + bool); } }); } I call this function after firing the deviceready event.

I might be doing something stupid, as I am not an experienced javascript developer :) Any help with this is much appreciated!

Kind regards, Franks

ThaZMan commented 6 years ago

I would like to know this as well.

boolow5 commented 6 years ago

same here

KeySeeDev commented 6 years ago

Same problem here

VikinGsX2 commented 6 years ago

Version 0.7.3 (not yet released) Check if screen is off on Android Wake-up device on Android Unlock device on Android

calguy1000 commented 5 years ago

I have version 0.7.3 from github as I am currently just developing my app.

But I still get this error.

lkonzen-garupa commented 5 years ago

Anything new about this issue? Still happening.

joemullenix-ks commented 5 years ago

Same story here.