transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
629 stars 231 forks source link

how to hide persistent notification "Location service activated" in android system tray and battery consumption #81

Closed ADARSHAGNIHOTRI closed 5 years ago

ADARSHAGNIHOTRI commented 5 years ago

Your Environment

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at /Users/adarshagnihotri/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.3 • ANDROID_HOME = /Users/adarshagnihotri/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01) • All Android licenses accepted.

[✗] iOS toolchain - develop for iOS devices ✗ Xcode installation is incomplete; a full installation is necessary for iOS development. Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer ✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run: brew update brew install --HEAD usbmuxd brew link usbmuxd brew install --HEAD libimobiledevice brew install ideviceinstaller ✗ ios-deploy not installed. To install: brew install ios-deploy ✗ Brew can be used to install tools for iOS device development. Download brew at https://brew.sh/.

[✓] Android Studio (version 3.4) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 35.3.1 • Dart plugin version 183.6270 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] Connected device (1 available) • RMX1805 • 269e796b • android-arm64 • Android 8.1.0 (API 27)

! Doctor found issues in 1 category. Process finished with exit code 0 Plugin config:

PASTE_YOUR_CODE_HERE

Expected Behavior

"Location service Activated " popup should not occur and battery consumption is very high

Actual Behavior

should resolve above problem

Steps to Reproduce

bg.BackgroundGeolocation.start(); _isMoving = false; _enabled = false; _content = ''; _motionActivity = 'UNKNOWN'; _odometer = '0';

