Open mhassanist opened 4 years ago
+1
I guess it wont work, because its not requesting for background location permission and its not even using any background service codes specific to platform. it works in background according to flutter, but will stop updates as soon as the app is closed.
Tried on iphone 11, latest iOS, no background updates!
It doesn't work with
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
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>
"Flutter plugin for location / geolocation / GPS. Supports iOS and Android. Multiple settings for speed, precision, battery optimization, continuous updates in background "
In background here means we can keep updates even the app is not in foreground (closed may be by the system or when click back).