Preferred use cases for iBeacon on iOS?

I'm currently trying to get used to CoreBluetooth and iBeacon on iOS 7. When searching through the API, I noticed that there seem to be three ways to create and use iBeacons, and I'm not 100% sure what the differences are and when to use which. I found the following ways:

  • A location based approach using CBPeripheralManagerand CLLocationManagerwith CLBeaconRegion. This has the advantage that it gives me information about the proximity of devices. But since this is a location-based approach, it seems to me that I cannot transfer data with this, which I need.

  • Using the classes of the Framework Multipeer Framework, MCNearbyServiceBrowserand MCNearbyServiceAdvertiser. This is very easy to configure, allows you to transfer arbitrary data, but I do not receive any information about the proximity of the two devices that I need.

  • I found an example project from Apple where they use CBCentralManagerand CBPeripheral. This allows me to transmit arbitrary data and receive limited proximity information (I get RSSI, but not signal accuracy), but it seems rather complicated as there are a lot of callbacks and I have to take care of things like flow control.

So, I think, my question is: is there a preferred way? When to use which method? Can they be combined? For example, is it possible to listen to other devices using a location-based approach, and then connect to the device when it is near using the Multipeer Framework? If so, how can I make sure that I do not accidentally connect to the wrong device?

Thank!

+4
source share
2 answers

iBeacon - , iBeacon , , -, - , . iBeacon iOS, , , .

CoreBluetooth - . " " (, ), . ( "" ) , / - , .

Multipeer Connectivity Framework Bluetooth WiFi , .

, , , .

+4

, iBeacons. , Multipeer Connectivity, iBeacons . iBeacons - , .

CoreLocation CBCentralManager CBPeripheral, iBeacons, API- iBeacon iOS. . .

iBeacons ( ), API CoreLocation. .

+1

Source: https://habr.com/ru/post/1532113/


All Articles