_clearNotifications();
bg.BackgroundGeolocation.onLocation(_onLocation);
bg.BackgroundGeolocation.onMotionChange(_onMotionChange);
bg.BackgroundGeolocation.onActivityChange(_onActivityChange);
bg.BackgroundGeolocation.onProviderChange(_onProviderChange);
bg.BackgroundGeolocation.onConnectivityChange(_onConnectivityChange);
//bg.BackgroundGeolocation.onNotificationAction(_onNotificationAction);
bg.BackgroundGeolocation.ready(bg.Config(

// debug: true, logLevel: bg.Config.LOG_LEVEL_VERBOSE, desiredAccuracy: bg.Config.DESIRED_ACCURACY_NAVIGATION, distanceFilter: 100, // locationUpdateInterval: 5000, stopOnTerminate: false, notificationPriority: 0, // preventSuspend: true, // useSignificantChangesOnly: true, startOnBoot: true, // heartbeatInterval: 2 )).then((bg.State state) { print('[ready] ${state.toMap()}'); setState(() { _enabled = state.enabled; _isMoving = state.isMoving; }); }).catchError((error) { print('[ready] ERROR: $error'); });

bg.BackgroundGeolocation.getCurrentPosition( ).then((bg.Location location) { widget.store.dispatch(new UpdateCurrentLocationAction(loc)); //updateLocation(location.coords.latitude, location.coords.longitude); }).catchError((error) { print('[getCurrentPosition] ERROR: $error'); });

Context

Debug logs- Android logs

I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 3 I/TSLocationManager(10565): ╠═════════════════════════════════════════════ I/TSLocationManager(10565): ╟─ 📍 Location[fused 28.536211,77.280921 acc=23 et=+3d5h17m25s544ms alt=164.8000030517578 {Bundle[mParcelledData.dataSize=52]}], age: 49ms, time: 1560857711821 I/TSLocationManager(10565): [c.t.l.l.TSLocationManager onSingleLocationResult] I/TSLocationManager(10565): 🔵 Acquired current position D/TSLocationManager(10565): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 22.988 I/TSLocationManager(10565): [c.t.l.data.sqlite.b persist] I/TSLocationManager(10565): ✅ INSERT: 08cc200e-1403-46aa-a29d-2256b3bac53c I/flutter (10565): [location] - [Location {is_moving: false, extras: {}, uuid: 08cc200e-1403-46aa-a29d-2256b3bac53c, odometer: 0.0, activity: {confidence: 100, type: still}, timestamp: 2019-06-18T11:35:11.821Z, battery: {is_charging: true, level: 0.53}, coords: {altitude: 164.8, heading: -1.0, latitude: 28.5362105, speed: -1.0, longitude: 77.2809213, accuracy: 23.0}}] I/flutter (10565): amitsir I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): adarshaaaaaa I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} D/TSLocationManager(10565): [c.t.locationmanager.util.b a] D/TSLocationManager(10565): ℹ️ LocationAuthorization: Permission granted I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 4 I/TSLocationManager(10565): ╠═════════════════════════════════════════════ I/TSLocationManager(10565): ╟─ 📍 Location[fused 28.536211,77.280921 acc=23 et=+3d5h17m26s5ms alt=164.8000030517578 {Bundle[mParcelledData.dataSize=52]}], age: 34ms, time: 1560857712282 I/TSLocationManager(10565): [c.t.l.l.TSLocationManager onSingleLocationResult] I/TSLocationManager(10565): 🔵 Acquired current position D/TSLocationManager(10565): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 22.988 I/TSLocationManager(10565): [c.t.l.data.sqlite.b persist] I/TSLocationManager(10565): ✅ INSERT: 4d9f77c9-9428-46be-847a-a9010e370935 I/flutter (10565): [location] - [Location {is_moving: false, extras: {}, uuid: 4d9f77c9-9428-46be-847a-a9010e370935, odometer: 0.0, activity: {confidence: 100, type: still}, timestamp: 2019-06-18T11:35:12.282Z, battery: {is_charging: true, level: 0.53}, coords: {altitude: 164.8, heading: -1.0, latitude: 28.5362105, speed: -1.0, longitude: 77.2809213, accuracy: 23.0}}] I/flutter (10565): amitsir I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): adarshaaaaaa I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} D/TSLocationManager(10565): [c.t.locationmanager.util.b a] D/TSLocationManager(10565): ℹ️ LocationAuthorization: Permission granted I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 5 I/TSLocationManager(10565): ╠═════════════════════════════════════════════ I/TSLocationManager(10565): ╟─ 📍 Location[fused 28.536211,77.280921 acc=23 et=+3d5h17m26s301ms alt=164.8000030517578 {Bundle[mParcelledData.dataSize=52]}], age: 35ms, time: 1560857712578 I/TSLocationManager(10565): [c.t.l.l.TSLocationManager onSingleLocationResult] I/TSLocationManager(10565): 🔵 Acquired current position D/TSLocationManager(10565): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 22.988 I/art (10565): Do partial code cache collection, code=56KB, data=58KB I/TSLocationManager(10565): [c.t.l.data.sqlite.b persist] I/TSLocationManager(10565): ✅ INSERT: c39e2bfb-0504-4fee-a07b-97f74bb7fd37 I/art (10565): After code cache collection, code=50KB, data=55KB I/art (10565): Increasing code cache capacity to 256KB I/flutter (10565): [location] - [Location {is_moving: false, extras: {}, uuid: c39e2bfb-0504-4fee-a07b-97f74bb7fd37, odometer: 0.0, activity: {confidence: 100, type: still}, timestamp: 2019-06-18T11:35:12.578Z, battery: {is_charging: true, level: 0.53}, coords: {altitude: 164.8, heading: -1.0, latitude: 28.5362105, speed: -1.0, longitude: 77.2809213, accuracy: 23.0}}] I/flutter (10565): amitsir I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): adarshaaaaaa I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} D/TSLocationManager(10565): [c.t.locationmanager.util.b a] D/TSLocationManager(10565): ℹ️ LocationAuthorization: Permission granted I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 6 I/TSLocationManager(10565): ╠═════════════════════════════════════════════ I/TSLocationManager(10565): ╟─ 📍 Location[fused 28.536211,77.280921 acc=23 et=+3d5h17m26s639ms alt=164.8000030517578 {Bundle[mParcelledData.dataSize=52]}], age: 67ms, time: 1560857712916 I/TSLocationManager(10565): [c.t.l.l.TSLocationManager onSingleLocationResult] I/TSLocationManager(10565): 🔵 Acquired current position D/TSLocationManager(10565): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 22.988 I/TSLocationManager(10565): [c.t.l.data.sqlite.b persist] I/TSLocationManager(10565): ✅ INSERT: a2e373df-bacb-4283-a3f9-44026202e17b I/flutter (10565): [location] - [Location {is_moving: false, extras: {}, uuid: a2e373df-bacb-4283-a3f9-44026202e17b, odometer: 0.0, activity: {confidence: 100, type: still}, timestamp: 2019-06-18T11:35:12.916Z, battery: {is_charging: true, level: 0.53}, coords: {altitude: 164.8, heading: -1.0, latitude: 28.5362105, speed: -1.0, longitude: 77.2809213, accuracy: 23.0}}] I/flutter (10565): amitsir I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): adarshaaaaaa I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5362105,"lng":77.2809213},"etaUpdates":[]} D/TSLocationManager(10565): [c.t.locationmanager.util.b a] D/TSLocationManager(10565): ℹ️ LocationAuthorization: Permission granted I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 7 I/TSLocationManager(10565): ╠═════════════════════════════════════════════ I/TSLocationManager(10565): ╟─ 📍 Location[fused 28.536186,77.280935 acc=25 et=+3d5h17m26s886ms alt=164.8000030517578 {Bundle[mParcelledData.dataSize=52]}], age: 33ms, time: 1560857713163 I/TSLocationManager(10565): [c.t.l.l.TSLocationManager onSingleLocationResult] I/TSLocationManager(10565): 🔵 Acquired current position D/TSLocationManager(10565): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 22.988 I/TSLocationManager(10565): [c.t.l.data.sqlite.b persist] I/TSLocationManager(10565): ✅ INSERT: 6e5b99e3-9a09-410c-a5c8-fa416839b454 I/flutter (10565): [location] - [Location {is_moving: false, extras: {}, uuid: 6e5b99e3-9a09-410c-a5c8-fa416839b454, odometer: 0.0, activity: {confidence: 100, type: still}, timestamp: 2019-06-18T11:35:13.163Z, battery: {is_charging: true, level: 0.53}, coords: {altitude: 164.8, heading: -1.0, latitude: 28.5361856, speed: -1.0, longitude: 77.2809354, accuracy: 24.9}}] I/flutter (10565): amitsir I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): adarshaaaaaa I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5361856,"lng":77.2809354},"etaUpdates":[]} I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5361856,"lng":77.2809354},"etaUpdates":[]} D/TSLocationManager(10565): [c.t.locationmanager.util.b a] D/TSLocationManager(10565): ℹ️ LocationAuthorization: Permission granted I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 8 I/TSLocationManager(10565): ╠═════════════════════════════════════════════ I/TSLocationManager(10565): ╟─ 📍 Location[fused 28.536186,77.280935 acc=25 et=+3d5h17m27s219ms alt=164.8000030517578 {Bundle[mParcelledData.dataSize=52]}], age: 54ms, time: 1560857713496 I/TSLocationManager(10565): [c.t.l.l.TSLocationManager onSingleLocationResult] I/TSLocationManager(10565): 🔵 Acquired current position D/TSLocationManager(10565): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 22.988 I/TSLocationManager(10565): [c.t.l.data.sqlite.b persist] I/TSLocationManager(10565): ✅ INSERT: 7257ee50-d3f2-4c63-8eae-642f773a14b1 I/flutter (10565): [location] - [Location {is_moving: false, extras: {}, uuid: 7257ee50-d3f2-4c63-8eae-642f773a14b1, odometer: 0.0, activity: {confidence: 100, type: still}, timestamp: 2019-06-18T11:35:13.496Z, battery: {is_charging: true, level: 0.53}, coords: {altitude: 164.8, heading: -1.0, latitude: 28.5361856, speed: -1.0, longitude: 77.2809354, accuracy: 24.9}}] I/flutter (10565): amitsir I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): adarshaaaaaa D/TSLocationManager(10565): [c.t.locationmanager.util.b a] D/TSLocationManager(10565): ℹ️ LocationAuthorization: Permission granted I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5361856,"lng":77.2809354},"etaUpdates":[]} I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5361856,"lng":77.2809354},"etaUpdates":[]} I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 9 I/TSLocationManager(10565): ╠═════════════════════════════════════════════ I/TSLocationManager(10565): ╟─ 📍 Location[fused 28.536186,77.280935 acc=25 et=+3d5h17m27s460ms alt=164.8000030517578 {Bundle[mParcelledData.dataSize=52]}], age: 40ms, time: 1560857713737 I/TSLocationManager(10565): [c.t.l.l.TSLocationManager onSingleLocationResult] I/TSLocationManager(10565): 🔵 Acquired current position D/TSLocationManager(10565): [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 22.988 I/TSLocationManager(10565): [c.t.l.data.sqlite.b persist] I/TSLocationManager(10565): ✅ INSERT: 2f2e3f71-492a-4c74-b6f6-9f442f1aba1f I/flutter (10565): [location] - [Location {is_moving: false, extras: {}, uuid: 2f2e3f71-492a-4c74-b6f6-9f442f1aba1f, odometer: 0.0, activity: {confidence: 100, type: still}, timestamp: 2019-06-18T11:35:13.737Z, battery: {is_charging: true, level: 0.53}, coords: {altitude: 164.8, heading: -1.0, latitude: 28.5361856, speed: -1.0, longitude: 77.2809354, accuracy: 24.9}}] I/flutter (10565): amitsir I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): Token App: oDUjQnyrIKdc7wL01A8Y-33F8VaXAWF7vYqUUycChd-mOV9WUx-sugxvHSHoNuz5Ukg12HwgBL5M-ho0d0eOC6CT2ibPdE9mjfbipI5gwaWt7LOOg-2v8eTMi8keK4ziRbLCJb2peb0tw2aE2F59Nrb0BWFgTntscwgo-16suMO8LsTbevLnwQFe2dR9sKBCP6fOVKhJUx4mI4UESLrRfq6I84OYlufMUiST3jxr0CiXVyhzxQxgXRUogJ5XzE4-sWm2ojJlJh9KNw5Pp6potOFwREE0SM38-4OTIuDmflRNYRrE1-87KtAr0nMorfbJCoK5oa3dMH5nYdyfWkwzF284v7NMBiUctil0GjTcZSk7N8fRYFAkqlFudf6pMCK8OJpNtryA1Drqf5_Zza9h9huMXdEHQywdek-MJ0F1zWhak5xvEQumG2Y-B3XQ4tIhQuDpMLMbtSGzmmoIAP2AZDuUfuv4QGFrwwdGpLMenCqMvOKF1xgvBLGtk5VkejYC2AC1go6ElaGDjgMMMXHJSFqUKWxaxO-NmBJCvsjbI7Q I/flutter (10565): adarshaaaaaa I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5361856,"lng":77.2809354},"etaUpdates":[]} D/TSLocationManager(10565): [c.t.locationmanager.util.b a] D/TSLocationManager(10565): ℹ️ LocationAuthorization: Permission granted I/flutter (10565): doRequest: method = post, url = http://api.tefillinwrapp.com/api/Request/UpdateLocation, body = {"location":{"lat":28.5361856,"lng":77.2809354},"etaUpdates":[]} I/TSLocationManager(10565): [c.t.l.s.LocationRequestService b] I/TSLocationManager(10565): ℹ️ Location availability: true I/TSLocationManager(10565): [c.t.l.s.LocationRequestService a] I/TSLocationManager(10565): ╔═════════════════════════════════════════════ I/TSLocationManager(10565): ║ getCurrentPosition LocationResult: 10 I/TSLocationManager(10565): ╠═════════════════════════════════════════════

