EddyVerbruggen / Insomnia-PhoneGap-Plugin

:sleepy: Prevent the screen of the mobile device from falling asleep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working on nexus 5

gerbil opened this issue · comments

Installed 3rd Party Plugins in phonegap build:
nl.x-services.plugins.insomnia - 3.0

button onclick="window.plugins.insomnia.keepAwake()"
button onclick="window.plugins.insomnia.allowSleepAgain()" - In index.html

nothing happens after click on the buttons above..


i've tryed to use callbacks:
onclick="window.plugins.insomnia.keepAwake(alert('success'),alert('not success'))"

but everytime i got two callbacks pushed

Hi, that's not valid syntax for callbacks. Try this:
onclick="window.plugins.insomnia.keepAwake(function(){alert('success')}, function(){alert('not success')})"

thnx, now it's 'not success'

Can you share your full code with me? Please mail your project to eddyverbruggen[at]gmail.com and I'll have a look!