Search code examples
iosibeaconiphone-privateapi

iBeacon unique identifier with private api


I am in a situation to find the mac address or an unique identifier of an iBeacon with private API. With the CoreBluetooth i can have an identifier but it is not unique from iphone to another. and i can't link an identifier to an beacon with his advertised params (UUID, Major, Minor). Thanks.


Solution

  • It is possible to detect any iBeacon regardless of identifiers if you use private APIs. The basic idea is to create a subclass of CLBeaconRegion but make an internal structure that mirrors the standard iOS implementation. This implementation currently lets you specify that you want to see any beacon regardless of UUID.

    Sample code can be found in this project.

    Two caveats here:

    1. Because this uses a private API, Apple will certainly not approve apps with this code for distribution by the AppStore.

    2. This relies on an internal implementation of CLBeaconRegion that could change with any future release of iOS and stop working.