***when i want to get mac adress using expo.NETWORK, it asks for *** "hundling promises" code: ` const ipAlert = async () => { try {
const ip = await Network.getMacAddressAsync('wlan0')()
} catch (error) {
console.log('That did not go well.')
}
};`
The getMacAddressAsync()
call returns a promise, which you need to handle like this:
Network.getMacAddressAsync()
.then(macAddress => {
console.log(macAddress)
})
.catch(error => console.log(error))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.