Tuesday, 26 June 2018

React Native : Google maps service keeps running in Android devices even after the app is exited

When the app is in foreground everything seems to works fine.But when we force close/kill the app the map service still seems to work even after the MapView has been destroyed.We are running a background service which lets the app run in background.All the foreground services are killed when app is closed but we noticed a huge battery drain when the app is background and when we ran the Android Profiler we got to know that a service from google maps(csi.gstatic.com) is still open/running even in the background. When researched and got to know that google maps uses the service to load the static content(images..etc) for the map.Typically the service shouldn't be running when the MapView has been destroyed.
When App is in foregroundWhen app is in backgroun/killed state
The first image is when the app is foreground and service is running normally. The second image is when the app is background/killed and the service is still running even though the MapView has been destroyed.(The events is fabric service).Is there a way to kill all the services related to the MapView?


from React Native : Google maps service keeps running in Android devices even after the app is exited

No comments:

Post a Comment