***当我想使用 expo-NETWORK 获取 mac 地址时, 它要求***“承诺” 代码 : ` const ipAlert = async () => { 尝试{
const ip = await Network.getMacAddressAsync('wlan0')()
} catch (error) {
console.log('That did not go well.')
}
};`
getMacAddressAsync()
调用返回一个承诺,您需要像这样处理:
Network.getMacAddressAsync()
.then(macAddress => {
console.log(macAddress)
})
.catch(error => console.log(error))
我可以这样获取mac地址吗?因为我听说 android/ios 在这方面变得更加严格,目前我没有看到任何方法在 expo api 上获取 MAC 地址。那么现在我可以得到还是不能得到?