【发布时间】:2020-04-04 20:55:20
【问题描述】:
无法从 CLBeaconRegion 检索标识符非常令人沮丧。这是一个简化的示例:
let beaconRegion = CLBeaconRegion(uuid: UUID(uuidString: "E2C56DB5-DFFB-48D2-B060-D0F5A71096E0")!, major: 111, minor: 222, identifier: "NewBeacon")
locationManager?.startMonitoring(for: beaconRegion)
locationManager?.startRangingBeacons(in: beaconRegion)
func locationManager(_ manager: CLLocationManager, didRangeBeacons beacons: [CLBeacon], in region: CLBeaconRegion) {
if let beacon = beacons.first {
print(beacon.identifier) //that
}
}
有没有办法获取“NewBeacon”标识符?
【问题讨论】:
标签: ios swift core-location cllocationmanager