0
votes

I follow https://ionicframework.com/docs/native/background-mode for background mode but i got "Native: tried calling BackgroundMode.enable, but the BackgroundMode plugin is not installed." warning on console error plugin not installed. 1. install ionic cordova plugin add cordova-plugin-background-mode 2. npm install @ionic-native/background-mode 3. import library into app.module.ts "import { BackgroundMode } from '@ionic-native/background-mode/ngx'; " and add into provider. 4. add into main file app.component.ts on this.platform.ready

      this.backgroundMode.enable();
     console.log(this.backgroundMode.isActive());
1

1 Answers

1
votes

If you already are using a mobile device just run:

"ionic cordova prepare android" before running your app.

If you are trying to use this plugins with "ionic serve" you can't you need to use mobile device/simulator or run into the platform browser with:

"ionic serve --cordova --platform browser"

I really don't recommend using browser since it doesn't work very well in my opinion, my suggestion is use a phone.