The problem is that the UUID you read with CBCentralManager
has nothing to do with the iBeacon's ProximityUUID.
Despite the use of the term UUID in both fields, they are completely different. The field you can see with CBCentralManager
is just a session-specific identifier generated by iOS. If you use the same API to discover the same device at a later time, it will be a different value.
Unfortunately, it is not possible to use CoreBluetooth
APIs to read iBeacon identifiers. For more information about why see this blog post.