geolocation
geolocation copied to clipboard
background: true Has no effect
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
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
I now use this https://pub.dev/packages/background_locator
ok thanks, I will check that plugin.
background: true does not work unfortunately. (I have the background capability switched on in Xcode).
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>
@jeanantoine So you are suggesting that the plugin has a bug and needs updating as well as documentation?