-
Notifications
You must be signed in to change notification settings - Fork 261
Open
Description
Required Reading
- Confirmed
Plugin Version
4.16.12
Mobile operating-system(s)
- iOS
- Android
Device Manufacturer(s) and Model(s)
Xiaimi 11T
Device operating-systems(s)
Xiaomi HyperOS 1.0.9.0 (Android 14)
What do you require assistance about?
BG started successfully, the notification was shown, but no location events were triggered, even when the app was being opened.
I had request location always, turn off battery optimization (no restriction).
(bellow log was recorded when simulating gps, but in the real situation, the result was the same)
[Optional] Plugin Code and/or Config
bg.Config(
reset: true,
/// Logging & Debug
debug: false,
logLevel: bg.Config.LOG_LEVEL_VERBOSE,
logMaxDays: 1,
/// Geolocation options
desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
backgroundPermissionRationale: bg.PermissionRationale(
title: S.current.request_location_title('{applicationName}'),
message:
S.current.request_location_message('{backgroundPermissionOptionLabel}'),
positiveAction: S.current
.request_location_positive('{backgroundPermissionOptionLabel}'),
negativeAction: S.current.cancel,
),
disableLocationAuthorizationAlert: true,
locationAuthorizationAlert: {
'titleWhenNotEnabled': S.current.location_services_are_not_enable,
'titleWhenOff': S.current.background_location_is_off,
'instructions': S.current.background_location_instructions,
'cancelButton': S.current.cancel,
'settingsButton': S.current.setting,
},
/// HTTP & Persistence
persistMode: bg.Config.PERSIST_MODE_LOCATION,
autoSync: true,
batchSync: true,
stopTimeout: 5,
autoSyncThreshold: 5,
distanceFilter: 100,
maxBatchSize: 50,
maxRecordsToPersist: 200,
maxDaysToPersist: 2,
httpTimeout: 20000,
url: '${AppConfig.baseUrl}/sync-locations',
headers: {
'Content-Type': 'application/json',
'Accept-Language': 'vi',
'Authorization':
'Bearer ${Injector.instance<AuthService>().jwtToken?.accessToken}',
},
method: 'POST',
httpRootProperty: '.',
locationTemplate: '{"lat":<%= latitude %>, '
'"lng":<%= longitude %>, '
'"batteryLevel":<%= battery.level %>, '
'"isMock":<%= mock %>, '
'"updateTime":"<%= timestamp %>"}',
extras: {
'userId': userId,
},
/// Application options
stopOnTerminate: false,
startOnBoot: true,
foregroundService: true,
notification: bg.Notification(
title: 'Location',
text: 'Location tracking',
priority: bg.Config.NOTIFICATION_PRIORITY_HIGH,
sticky: true,
channelName: 'My Location',
channelId: 'com.me.app.TSLocationManager',
smallIcon: 'drawable/ic_notification',
),
)
[Optional] Relevant log output
08-21 13:40:56.832 22844 21757 D TSLocationManager: [c.t.l.logger.LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/location
08-21 13:40:56.833 22844 21781 D TSLocationManager: [c.t.l.l.TSSQLiteAppender$c run]
08-21 13:40:56.833 22844 21781 D TSLocationManager: ℹ️ Cleared logs older than 72 hours
08-21 13:40:56.835 22844 21757 D TSLocationManager: [c.t.l.logger.LoggerFacade$a a] com.transistorsoft/flutter_background_geolocation/events/motionchange
08-21 13:41:35.646 22844 22844 D TSLocationManager: [c.t.l.s.ForegroundNotification createNotificationChannel] NotificationChannel{mId='com.me.app.TSLocationManager', mName=My Location, mDescription=, mImportance=1, mBypassDnd=false, mLockscreenVisibility=-1, mSound=null, mLights=false, mLightColor=0, mVibration=null, mUserLockedFields=0, mUserVisibleTaskShown=false, mVibrationEnabled=false, mShowBadge=false, mDeleted=false, mDeletedTimeMs=-1, mGroup='null', mAudioAttributes=null, mBlockableSystem=false, mAllowBubbles=-1, mImportanceLockedDefaultApp=false, mOriginalImp=-1000, mParent=null, mConversationId=null, mDemoted=false, mImportantConvo=false}
08-21 13:41:35.651 22844 22844 D TSLocationManager: [c.t.l.adapter.TSConfig e] ℹ️ Persist config, dirty: [autoSyncThreshold, backgroundPermissionRationale, backgroundPermissionRationale.title, backgroundPermissionRationale.message, backgroundPermissionRationale.positiveAction, backgroundPermissionRationale.negativeAction, batchSync, desiredAccuracy, disableLocationAuthorizationAlert, distanceFilter, extras, headers, httpRootProperty, httpTimeout, locationTemplate, logLevel, logMaxDays, maxBatchSize, maxDaysToPersist, maxRecordsToPersist, notification, notification.title, notification.text, notification.smallIcon, notification.priority, notification.sticky, notification.channelName, notification.channelId, persistMode, startOnBoot, stopOnTerminate, url]
08-21 13:41:35.654 22844 21764 I TSLocationManager: [c.t.l.http.HttpService flush]
08-21 13:41:35.654 22844 21764 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:35.654 22844 21764 I TSLocationManager: ║ HTTP Service (count: 0)
08-21 13:41:35.654 22844 21764 I TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:35.687 22844 22844 D TSLocationManager: [c.t.l.adapter.TSConfig e] ℹ️ Persist config, dirty: [autoSyncThreshold, extras]
08-21 13:41:35.691 22844 21764 I TSLocationManager: [c.t.l.http.HttpService flush]
08-21 13:41:35.691 22844 21764 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:35.691 22844 21764 I TSLocationManager: ║ HTTP Service (count: 0)
08-21 13:41:35.691 22844 21764 I TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:35.706 22844 22844 D TSLocationManager: [c.t.l.adapter.TSConfig e] ℹ️ Persist config, dirty: [extras]
08-21 13:41:35.710 22844 21764 I TSLocationManager: [c.t.l.http.HttpService flush]
08-21 13:41:35.710 22844 21764 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:35.710 22844 21764 I TSLocationManager: ║ HTTP Service (count: 0)
08-21 13:41:35.710 22844 21764 I TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:35.712 22844 22844 I TSLocationManager: [c.t.l.u.LocationAuthorization withBackgroundPermission]
08-21 13:41:35.712 22844 22844 I TSLocationManager: 🔵 LocationAuthorization: Requesting Background permission
08-21 13:41:36.481 22844 22844 D TSLocationManager: [c.t.l.l.LifecycleManager onPause] ☯️ onPause
08-21 13:41:37.133 22844 22844 I TSLocationManager: [c.t.l.u.LocationAuthorization$j onPermissionGranted]
08-21 13:41:37.133 22844 22844 I TSLocationManager: ✅ LocationAuthorization: Permission granted
08-21 13:41:37.134 22844 21764 I TSLocationManager: - Enable: false → true, trackingMode: 1
08-21 13:41:37.135 22844 21764 I TSLocationManager: [c.t.l.g.TSGeofenceManager start]
08-21 13:41:37.135 22844 21764 I TSLocationManager: 🎾 Start monitoring geofences
08-21 13:41:37.136 22844 21764 D TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges]
08-21 13:41:37.136 22844 21764 D TSLocationManager: 🎾 Start monitoring connectivity changes
08-21 13:41:37.147 22844 21764 D TSLocationManager: [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
08-21 13:41:37.147 22844 21764 D TSLocationManager: 🎾 Start monitoring powersave changes
08-21 13:41:37.150 22844 21764 I TSLocationManager: [c.t.l.s.ActivityRecognitionService start]
08-21 13:41:37.150 22844 21764 I TSLocationManager: 🎾 Start motion-activity updates
08-21 13:41:37.152 22844 21866 D TSLocationManager: [c.t.l.http.HttpService a]
08-21 13:41:37.152 22844 21866 D TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:37.152 22844 21866 D TSLocationManager: ║ 📶 Connectivity change: connected? true
08-21 13:41:37.152 22844 21866 D TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:37.153 22844 22844 D TSLocationManager: [c.t.l.l.LifecycleManager onResume] ☯️ onResume
08-21 13:41:37.155 22844 21764 I TSLocationManager: [c.t.l.service.HeartbeatService stop]
08-21 13:41:37.155 22844 21764 I TSLocationManager: 🔴 Stop heartbeat
08-21 13:41:37.156 22844 21757 I TSLocationManager: [c.t.l.http.HttpService flush]
08-21 13:41:37.156 22844 21757 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:37.156 22844 21757 I TSLocationManager: ║ HTTP Service (count: 0)
08-21 13:41:37.156 22844 21757 I TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:37.158 22844 21764 I TSLocationManager: [c.t.l.service.TrackingService changePace]
08-21 13:41:37.158 22844 21764 I TSLocationManager: 🔵 setPace: false → false
08-21 13:41:37.171 22844 22844 I TSLocationManager: [c.t.l.l.TSLocationManager a]
08-21 13:41:37.171 22844 22844 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:37.171 22844 22844 I TSLocationManager: ║ motionchange LocationResult: 1 (163ms old)
08-21 13:41:37.171 22844 22844 I TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:37.171 22844 22844 I TSLocationManager: ╟─ 📍 Location[network 21.031223,105.800076 hAcc=20.0 et=+212d10h45m39s770ms alt=0.0 vel=8.333334 bear=136.33058 mock {Bundle[{battery_level=1.0, is_charging=true, odometer=0.0}]}], time: 1755758497007
08-21 13:41:37.172 22844 22844 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult]
08-21 13:41:37.172 22844 22844 I TSLocationManager: 🔵 Acquired motionchange position, isMoving: false
08-21 13:41:37.172 22844 22844 D TSLocationManager: [c.t.l.l.TSLocationManager a] Median accuracy: 20.0
08-21 13:41:37.194 22844 21764 I TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO persist]
08-21 13:41:37.194 22844 21764 I TSLocationManager: ✅ INSERT: ad4b6225-266f-4914-b35d-0d86e9cf4441
08-21 13:41:37.196 22844 21764 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO shrink]
08-21 13:41:37.196 22844 21764 D TSLocationManager: ℹ️ SHRINK: 200
08-21 13:41:37.197 22844 21764 I TSLocationManager: [c.t.l.http.HttpService flush]
08-21 13:41:37.197 22844 21764 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:37.197 22844 21764 I TSLocationManager: ║ HTTP Service (count: 1)
08-21 13:41:37.197 22844 21764 I TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:37.211 22844 22844 D TSLocationManager: [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion]
08-21 13:41:37.211 22844 22844 D TSLocationManager: 🎾 Start monitoring stationary region (radius: 150.0m 21.03122337035558,105.80007597656719 hAcc=20.0)
08-21 13:41:37.228 22844 22844 D TSLocationManager: [c.t.l.service.AbstractService a]
08-21 13:41:37.228 22844 22844 D TSLocationManager: 🎾 motionchange [TrackingService startId: 1, eventCount: 1]
08-21 13:41:37.228 22844 22844 I TSLocationManager: [c.t.l.service.TrackingService k]
08-21 13:41:37.228 22844 22844 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:37.228 22844 22844 I TSLocationManager: ║ TrackingService motionchange: false
08-21 13:41:37.228 22844 22844 I TSLocationManager: ╠═════════════════════════════════════════════
08-21 13:41:37.233 22844 22844 D TSLocationManager: [c.t.l.service.AbstractService a]
08-21 13:41:37.233 22844 22844 D TSLocationManager: ⚙️︎ FINISH [TrackingService startId: 1, eventCount: 0, sticky: true]
08-21 13:41:37.240 22844 22844 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 1
08-21 13:41:37.242 22844 21764 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO allWithLocking]
08-21 13:41:37.242 22844 21764 D TSLocationManager: ✅ Locked 1 records
08-21 13:41:37.242 22844 21764 I TSLocationManager: [c.t.l.http.HttpService a]
08-21 13:41:37.242 22844 21764 I TSLocationManager: 🔵 HTTP POST batch (1)
08-21 13:41:37.242 22844 21764 W TSLocationManager: [c.t.l.http.HttpService a] Appending #params to an HTTP Request of type {Array} is not yet supported. Specify an #httpRootProperty and send an {Object} request
08-21 13:41:37.259 22844 22844 D TSLocationManager: [c.t.l.service.AbstractService a]
08-21 13:41:37.259 22844 22844 D TSLocationManager: 🎾 start [ActivityRecognitionService startId: 1, eventCount: 1]
08-21 13:41:37.261 22844 21764 D TSLocationManager: [c.t.l.s.ActivityRecognitionService a]
08-21 13:41:37.261 22844 21764 D TSLocationManager: 🚘 ️DetectedActivity [type=STILL, confidence=100]
08-21 13:41:37.262 22844 21764 D TSLocationManager: [c.t.l.service.AbstractService a]
08-21 13:41:37.262 22844 21764 D TSLocationManager: ⚙️︎ FINISH [ActivityRecognitionService startId: 1, eventCount: 0, sticky: false]
08-21 13:41:37.316 22844 22195 I TSLocationManager: [c.t.l.http.HttpService$f onResponse]
08-21 13:41:37.316 22844 22195 I TSLocationManager: 🔵 Response: 200
08-21 13:41:37.316 22844 22195 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO destroyAll]
08-21 13:41:37.316 22844 22195 D TSLocationManager: ✅ DELETED: (1)
08-21 13:41:37.318 22844 22195 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO allWithLocking]
08-21 13:41:37.318 22844 22195 D TSLocationManager: ✅ Locked 0 records
08-21 13:41:37.318 22844 22195 I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 1
08-21 13:41:37.466 22844 22844 D TSLocationManager: [c.t.l.service.AbstractService f]
08-21 13:41:37.466 22844 22844 D TSLocationManager: ⚙️︎ ActivityRecognitionService.stopSelfResult(1): true
08-21 13:41:37.466 22844 22844 D TSLocationManager: [c.t.l.service.AbstractService onDestroy]
08-21 13:41:37.466 22844 22844 D TSLocationManager: 🔴 ActivityRecognitionService stopped
08-21 13:41:38.153 22844 21764 I TSLocationManager: [c.t.l.http.HttpService flush]
08-21 13:41:38.153 22844 21764 I TSLocationManager: ╔═════════════════════════════════════════════
08-21 13:41:38.153 22844 21764 I TSLocationManager: ║ HTTP Service (count: 0)
08-21 13:41:38.153 22844 21764 I TSLocationManager: ╠═════════════════════════════════════════════
Metadata
Metadata
Assignees
Labels
No labels