Gets the device's current network connection state.
On web, navigator.connection.type is not available on browsers. So if there is an active network connection, the field type returns NetworkStateType.UNKNOWN. Otherwise, it returns NetworkStateType.NONE.
A Promise that resolves to an object with the following fields:
type (NetworkStateType) -- a NetworkStateType enum value that represents the current network connection type.
isConnected (boolean) -- if there is an active network connection. Note that this does not mean that internet is reachable. This field is false if the type is either Network.NetworkStateType.NONE or Network.NetworkStateType.UNKNOWN, true otherwise.
isInternetReachable (boolean) -- if the internet is reachable with the currently active network connection. On Android, this depends on NetInfo.isConnected() (API level < 29) or ConnectivityManager.getActiveNetwork() (API level >= 29). On iOS, this value will always be the same as isConnected.
Gets the specified network interface's Mac address. On Android, it requires android.permission.ACCESS_WIFI_STATE permission to access available network interfaces.
interfaceName (string | null) -- A string representing interface name (eth0, wlan0) or null (default), meaning the method should fetch the MAC address of the first available interface. (On iOS this argument is ignored.)
A Promise that resolves to a string of the network adapter MAC address or null if there's no such address matching the interface. On web, the Promise resolves to null.
Note from 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 getIosIdForVendorAsync() method of the expo-application unimodule instead.
On Android, there may be an unknown Wifi host when trying to access WifiManager in getIpAddressAsync. On iOS, no network interfaces could be retrieved.
ERR_NETWORK_UNDEFINED_INTERFACE
An undefined interfaceName was passed as an argument in getMacAddressAsync.
ERR_NETWORK_SOCKET_EXCEPTION
An error was encountered in creating or accessing the socket in getMacAddressAsync.