Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Get Device MAC Address

Tags:

flutter

dart

Does flutter have some code or additional package to get MAC address of the device?

like image 600
aswin darma Avatar asked Oct 16 '18 02:10

aswin darma


People also ask

How do I get my device info on flutter?

You can use device_info_plus to get the following info. import 'package:device_info_plus/device_info_plus. dart'; DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); // Android AndroidDeviceInfo info = await deviceInfo. androidInfo; print(info.

How do I find my MAC address iOS?

Apple iOS (iPhone/iPad)Open Settings. Select General, then About. The wireless MAC address is listed under Wi-Fi Address.

How do I find my WIFI IP address in flutter?

So just go for network_info_plus and call await NetworkInfo(). getWifiIP() . By the way, you may also want to check if Wifi is available using the connectivity_plus plugin in flutter/plugins.


1 Answers

Flutter can only do as much as what the underlying OS can, since iOS 7 and Android 6, you will always get the same response 02:00:00:00:00:00, this has been made by Apple and Google for privacy concerns.

Quote 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. (Apps that need an identifier for their own advertising purposes should consider using the advertisingIdentifier property of ASIdentifierManager instead.)

Quote Google

To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs. The WifiInfo.getMacAddress() and the BluetoothAdapter.getAddress() methods now return a constant value of 02:00:00:00:00:00.

Long story short, no MAC address available.

like image 120
TruongSinh Avatar answered Oct 03 '22 09:10

TruongSinh