Skip to content

Commit dbaff1d

Browse files
authored
Request location permission "always" during onboarding (#3344)
1 parent 0e92864 commit dbaff1d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/App/Utilities/Permissions.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ private class PermissionsLocationDelegate: NSObject, CLLocationManagerDelegate {
312312
return
313313
}
314314

315+
if manager.authorizationStatus == .authorizedWhenInUse {
316+
locationManager.requestAlwaysAuthorization()
317+
}
318+
315319
completionHandler?(manager.authorizationStatus.genericStatus)
316320
}
317321

@@ -329,7 +333,10 @@ private class PermissionsLocationDelegate: NSObject, CLLocationManagerDelegate {
329333
let status = locationManager.authorizationStatus
330334

331335
switch status {
332-
case .authorizedWhenInUse, .notDetermined:
336+
case .notDetermined:
337+
locationManager.delegate = self
338+
locationManager.requestWhenInUseAuthorization()
339+
case .authorizedWhenInUse:
333340
locationManager.delegate = self
334341
locationManager.requestAlwaysAuthorization()
335342
default:

0 commit comments

Comments
 (0)