-
Notifications
You must be signed in to change notification settings - Fork 272
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Required Reading
- Confirmed
Plugin Version
v5.0.0-beta2
Flutter Doctor
[✓] Flutter (Channel stable, 3.32.0, on macOS 15.6.1 24G90 darwin-arm64, locale ko-KR)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 16.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)Mobile operating-system(s)
- iOS
- Android
Device Manufacturer(s) and Model(s)
galaxy s22
Device operating-systems(s)
android 15.0
What happened?
Android has a background notification issue.
The notification text and title are different even if you set the notification option as below.
notification: bg.Notification(
channelName: "Moi Pod",
title: '',
text: "The Moni app collects location data in the background to help check your family members’locations.",
),
Could you check my bg.BackgroundGeolocation.ready(bg.Config( code and logs?
Plugin Code and/or Config
bg.BackgroundGeolocation.onLocation(_onLocationCallback);
// 2️⃣ heartbeatInterval(1분 주기)마다 호출 (움직임이 없어도)
bg.BackgroundGeolocation.onHeartbeat(_onHeartbeatCallback);
if (geofence == true) bg.BackgroundGeolocation.onGeofence(_onGeofenceCallback);
bg.BackgroundGeolocation.onHttp(_onHttp);
final prefs = await SharedPreferences.getInstance();
final serverUrl = prefs.getString('STR_SERVER_URL');
// FlutterSecureStorage에서 인증 정보 가져오기
final secureStorage = Platform.isAndroid
? const FlutterSecureStorage(aOptions: AndroidOptions(encryptedSharedPreferences: true))
: const FlutterSecureStorage();
final rememberMeJson = await secureStorage.read(key: 'REMEMBER_ME');
String? token;
String? peopleId;
String? deviceId;
if (rememberMeJson != null) {
final rememberMe = jsonDecode(rememberMeJson);
token = rememberMe['credential'] as String?;
peopleId = rememberMe['peopleId'] as String?;
deviceId = rememberMe['deviceId'] as String?;
}
await printlog("📥 [startService] Loading authentication info from Storage");
await printlog(" - Server: $serverUrl");
await printlog(" - Token: ${token != null && token.isNotEmpty ? 'exists' : 'none'}");
await printlog(" - PeopleId: $peopleId");
await printlog(" - DeviceId: $deviceId");
if (serverUrl == null ||
serverUrl.isEmpty ||
token == null ||
token.isEmpty ||
peopleId == null ||
peopleId.isEmpty ||
deviceId == null ||
deviceId.isEmpty) {
await printlog("🚨 [startService] No authentication info");
return;
}
String uri = 'https://$serverUrl/mobile/gis/device/geo-location';
final headers = {
"Device": deviceId,
"Role": peopleId,
};
await bg.BackgroundGeolocation.ready(bg.Config(
reset:false,
locationAuthorizationRequest: 'Always',
desiredAccuracy: bg.Config.DESIRED_ACCURACY_NAVIGATION,
distanceFilter: defaultDistanceFilter,
stationaryRadius: defaultDistanceFilter,
/// ios only
geofenceInitialTriggerEntry: true,
activityType: Platform.isIOS ? bg.Config.ACTIVITY_TYPE_FITNESS : null,
stopOnTerminate: false,
startOnBoot: true,
preventSuspend: Platform.isIOS ? true : null,
heartbeatInterval: defaultHeartbeatInterval,
enableHeadless: Platform.isAndroid ? true : null,
/// android only
notification: bg.Notification(
channelName: "Moi Pod",
title: '',
text: "The Moni app collects location data in the background to help check your family members’locations.",
),
backgroundPermissionRationale: bg.PermissionRationale(
title: "",
message: "The Moni app collects location data in the background to help check your family members’locations.",
positiveAction: 'Change to "{backgroundPermissionOptionLabel}"',
negativeAction: 'Cancel'
),
url: uri,
autoSync: true,
headers: headers,
logLevel: bg.Config.LOG_LEVEL_VERBOSE,
debug: kDebugMode ? true : false,
authorization: bg.Authorization(
strategy: 'JWT', // 'Bearer' 접두사를 자동으로 추가합니다.
accessToken: token, // 순수한 토큰 값만 전달
),
)).then((bg.State state) async {
await printlog('[ready] ${state.toMap()}');
await printlog('[didDeviceReboot] ${state.didDeviceReboot}');
if (geofence == true && _placeLocaiton != null && _placeId != null) {
addGeofence(_placeId!.toString(), _placeLocaiton!.latitude, _placeLocaiton!.longitude, defaultRadiusMeters);
//String poi, double lat, double lng, double radius
}
bg.BackgroundGeolocation.start();Relevant log output
025-12-09 13:54:37.626 20431-20431 TSLocationManager pid-20431 D [c.t.l.l.LocationAuthorization withBackgroundPermission]
ℹ️ LocationAuthorization: Permission granted
2025-12-09 13:54:37.627 20431-23029 TSLocationManager pid-20431 I - Enable: false → true, trackingMode: 1
2025-12-09 13:54:37.627 20431-20431 TSLocationManager pid-20431 W [c.t.l.g.TSGeofence$Builder build]
⚠️ Geofence radius: 50.0: recommended geofence radius is >= 150.0meters
2025-12-09 13:54:37.629 20431-23029 TSLocationManager pid-20431 I [c.t.l.g.TSGeofenceManager start]
🎾 Start monitoring geofences
2025-12-09 13:54:37.629 20431-23029 TSLocationManager pid-20431 D [c.t.l.g.TSGeofenceManager d] ℹ️ Persist monitored geofences: []
2025-12-09 13:54:37.629 20431-23029 TSLocationManager pid-20431 D [c.t.l.g.TSGeofenceManager e] ℹ️ Persist monitored polygons: {}
2025-12-09 13:54:37.630 20431-22688 TSLocationManager pid-20431 I [c.t.locationmanager.a.f a]
✅ 71925
2025-12-09 13:54:37.631 20431-23029 TSLocationManager pid-20431 D [c.t.l.http.HttpService startMonitoringConnectivityChanges]
🎾 Start monitoring connectivity changes
2025-12-09 13:54:37.632 20431-23029 TSLocationManager pid-20431 D [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
🎾 Start monitoring powersave changes
2025-12-09 13:54:37.633 20431-23029 TSLocationManager pid-20431 I [c.t.l.s.ActivityRecognitionService d]
🎾 Start motion-activity updates
2025-12-09 13:54:37.635 20431-23029 TSLocationManager pid-20431 I [c.t.locationmanager.a.g b]
🎾 Start heartbeat (600.0s)
2025-12-09 13:54:37.636 20431-20512 TSLocationManager pid-20431 D [c.t.l.http.HttpService a]
╔═════════════════════════════════════════════
║ 📶 Connectivity change: connected? true
╠═════════════════════════════════════════════
2025-12-09 13:54:37.637 20431-23029 TSLocationManager pid-20431 I [c.t.l.s.TSScheduleManager oneShot]
⏰ Scheduled OneShot: HEARTBEAT in 600000ms (jobID: -1307475748)
2025-12-09 13:54:37.641 20431-23029 TSLocationManager pid-20431 I [c.t.l.service.TrackingService a]
🔵 setPace: false → false
2025-12-09 13:54:37.648 20431-20431 TSLocationManager pid-20431 I [c.t.l.l.TSLocationManager a]
╔═════════════════════════════════════════════
║ motionchange LocationResult: 6 (44596ms old)
╠═════════════════════════════════════════════
╟─ 📍 Location[fused 37.378499,127.112731 hAcc=100.0 et=+2h52m55s94ms alt=91.5 vAcc=100.0], time: 1765256033051
2025-12-09 13:54:37.648 20431-20431 TSLocationManager pid-20431 I [c.t.l.l.TSLocationManager onSingleLocationResult]
🔵 MOTIONCHANGE isMoving=false df=25.0 — resetting short-term filter state
2025-12-09 13:54:37.649 20431-20431 TSLocationManager pid-20431 I [c.t.l.l.TSLocationManager onSingleLocationResult]
🔵 Acquired motionchange position, isMoving: false
2025-12-09 13:54:37.650 20431-23029 TSLocationManager pid-20431 W [c.t.l.g.TSGeofence$Builder build]
⚠️ Geofence radius: 50.0: recommended geofence radius is >= 150.0meters
2025-12-09 13:54:37.675 20431-23029 TSLocationManager pid-20431 I [c.t.locationmanager.a.t a]
✅ 💾 INSERT: fe6dba45-1d85-4712-9f97-a7ec564a7f48
2025-12-09 13:54:37.680 20431-20431 TSLocationManager pid-20431 D [c.t.l.g.TSGeofenceManager$d a] ℹ️ GeofencingClient addGeofences SUCCESS
2025-12-09 13:54:37.680 20431-20431 TSLocationManager pid-20431 D [c.t.l.g.TSGeofenceManager d] ℹ️ Persist monitored geofences: [71925]
2025-12-09 13:54:37.680 20431-20431 TSLocationManager pid-20431 D [c.t.l.g.TSGeofenceManager$d a]
╔═════════════════════════════════════════════
║ TSGeofenceManager monitoring 1/1
╠═════════════════════════════════════════════
╟─ 🎾 71925
╚═════════════════════════════════════════════
2025-12-09 13:54:37.686 20431-20431 TSLocationManager pid-20431 D [c.t.l.g.TSGeofenceManager startMonitoringStationaryRegion]
🎾 Start monitoring stationary region (radius: 150.0m 37.3784986,127.1127312 hAcc=100.0)
2025-12-09 13:54:37.687 20431-23029 TSLocationManager pid-20431 I [c.t.l.http.HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
2025-12-09 13:54:37.735 20431-20431 TSLocationManager pid-20431 D [c.t.l.service.AbstractService a]
🎾 motionchange [TrackingService startId: 1, eventCount: 1]
2025-12-09 13:54:37.735 20431-20431 TSLocationManager pid-20431 I [c.t.l.service.TrackingService l]
╔═════════════════════════════════════════════
║ TrackingService motionchange: false
╠═════════════════════════════════════════════
..
2025-12-09 13:54:37.969 20431-20431 TSLocationManager pid-20431 D [c.t.l.service.AbstractService f]
⚙️︎ ActivityRecognitionService.stopSelfResult(1): true
2025-12-09 13:54:37.971 20431-20431 TSLocationManager pid-20431 D [c.t.l.service.AbstractService onDestroy]
🔴 ActivityRecognitionService stopped
2025-12-09 13:54:38.642 20431-23029 TSLocationManager pid-20431 I [c.t.l.http.HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service (count: 1)
╠═════════════════════════════════════════════
2025-12-09 13:54:38.671 20431-20431 TSLocationManager pid-20431 I [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 8
2025-12-09 13:54:38.674 20431-23029 TSLocationManager pid-20431 D [c.t.locationmanager.a.t first]
✅ Locked 1 records
2025-12-09 13:54:38.674 20431-23029 TSLocationManager pid-20431 I [c.t.l.http.HttpService a]
🔵 HTTP POST: fe6dba45-1d85-4712-9f97-a7ec564a7f48
2025-12-09 13:54:38.719 20431-22699 TSLocationManager pid-20431 W [c.t.l.http.HttpService$e onResponse]
⚠️ Response: 500,
2025-12-09 13:54:38.725 20431-22699 TSLocationManager pid-20431 D [c.t.locationmanager.a.t b]
✅ UNLOCKED: fe6dba45-1d85-4712-9f97-a7ec564a7f48
2025-12-09 13:54:38.726 20431-22699 TSLocationManager pid-20431 I [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 8
2025-12-09 13:55:08.681 20431-20431 TSLocationManager pid-20431 I [c.t.l.s.TSScheduleManager oneShot]
⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
2025-12-09 13:55:09.379 20431-20431 TSLocationManager pid-20431 D [c.t.l.l.LifecycleManager onPause] ☯️ onPause
2025-12-09 13:55:09.382 20431-20431 TSLocationManager pid-20431 D [c.t.l.l.LifecycleManager onStop] ☯️ onStop
2025-12-09 13:55:19.734 24330-24360 nativeloader com.humaxnetworks.monipod D Load /data/app/~~TKUrFsLCXofM-MJGb2h2Qw==/com.humaxnetworks.monipod-vFGEMawGFoqja3vsrFJ33Q==/base.apk!/lib/arm64-v8a/libtslocationmanager.so using class loader ns clns-7 (caller=/data/app/~~TKUrFsLCXofM-MJGb2h2Qw==/com.humaxnetworks.monipod-vFGEMawGFoqja3vsrFJ33Q==/base.apk!classes9.dex): ok
2025-12-09 13:55:20.274 24330-24330 TSLocationManager com.humaxnetworks.monipod D 💀 [HeadlessTask terminate]
2025-12-09 13:55:20.439 24330-24368 TSLocationManager com.humaxnetworks.monipod I [c.t.l.logger.LoggerFacade$a a]
╔═════════════════════════════════════════════
║ ⏰ OneShot event fired: TERMINATE_EVENT
╠═════════════════════════════════════════════
2025-12-09 13:55:20.441 24330-24368 TSLocationManager com.humaxnetworks.monipod D [c.t.l.logger.LoggerFacade$a a] ☯️ onCreate
2025-12-09 13:55:20.442 24330-24368 TSLocationManager com.humaxnetworks.monipod I [c.t.l.logger.LoggerFacade$a a]
✅ Google Play Services: connected (version code:12451000)
2025-12-09 13:55:20.443 24330-24368 TSLocationManager com.humaxnetworks.monipod D [c.t.l.logger.LoggerFacade$a a]
╔═════════════════════════════════════════════
║ ☯️ HeadlessMode? true
╠═════════════════════════════════════════════
2025-12-09 13:55:20.445 24330-24368 TSLocationManager com.humaxnetworks.monipod I [c.t.l.logger.LoggerFacade$a a]
╔═════════════════════════════════════════════
║ TSLocationManager version: 4.0.0-beta.10 (4010)
╠═════════════════════════════════════════════
{
"actions": [],
"activity": {
"activityRecognitionInterval": 10,
"disableMotionActivityUpdates": false,
"disableStopDetection": false,
"minimumActivityRecognitionConfidence": 75,
"motionTriggerDelay": 0,
"stopOnStationary": false,
"triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking"
},
"activityRecognitionInterval": 10,
"allowIdenticalLocations": false,
"allowTap": true,
"app": {
"backgroundPermissionRationale": {},
"enableHeadless": true,
"foregroundService": true,
"headlessJobService": "com.transistorsoft.flutter.backgroundgeolocation.HeadlessTask",
"heartbeatInterval": 600,
"mainActivityName": "null",
"notification": {
"actions": [],
"allowTap": true,
"channelDescription": "Location tracking",
"channelId": "bggeo",
"channelName": "BackgroundGeolocation",
"color": "",
"importance": 2,
"largeIcon": "",
"layout": "",
"priority": -1,
"smallIcon": "mipmap\/ic_launcher",
"sticky": false,
"strings": {},
"tapActivity": "",
"text": "Tracking location",
"title": "Background Geolocation"
},
"schedule": [],
"scheduleUseAlarmManager": false,
"startOnBoot": true,
"stopOnTerminate": false
},
"authorization": {
"accessToken": "eyJ0e✱✱✱",
"expires": -1,
"refreshHeaders": {},
"refreshPayload": {},
"refreshToken": "✱✱✱",
"refreshUrl": "✱✱✱",
"strategy": "JWT"
},
"autoSync": true,
"autoSyncThreshold": 0,
"backgroundPermissionRationale": {},
"batchSync": false,
"channelDescription": "Location tracking",
"channelId": "bggeo",
"channelName": "BackgroundGeolocation",
"color": "",
"debug": true,
"deferTime": 0,
"desiredAccuracy": -1,
"didDeviceReboot": true,
"didShowBackgroundPermissionRationale": false,
"disableAutoSyncOnCellular": false,
"disableElasticity": false,
"disableLocationAuthorizationAlert": false,
"disableMotionActivityUpdates": false,
"disableProviderChangeRecord": false,
"disableStopDetection": false,
"distanceFilter": 25,
"elasticityMultiplier": 1,
"enableHeadless": true,
"enableTimestampMeta": false,
"enabled": true,
"extras": {},
"fastestLocationUpdateInterval": -1,
"foregroundService": true,
"geofenceInitialTriggerEntry": true,
"geofenceModeHighAccuracy": true,
"geofenceProximityRadius": 1000,
"geofenceTemplate": "",
"geolocation": {
"allowIdenticalLocations": false,
"deferTime": 0,
"desiredAccuracy": -1,
"disableElasticity": false,
"disableLocationAuthorizationAlert": false,
"distanceFilter": 25,
"elasticityMultiplier": 1,
"enableTimestampMeta": false,
"fastestLocationUpdateInterval": -1,
"filter": {
"burstWindow": 10,
"filterDebug": false,
"kalmanDebug": false,
"kalmanProfile": 0,
"maxBurstDistance": 300,
"maxImpliedSpeed": 60,
"odometerAccuracyThreshold": 20,
"odometerUseKalmanFilter": true,
"policy": 2,
"rollingWindow": 5,
"trackingAccuracyThreshold": 100,
"useKalman": true
},
"geofenceInitialTriggerEntry": true,
"geofenceModeHighAccuracy": true,
"geofenceProximityRadius": 1000,
"locationAuthorizationRequest": "Always",
"locationTimeout": 60,
"locationUpdateInterval": 1000,
"stationaryRadius": 25,
"stopAfterElapsedMinutes": 0,
"stopTimeout": 3,
"useCLLocationAccuracy": true,
"useSignificantChangesOnly": false
},
"headers": {
"Device": "415de✱✱✱",
"Role": "1ebe4✱✱✱"
},
2025-12-09 13:55:20.445 24330-24368 TSLocationManager com.humaxnetworks.monipod I "headlessJobService": "com.transistorsoft.flutter.backgroundgeolocation.HeadlessTask",
"heartbeatEnabled": false,
"heartbeatInterval": 600,
"http": {
"autoSync": true,
"autoSyncThreshold": 0,
"batchSync": false,
"disableAutoSyncOnCellular": false,
"headers": {
"Device": "415de✱✱✱",
"Role": "1ebe4✱✱✱"
},
"maxBatchSize": -1,
"method": "POST",
"params": {},
"rootProperty": "location",
"timeout": 60000,
"url": "https:\/\/monipodmobiledev.moni-care.com\/mobile\/gis\/device\/geo-location"
},
"httpRootProperty": "location",
"httpTimeout": 60000,
"importance": 2,
"isFirstBoot": false,
"isMoving": false,
"largeIcon": "",
"layout": "",
"locationAuthorizationRequest": "Always",
"locationTemplate": "",
"locationTimeout": 60,
"locationUpdateInterval": 1000,
"locationsOrderDirection": "ASC",
"logLevel": 5,
"logMaxDays": 3,
"logger": {
"debug": true,
"logLevel": 5,
"logMaxDays": 3
},
"mainActivity": "null",
"maxBatchSize": -1,
"maxDaysToPersist": 1,
"maxRecordsToPersist": -1,
"method": "POST",
"minimumActivityRecognitionConfidence": 75,
"motionTriggerDelay": 0,
"notification": {
"actions": [],
"allowTap": true,
"channelDescription": "Location tracking",
"channelId": "bggeo",
"channelName": "BackgroundGeolocation",
"color": "",
"importance": 2,
"largeIcon": "",
"layout": "",
"priority": -1,
"smallIcon": "mipmap\/ic_launcher",
"sticky": false,
"strings": {},
"tapActivity": "",
"text": "Tracking location",
"title": "Background Geolocation"
},
"odometer": 0,
"odometerError": 0,
"params": {},
"persistMode": 2,
"persistence": {
"disableProviderChangeRecord": false,
"extras": {},
"geofenceTemplate": "",
"locationTemplate": "",
"locationsOrderDirection": "ASC",
"maxDaysToPersist": 1,
"maxRecordsToPersist": -1,
"persistMode": 2
},
"priority": -1,
"schedule": [],
"scheduleUseAlarmManager": false,
"schedulerEnabled": false,
"smallIcon": "mipmap\/ic_launcher",
"startOnBoot": true,
"stationaryRadius": 25,
"sticky": false,
"stopAfterElapsedMinutes": 0,
"stopOnStationary": false,
"stopOnTerminate": false,
"stopTimeout": 3,
"strings": {},
"tapActivity": "",
"text": "Tracking location",
"title": "Background Geolocation",
"trackingMode": 1,
"triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking",
"url": "https:\/\/monipodmobiledev.moni-care.com\/mobile\/gis\/device\/geo-location",
"useCLLocationAccuracy": true,
"useSignificantChangesOnly": false
}
2025-12-09 13:55:20.446 24330-24368 TSLocationManager com.humaxnetworks.monipod I [c.t.l.logger.LoggerFacade$a a]
╔═════════════════════════════════════════════
║ DEVICE SENSORS
╠═════════════════════════════════════════════
╟─ ✅ ACCELEROMETER: {Sensor name="lsm6dso LSM6DSO Accelerometer Non-wakeup", vendor="STMicro", version=15933, type=1, maxRange=78.4532, resolution=0.0023928226, power=0.17, minDelay=5000}
╟─ ✅ GYROSCOPE: {Sensor name="lsm6dso LSM6DSO Gyroscope Non-wakeup", vendor="STMicro", version=15933, type=4, maxRange=17.453018, resolution=6.108648E-4, power=0.55, minDelay=5000}
╟─ ✅ MAGNETOMETER: {Sensor name="ak0991x AK09918 Magnetometer Non-wakeup", vendor="akm", version=146988, type=2, maxRange=4912.0503, resolution=0.15, power=1.1, minDelay=10000}
╟─ ✅ SIGNIFICANT_MOTION: {Sensor name="smd Wakeup", vendor="Samsung", version=1, type=17, maxRange=1.0, resolution=1.0, power=0.001, minDelay=-1}
╚═════════════════════════════════════════════Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working