I can't make the func location manager work on iOS 13, it never gets called
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) }
in iOS 12 I used to do like this,
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) }
and it worked just fine! Anyone can help me figure this ou, since the ios12 functions got deprecated