EddyVerbruggen / Insomnia-PhoneGap-Plugin

:sleepy: Prevent the screen of the mobile device from falling asleep
264 stars 106 forks source link

Not working on nexus 5 #2

Closed gerbil closed 10 years ago

gerbil commented 10 years ago

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

EddyVerbruggen commented 10 years ago

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

gerbil commented 10 years ago

thnx, now it's 'not success'

EddyVerbruggen commented 10 years ago

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

gerbil commented 10 years ago

Sent