2019-07-19 02:35:50 +03:00
|
|
|
---
|
|
|
|
name: Xamarin.iOS - AirLocate
|
2019-08-02 05:56:58 +03:00
|
|
|
description: "AirLocate shows how to use CLLocationManager to monitor and range CLBeaconRegion. The code also provides an example of calibrating..."
|
2019-07-19 02:35:50 +03:00
|
|
|
page_type: sample
|
|
|
|
languages:
|
|
|
|
- csharp
|
|
|
|
products:
|
|
|
|
- xamarin
|
|
|
|
urlFragment: airlocate
|
|
|
|
---
|
|
|
|
# AirLocate
|
2019-08-02 05:56:58 +03:00
|
|
|
|
2013-09-18 21:23:40 +04:00
|
|
|
AirLocate shows how to use `CLLocationManager` to monitor and range `CLBeaconRegion`.
|
|
|
|
The code also provides an example of how you can calibrate and configure an iOS device as a beacon with CoreBluetooth.
|
|
|
|
|
|
|
|
You can configure an iOS device as a beacon as follows:
|
|
|
|
|
|
|
|
1) Obtain two iOS devices equipped with Bluetooth LE. One will be a target device, one will be a remote (calibration) device.
|
|
|
|
|
|
|
|
2) Load and launch this app on both devices.
|
|
|
|
|
|
|
|
3) Turn the target device into a beacon by selecting Configuration and turning on the Enabled switch.
|
|
|
|
|
|
|
|
4) Take the calibration device and move one meter away from the target device.
|
|
|
|
|
|
|
|
5) On the calibration device start the calibration process by selecting Calibration.
|
|
|
|
|
|
|
|
6) Choose the target device from the table view.
|
|
|
|
|
|
|
|
7) The calibration process will start. You should wave the calibration device from side-to-side while this process is running.
|
|
|
|
|
|
|
|
8) When the calibration process is done, it will show a calibrated RSSI value on the screen.
|
|
|
|
|
|
|
|
9) On the target device, go back to the Configuration screen and enter this value under Measured Power.
|
|
|
|
|
|
|
|
Note: The calibration process is optional, but recommended as it will fine-tune ranging for your environment.
|
|
|
|
You can configure an iOS device as a beacon without calibrating it by not specifying a measured power.
|
|
|
|
If a measured power is not specified, CoreLocation default to a pre-determined value.
|
|
|
|
|
|
|
|
Once you've setup your target device as a beacon, you can use this app to demo beacon ranging and monitoring.
|
|
|
|
To demo ranging, select Ranging from the remote device. `RangingViewController` ranges a set of `CLBeaconRegion`.
|
|
|
|
To demo monitoring, select Monitoring from the remote device. `MonitoringViewController` allows you to configure a `CLBeaconRegion` to monitor.
|
|
|
|
|
|
|
|
This sample is the Xamarin.iOS version of Apple's iOS7 Sample -- AirLocate.
|
|
|
|
|
2019-08-02 05:56:58 +03:00
|
|
|
Here is the link to the Apple's Sample:
|
2013-09-18 21:23:40 +04:00
|
|
|
https://developer.apple.com/downloads/index.action?name=WWDC%202013#
|
|
|
|
|
2019-07-19 02:35:50 +03:00
|
|
|
![AirLocate application screenshot](Screenshots/01.png "AirLocate application screenshot")
|