cordova - Ionic 2: backgroundMode is never enabled -


i trying make app work in background plugin backgroundmode. however, enable in code, it's never enabled. have imported it. code:

declare var cordova:any;      console.log("started")     document.addeventlistener('deviceready', function () {            console.log("ready")     cordova.plugins.backgroundmode.enable();     if(cordova.plugins.backgroundmode.isenablisactive()==true){         console.log("it works!")     }}, false); 

it prints out started , ready

i have tried follow katzer's guide , solution, none of them worked me.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -