I'm trying to implement insomnia plugin to keep my app awake

And i’m not having success :frowning: , i installed it automatically


cordova plugin add https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin.git


cordova prepare


In my app.js i put these lines of code:

if (window.cordova && window.cordova.plugins && window.cordova.plugins.insomnia){

                             } else {
                             alert("insomnia plugin missing");

and i get:

“insomnia plugin missing” message

I posted here because i wanted to receive some guidance (i feel like i lose my north and don’t know what to do in order to get that plugin working). Please i need some help.

Thanks for reading,

window.plugins.insomnia not window.cordova.plugins.insomnia

Thank you! it worked, oh god i’m such a rookie in this.

Again , Thanks for answering. Guess that this topic can be closed.