PASTE_YOUR_LOGS_HERE

christocracy commented 5 years ago

The persistent notification is required by Android foreground services. Foreground services are what make constant background tracking possible.

The only way to hide it is configure useSignificantChangesOnly: true; however, you will receive only a few locations / hour.

Pranit1804 commented 1 year ago

How to remove the notification after the background geolocation is stopped?

christocracy commented 1 year ago

How to remove the notification after the background geolocation is stopped?

by calling .stop()

ralon99 commented 2 months ago

The persistent notification is required by Android foreground services. Foreground services are what make constant background tracking possible.

The only way to hide it is configure useSignificantChangesOnly: true; however, you will receive only a few locations / hour.

will it hurt the geofence functioning? meaning, might i miss the 'enter' event for example?

christocracy commented 2 months ago

geofences are managed by the OS independently of the location API.

ralon99 commented 2 months ago

geofences are managed by the OS independently of the location API.

Thanks for the answer. I have a 2 follow up questions if i may: First, If i only interested in geofences, is there a way to shut the other location services entirely? I only check location once on app init so i thought of doing something like: Background.start() getCurrentLocation() Background.stop() Background.startGeofences() Is there any more efficient way? Second question, do i still need all the permissions same as Location services? Im not sure what you mean by 'managed independently by the os'

christocracy commented 2 months ago

Background.start()

You do not need to call .start() just to call .getCurrentPosition()

do i still need all the permissions

Geofencing requires “Always” location authorization.

Im not sure what you mean by 'managed independently by the os'

Geofences are monitored by the OS. The plug-in only tells the OS the geofences you wish to monitor — the plug-in does not actively monitor geofences and determine when they fire.

ralon99 commented 2 months ago

Ah ok, this is exactly what im doing, i never call the start(). But the persistent message still appears. I thought i could get rid of it completely

christocracy commented 2 months ago

It will appear then disappear after a few seconds, after the event is serviced. Whenever a location is requested or a geofence event occurs, a foreground-service is launched. Android foreground-services require a notification.