Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background service not working with Android O #19

Open
squashmode opened this issue May 24, 2018 · 8 comments
Open

Background service not working with Android O #19

squashmode opened this issue May 24, 2018 · 8 comments
Labels
enhancement New feature or request

Comments

@squashmode
Copy link

Android O has changed the way things work in the background, and this service will not work on an Android O device in the background.

To reproduce, run the example project on a virtual Android O device, while subscribed to location updates, turn off the screen of the device. Updates stop (actually slow down to about once every 30 minutes) until the screen is turned back on.

@lukaspili
Copy link
Contributor

Background execution with location updates that wake up the application is not supported yet.

@lukaspili lukaspili added the enhancement New feature or request label May 24, 2018
@synio-wesley
Copy link

I see the same thing. On Android N locations keep coming through when the app is backgrounded, but this does not happen on Android O.

Ideally, I would like this change on Android N:

  • Option to keep tracking locations and send locations to REST server when OS kills backgrounded app or when user swipes away the app. (A 'stop tracking' option is available in the app itself when needed)

And for Android O the same, but right now it doesn't even send locations when the app is in background.

Does the background tracking work well on iOS 11? I haven't been able to test this yet.

Do you know when this functionality could become available in this plugin? I'm working on an app that needs to track boats in open water and am now looking at Flutter instead of Ionic, partly because the geolocation plugins for Ionic are not working very well in background on iOS.

In any case, thanks for your work on this plugin. Hopefully we can go the Flutter way.

@tegarkurniawan
Copy link

Is it still not possible on Android oreo?

@premy
Copy link

premy commented Mar 7, 2019

@synio-wesley Could you explain how you get the backgorund updates to work in Android N or lower, with the screen off? During my tests the updates get buffered when the app goes in the background but .listen() is not called, therefore the coords are not being sent to firestore, as per my requirement. Tried it on several devices with background and unrestricted data access enabled for my app.

StreamSubscription < LocationResult > subscription = Geolocation.locationUpdates( accuracy: LocationAccuracy.best, displacementFilter: 10.0, inBackground: true, ) .listen((result) { if (result.isSuccessful) { saveResult(result); } else {} });
As soon as I turn on the screen again, saveResult() get's called by each of the buffered results.

@Sly2024
Copy link

Sly2024 commented Feb 18, 2020

Hello,
Does anyone know if the new version has the same behaviour ?
Or is the .listen() called every time when the app is in background ?

@suha-glal
Copy link

suha-glal commented Mar 2, 2020

I have tried it on Android version 9 and the location updates stop when the app is not active in the foreground. I have switched from the plugin I am using to this plugin just for this feature. Unfortunately, it is not working.

@angel1st
Copy link

@lukaspili - does the plugin support background execution already?

@azeemgujjar
Copy link

I have tried it on Android version 9 and the location updates stop when the app is not active in the foreground. I have switched from the plugin I am using to this plugin just for this feature. Unfortunately, it is not working.

which plugin you are using now for foreground let me know if you found some stable plugin, i am really sick of these basic issues.. even flutter editor's favorite widget also have issues.. and the extremely bad thing is plugins owners damn care about bugs/issues.. i can i noticed 70% of issues are still not replied by anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants