I try to create a background task for my Ionic 2 app. I found this :
But my IDE doesn't found "backgroundMode" in this line :
Cordova plugins only work in devices. You can not use them on browser during development.
If you want to test that plugin, you should run your app with
ionic run android (or ios) with a device plugged to PC or use an emulator. You can also run
ionic build and install the debug package on a device.
In development, you can declare cordova variable with
declare var cordova:any; at begining of script to avoid IDE errors of cordova being an undefined variable.