You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used this plugin in Córdoba without problems, this time I use it in a capacitor, I will attach the steps to make it run
npm i cordova-plugin-background-mode --force
npm install cordova-plugin-background-mode@github:Mforcen/cordova-plugin-background-mode#2b9a4de --force
npm i cordova-plugin-device --force
ionic cordova plugin add cordova-plugin-device
You must manage the permissions yourself, you can use a plugin like android permissions or guide the user to the configuration to enable them, normally this plugin is used to obtain the gps in the background, the gps will only ask for permissions to use with the app in foreground, but by adding the following permissions in your android manifest, you will be able to see the allow all time permission on your location
Allow all the time
Permissions on your android manifest
The permission must be added to disable battery saving for the background mode to work, when adding the permission the application will automatically request it
At this point the previous steps should work in cordova as well, in capacitor it generates an error in getView() when reopening the app
A temporary solution is to modify a line in the plugin. I attach the commit link.
I hope the information is useful to you.
I have used this plugin in Córdoba without problems, this time I use it in a capacitor, I will attach the steps to make it run
npm i cordova-plugin-background-mode --force
npm install cordova-plugin-background-mode@github:Mforcen/cordova-plugin-background-mode#2b9a4de --force
npm i cordova-plugin-device --force
ionic cordova plugin add cordova-plugin-device
You must manage the permissions yourself, you can use a plugin like android permissions or guide the user to the configuration to enable them, normally this plugin is used to obtain the gps in the background, the gps will only ask for permissions to use with the app in foreground, but by adding the following permissions in your android manifest, you will be able to see the allow all time permission on your location
Allow all the time
Permissions on your android manifest
The permission must be added to disable battery saving for the background mode to work, when adding the permission the application will automatically request it
At this point the previous steps should work in cordova as well, in capacitor it generates an error in getView() when reopening the app
A temporary solution is to modify a line in the plugin. I attach the commit link.
0bc885c.
With the previous notes you should be able to run the background, v5 capacitor is being used, the tests were done with Android 10 and Android 13
The text was updated successfully, but these errors were encountered: