Code=1 corresponds to the CLError.Code.denied error. You should probably handle again the location authorization by using
func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
// here you call the function that manages the location rights at the app launch
}
Topic:
App & System Services
SubTopic:
Maps & Location
Tags: