Flutter获取设备MAC地址 [英] Flutter Get Device MAC Address

查看:1133
本文介绍了Flutter获取设备MAC地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

flutter是否有一些代码或其他软件包来获取设备的MAC地址?

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

推荐答案

Flutter只能做很多事情就像底层操作系统一样,自iOS 7和Android 6起,您将始终得到相同的响应 02:00:00:00:00:00 ,通过苹果 Google

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.

引用苹果


在iOS 7和更高版本中,如果您要求提供iOS设备的MAC地址,系统将返回值02:00:00:00:00:00。如果需要标识设备,请改用UIDevice的identifierForVendor属性。 (出于广告目的需要标识符的应用应考虑改用ASIdentifierManager的advertisingIdentifier属性。)

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.)

引用Google


为了向用户提供更大的数据保护,从此版本开始,Android删除了使用Wi-Fi和蓝牙API。 WifiInfo.getMacAddress()和BluetoothAdapter.getAddress()方法现在返回02:00:00:00:00:00的常量值。

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.

长话短说,没有可用的MAC地址。

Long story short, no MAC address available.

这篇关于Flutter获取设备MAC地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