-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"WhenInUse" config option being ignored on android #1762
Labels
Comments
You are either:
|
The default value of // NO
BackgroundGeolocation.requestPermission()
.
.
.
await BackgroundGeolocation.ready(config) // <-- Your Config is NOT applied until this completes!!!
// ONLY HERE has your Config been applied.
BackgroundGeolocation.requestPermission() Calling |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm hoping this amounts to a simply missing something on our side. We recently changed our app permissions from always on in the background, to only while in use. However, when we pass
locationAuthorizationRequest: 'WhenInUse'
in the config, the app will always open an OS permission prompt to change the permissions to "Allow all the time".I have read the docs and every related issue I think might be causing issue. I've reset our config just in case a broken one was persisting and we've checked we're not requesting anything before
.ready
.Your Environment
react-native -v
): 0.72.3Expected Behavior
When running
BackgroundGeolocation.requestPermission()
and setting the app location permissions to while in app, when ready is called then there should be no further prompt iflocationAuthorizationRequest: 'WhenInUse'
is set. Alternatively if it needs to prompt again, it will only ask for in app usage.Actual Behavior
This prompt will show up every time until the user allows.
Steps to Reproduce
Context
Ideally the user shouldn't ever need to allow permissions for all the time.
Debug logs
Logs are from app open until the permission prompt comes up
Logs
```07-26 14:56:04.762 11126 11126 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot]
07-26 14:56:04.762 11126 11126 I TSLocationManager: ⏰ Scheduled OneShot: TERMINATE_EVENT in 10000ms (jobID: -1708771588)
07-26 14:56:04.789 11126 15193 D TSLocationManager: [c.t.l.a.BackgroundGeolocation b]
07-26 14:56:04.789 11126 15193 D TSLocationManager: 🔴 Cleared callbacks
07-26 14:56:09.679 11126 15312 D TSLocationManager: [c.t.l.g.TSGeofenceManager$f run]
07-26 14:56:09.679 11126 15312 D TSLocationManager: ╔═════════════════════════════════════════════
07-26 14:56:09.679 11126 15312 D TSLocationManager: ║ TSGeofenceManager monitoring 0/0
07-26 14:56:09.679 11126 15312 D TSLocationManager: ╠═════════════════════════════════════════════
07-26 14:56:09.679 11126 15312 D TSLocationManager: ╚═════════════════════════════════════════════
07-26 14:56:09.698 11126 15394 I TSLocationManager: [c.t.l.service.HeartbeatService start]
07-26 14:56:09.698 11126 15394 I TSLocationManager: 🎾 Start heartbeat (900s)
07-26 14:56:09.702 11126 15394 D TSLocationManager: [c.t.locationmanager.util.c g]
07-26 14:56:09.702 11126 15394 D TSLocationManager: ℹ️ LocationAuthorization: Permission granted
07-26 14:56:09.703 11126 15312 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult]
07-26 14:56:09.703 11126 15312 I TSLocationManager: 🔵 Acquired current position
07-26 14:56:09.704 11126 15312 D TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 5.0
07-26 14:56:09.874 11126 15394 D TSLocationManager: [c.t.locationmanager.util.c g]
07-26 14:56:09.874 11126 15394 D TSLocationManager: ℹ️ LocationAuthorization: Permission granted
07-26 14:56:09.874 11126 15312 I TSLocationManager: [c.t.locationmanager.util.c h]
07-26 14:56:09.874 11126 15312 I TSLocationManager: 🔵 LocationAuthorization: Requesting permission
07-26 14:56:09.874 11126 15213 I TSLocationManager: - Enable: true → true, trackingMode: 1
07-26 14:56:09.874 11126 11126 I TSLocationManager: [c.t.locationmanager.util.c$j onPermissionGranted]
07-26 14:56:09.874 11126 11126 I TSLocationManager: ✅ LocationAuthorization: Permission granted
07-26 14:56:09.875 11126 15213 D TSLocationManager: [c.t.l.http.HttpService startMonitoringConnectivityChanges]
07-26 14:56:09.875 11126 15213 D TSLocationManager: 🎾 Start monitoring connectivity changes
07-26 14:56:09.875 11126 15213 D TSLocationManager: [c.t.l.device.DeviceSettings startMonitoringPowerSaveChanges]
07-26 14:56:09.875 11126 15213 D TSLocationManager: 🎾 Start monitoring powersave changes
07-26 14:56:09.875 11126 15213 I TSLocationManager: [c.t.locationmanager.util.c h]
07-26 14:56:09.875 11126 15213 I TSLocationManager: 🔵 LocationAuthorization: Requesting permission
07-26 14:56:09.878 11126 15213 I TSLocationManager: [c.t.l.service.HeartbeatService start]
07-26 14:56:09.878 11126 15213 I TSLocationManager: 🎾 Start heartbeat (900s)
07-26 14:56:09.907 11126 11126 D TSLocationManager: [c.t.l.service.AbstractService start]
07-26 14:56:09.907 11126 11126 D TSLocationManager: 🎾 LocationRequestService [eventCount: 1]
07-26 14:56:09.908 11126 15213 I TSLocationManager: [c.t.l.l.SingleLocationRequest startUpdatingLocation]
07-26 14:56:09.908 11126 15213 I TSLocationManager: 🔵 [SingleLocationRequest start, action: 2, requestId: 34]
07-26 14:56:09.909 11126 11126 I TSLocationManager: [c.t.locationmanager.util.c$j onPermissionGranted]
07-26 14:56:09.909 11126 11126 I TSLocationManager: ✅ LocationAuthorization: Permission granted
07-26 14:56:09.912 11126 15213 D TSLocationManager: [c.t.l.service.AbstractService finish] ⚙️︎ finish LocationRequestService [eventCount: 0, sticky: true]
07-26 14:56:09.976 11126 11126 D TSLocationManager: [c.t.l.service.AbstractService start]
07-26 14:56:09.976 11126 11126 D TSLocationManager: 🎾 LocationRequestService [eventCount: 1]
07-26 14:56:09.976 11126 15213 I TSLocationManager: [c.t.l.l.SingleLocationRequest startUpdatingLocation]
07-26 14:56:09.976 11126 15213 I TSLocationManager: 🔵 [SingleLocationRequest start, action: 1, requestId: 35]
07-26 14:56:09.977 11126 15213 I TSLocationManager: [c.t.l.s.ActivityRecognitionService start]
07-26 14:56:09.977 11126 15213 I TSLocationManager: 🎾 Start motion-activity updates
07-26 14:56:09.978 11126 15213 D TSLocationManager: [c.t.l.service.AbstractService finish] ⚙️︎ finish LocationRequestService [eventCount: 0, sticky: true]
07-26 14:56:10.007 11126 11126 I TSLocationManager: [c.t.l.s.TSScheduleManager oneShot]
07-26 14:56:10.007 11126 11126 I TSLocationManager: ⏰ Oneshot TERMINATE_EVENT is already pending
07-26 14:56:10.036 11126 11126 D TSLocationManager: [c.t.l.a.TSLocationManagerActivity execute] android.permission.ACCESS_BACKGROUND_LOCATION
07-26 14:56:10.133 11126 11126 D TSLocationManager: [c.t.l.a.TSLocationManagerActivity execute] locationsettings
07-26 14:56:10.134 11126 11126 D TSLocationManager: [c.t.l.adapter.TSConfig translateDesiredAccuracy] translateDesiredAccuracy (true): -1
07-26 14:56:10.155 11126 11126 D TSLocationManager: [c.t.l.a.TSLocationManagerActivity stop] eventCount: 1
07-26 14:56:10.858 11126 11126 D TSLocationManager: [c.t.l.service.AbstractService start]
07-26 14:56:10.858 11126 11126 D TSLocationManager: 🎾 LocationRequestService [eventCount: 1]
07-26 14:56:10.860 11126 11126 D TSLocationManager: [c.t.l.service.AbstractService start]
07-26 14:56:10.860 11126 11126 D TSLocationManager: 🎾 LocationRequestService [eventCount: 2]
07-26 14:56:10.860 11126 15213 I TSLocationManager: [c.t.l.s.LocationRequestService handleLocationResult]
07-26 14:56:10.860 11126 15213 I TSLocationManager: ╔═════════════════════════════════════════════
07-26 14:56:10.860 11126 15213 I TSLocationManager: ║ getCurrentPosition LocationResult: 34
07-26 14:56:10.860 11126 15213 I TSLocationManager: ╠═════════════════════════════════════════════
07-26 14:56:10.860 11126 15213 I TSLocationManager: ╟─ 📍 Location[fused 37.421998,-122.084000 hAcc=45.103 et=+7h17m48s80ms alt=5.0 vAcc=0.76070404], age: 858ms, time: 1690379770000
07-26 14:56:10.860 11126 15312 I TSLocationManager: [c.t.l.s.LocationRequestService handleLocationResult]
07-26 14:56:10.860 11126 15312 I TSLocationManager: ╔═════════════════════════════════════════════
07-26 14:56:10.860 11126 15312 I TSLocationManager: ║ motionchange LocationResult: 35
07-26 14:56:10.860 11126 15312 I TSLocationManager: ╠═════════════════════════════════════════════
07-26 14:56:10.860 11126 15312 I TSLocationManager: ╟─ 📍 Location[fused 37.421998,-122.084000 hAcc=45.103 et=+7h17m48s80ms alt=5.0 vAcc=0.76070404], age: 860ms, time: 1690379770000
07-26 14:56:10.861 11126 15213 I TSLocationManager: [c.t.l.l.TSLocationManager onSingleLocationResult]
07-26 14:56:10.861 11126 15213 I TSLocationManager: 🔵 Acquired current position
07-26 14:56:10.861 11126 15213 D TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 5.0
07-26 14:56:10.868 11126 11126 D TSLocationManager: [c.t.l.service.AbstractService finish] ⚙️︎ finish LocationRequestService [eventCount: 0, sticky: false]
07-26 14:56:10.875 11126 15312 D TSLocationManager: [c.t.l.l.TSLocationManager calculateMedianAccuracy] Median accuracy: 5.0
07-26 14:56:10.875 11126 15213 D TSLocationManager: [c.t.l.s.LocationRequestService handleLocationResult] SingleLocationRequest 34 isFinished? true
07-26 14:56:10.876 11126 15213 D TSLocationManager: [c.t.l.service.AbstractService finish] ⚙️︎ finish LocationRequestService [eventCount: 0, sticky: false]
07-26 14:56:10.876 11126 15312 D TSLocationManager: [c.t.l.s.LocationRequestService handleLocationResult] SingleLocationRequest 35 isFinished? false
07-26 14:56:10.876 11126 15312 D TSLocationManager: [c.t.l.service.AbstractService finish] ⚙️︎ finish LocationRequestService [eventCount: 0, sticky: false]
07-26 14:56:10.877 11126 15311 I TSLocationManager: [c.t.l.data.sqlite.b persist]
07-26 14:56:10.877 11126 15311 I TSLocationManager: ✅ INSERT: b521fcfe-c77e-4f54-9bd9-b48b0c1b4240
07-26 14:56:10.882 11126 11126 D TSLocationManager: [c.t.l.service.AbstractService onDestroy]
07-26 14:56:10.882 11126 11126 D TSLocationManager: 🔴 LocationRequestService stopped
The text was updated successfully, but these errors were encountered: