Ionic BLE Android Ble is retrieving MAC address of the peripheral different than IOS Ble

Issue

I just started learning the ionic framework and I am working with BLE libraries.

I can scan for other BLE devices and get thier information when I run it on an Android phone (physical). The response look something like this…

'name': 'Device Name',
'id': 'DC:A6:32:D9:56:15',
'advertising': {},
'rssi': -35

link to documentation of BLE https://ionicframework.com/docs/v3/native/ble/

I was able to do the same thing on IOS BUT the MAC address/ID looks like this…

88C4BC81-E67F-E804-03C3-47E4296F577D

It looks like a serial number.
Can someone please explain to me why?

I look at different encoding and such but no luck.
To be honest I do not know what the right question is to ask.

Thank you for your help.
Sorry if this question is not clear.

Solution

The "MAC address/ID" on iOS is not a MAC address. You’re reading the identifier property. That’s a UUID created by the phone. It’s generally consistent for a given device, but may change over time (though never during a single connection, and they don’t generally change that often).

There is no way to get the MAC address of a CBPeripheral on iOS. There is no way to uniquely identify a BLE device on iOS in a way that is consistent across iOS devices, or that is promised to be permanent on a single iOS device.

Answered By – Rob Napier

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published