First, install the
expo install expo-network
Then, import the package in the file you’d like to use it:
import * as Network from "expo-network"
Now, you can use the
Network object to get the IP address:
const ip = await Network.getIpAddressAsync()
Last updated January 24, 2021