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: true Has no effect #59

Open
RomanJos opened this issue Mar 23, 2020 · 6 comments
Open

background: true Has no effect #59

RomanJos opened this issue Mar 23, 2020 · 6 comments

Comments

@RomanJos
Copy link

Hi I just want to understand what background option is for ? Because it feels like wheneve the app get paused by Android the location stream pause also where a timer function normally, I'm trying to get the location and update it on the map but if I press home or recent app for example, Geolocation.locationUpdates don't output anything. I'm am not talking about update when we close the app on the recent app list because its different from each app etc

@HeikkiK
Copy link

HeikkiK commented May 2, 2020

I Have also tried to set app into background and change location on emulator and after that app Back to foreground. But there is only one location on Result when I get location updates. How often plugin should get location when on background?
Tested with android. Also with real phone. Locationupdates function seems to work when app is in foreground

@RomanJos
Copy link
Author

RomanJos commented May 2, 2020

I now use this https://pub.dev/packages/background_locator

@HeikkiK
Copy link

HeikkiK commented May 2, 2020

ok thanks, I will check that plugin.

@logic-emotion
Copy link

background: true does not work unfortunately. (I have the background capability switched on in Xcode).

@ghost
Copy link

ghost commented Jun 16, 2020

For background processing on IOS, it works when adding:
locationManager.allowsBackgroundLocationUpdates = true

in:
geolocation/ios/Classes/Location/LocationClient.swift

class LocationClient : NSObject, CLLocationManagerDelegate {
.......
.......
override init() {
    super.init()
    locationManager.delegate = self
    locationManager.allowsBackgroundLocationUpdates = true   // <---
  }

and adding in:
ios/Runner/Info.plist

<key>UIBackgroundModes</key>
	<array>
		<string>location</string>
	</array>

@cormalenv
Copy link

@jeanantoine So you are suggesting that the plugin has a bug and needs updating as well as documentation?

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

No branches or pull requests

4 participants