Я не могу заставить забавного c менеджера местоположения работать на iOS 13, его никогда не вызывают
let nsuuid = NSUUID(uuidString: "B9407F30-F5F8-466E-AFF9-25556B57FE6D")
if let clregion = nsuuid as UUID? {
let constrain = CLBeaconIdentityConstraint(uuid: clregion)
let region = CLBeaconRegion(beaconIdentityConstraint: constrain, identifier: "Estimotes")
self.locationManager.startRangingBeacons(satisfying: constrain)
}
}
// Beacon tracking function
func locationManager(_ manager: CLLocationManager,
didRange beacons: [CLBeacon],
satisfying beaconConstraint: CLBeaconIdentityConstraint){
//get an array of beacon that are close
var knownBeacons = beacons.filter { ($0.proximity == CLProximity.immediate) && ($0.accuracy > 0) }
в iOS 12, который я делал так,
let nsuuid = NSUUID(uuidString: "B9407F30-F5F8-466E-AFF9-25556B57FE6D")
if let clregion = nsuuid as UUID? {
let region = CLBeaconRegion(proximityUUID: clregion, identifier: "Estimotes")
locationManager.startRangingBeacons(in: region)
}
}
// Beacon tracking function
ffunc locationManager(_ manager: CLLocationManager,
didRangeBeacons beacons: [CLBeacon],
in region: CLBeaconRegion){
//get an array of beacon that are close
var knownBeacons = beacons.filter { ($0.proximity == CLProximity.immediate) && ($0.accuracy > 0) }
и все работало просто отлично! Любой может помочь мне понять это, так как функции ios12 устарели