In the react-native application I use the react-native-device-info library to get the MAC address of the device.
But I can only get the mac address of Android devices. I could not find a library to get the mac address of iOs devices.
How do I get the MAC address of iOs devices?
To get the device information in React Native will use the react-native-device-info library.
From Home, tap Menu > Settings > About Phone/Device. Tap either Status or Hardware Information. Scroll down to WiFi MAC address.
There is no way of doing this in iOS 7 or later, citing apple:
In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value 02:00:00:00:00:00. If you need to identify the device, use the identifierForVendor property of UIDevice instead.
Instead, you should use "identifierForVendor" which could be received with react-native-device-info:
import DeviceInfo from 'react-native-device-info';
const uniqueId = DeviceInfo.getUniqueID();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With