geolocation icon indicating copy to clipboard operation
geolocation copied to clipboard

Does it work if the app is closed ?

Open mhassanist opened this issue 5 years ago • 5 comments

"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).

mhassanist avatar Feb 18 '20 10:02 mhassanist

+1

angel-r avatar Feb 19 '20 22:02 angel-r

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.

GadepalliAditya1998 avatar Feb 24 '20 08:02 GadepalliAditya1998

Tried on iphone 11, latest iOS, no background updates!

radvansky-tomas avatar Mar 06 '20 03:03 radvansky-tomas

It doesn't work with

<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

RomanJos avatar Mar 19 '20 15:03 RomanJos

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>

ghost avatar Jun 16 '20 17:06 ghost