Search code examples
iosbluetoothbluetooth-lowenergyibeaconios7.1

What technical constraints exist to detect nearby devices with "iBeacon" in iOS 7.1?


I would like to have advice on how to make an application that uses ibeacon technology on ios 7.1.

The scenario of the application is simple: Many people have the same application installed on their phones. Whenever two (or more) users are close (in the same room, for example) they are notified. ("Hello user1, user2 is next to you" and "Hello user2, user1 is near you"). Phones may be in the pocket.

Here are my questions:

1- I think Core Bluetooth framework is sufficient for me, but several examples are mixing the use of this framework with Core Location framework. Can you confirm for my scenario, Core Location is not required?

2- In my case, each "phone" would be both beacon and Peripheral, I think it could cause problems... Is it a misuse of the original purpose of the framework?

3- Finally, I summarized the constraints Foreground / Background / Closed app in the diagram below. Is my interpretation right or wrong ?

diagram of constraints Foreground / Background / Closed app

Thank you in advance for your advice!


Solution

  • While iBeacon uses Bluetooth Low Energy, it is handled through Core Location and doesn't permit communication between devices, so you are correct, this probably isn't the framework that you want to use.

    You can use Core-Bluetooth to operate as a peripheral and central at the same time, even in the background if you specify the correct keys in your info.plist - iOS 7 Core Bluetooth Peripheral running in background

    The table in your question related to iBeacon region detection in the Core Location framework, so I don't think these times are relevant with Core-Bluetooth.

    For more information on using Core Bluetooth background you can refer to the Core Bluetooth programming guide