Skip to content

Commit

Permalink
Grab initial loc update
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Oct 13, 2023
1 parent 5395ed3 commit 2963549
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apple/Sources/FerrostarCore/Location.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public class LiveLocationProvider: NSObject {
switch locationManager.authorizationStatus {
case .notDetermined:
locationManager.requestWhenInUseAuthorization()
case .authorizedAlways, .authorizedWhenInUse:
locationManager.requestLocation()
default:
break // No action
break
}

locationManager.activityType = activityType
Expand Down Expand Up @@ -76,6 +78,12 @@ extension LiveLocationProvider: CLLocationManagerDelegate {

public func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
authorizationStatus = locationManager.authorizationStatus

switch authorizationStatus {
case .authorizedAlways, .authorizedWhenInUse:
locationManager.requestLocation()
default: break
}
}
}

Expand Down

0 comments on commit 2963549

Please sign in to comment.