I am trying to install background Mode in ionic.
ionic cordova plugin add cordova-plugin-background-mode
npm install --save @ionic-native/background-mode@4
Below is error
getting below warning ionic cordova plugin add cordova-plugin-background-mode $ npm install --save @ionic-native/background-mode@4
and when I use in Home.ts file it says as
pluginWarn @ vendor.js:52024 vendor.js:52018 Native: tried calling BackgroundMode.un, but the BackgroundMode plugin is not installed. pluginWarn @ vendor.js:52018 vendor.js:52024 Install the BackgroundMode plugin: 'ionic cordova plugin add cordova-plugin-background-mode' pluginWarn @ vendor.js:52024 vendor.js:1639 ERROR plugin_not_installed
can somebody suggest?
I found solution. Check your cordova version
Now cordova version is 9.0.0 then problem will be there. Referece: https://forum.ionicframework.com/t/backgroundmode-not-installing-cordova-9/160226/4 Now globally uninstall cordova by following command
It will give full path of cordova Now, npm uninstall -g cordova It will remove cordova globally Now install specific version of cordova here, npm install -g [email protected] It will install cordova version 8.0.0 and you can now able to install BackgroundMode plugin. Thank you and enjoy