Ben Borgers / Posts /

How to get the device's IP address with Expo

January 24, 2021 by @benborgers

First, install the expo-network package:

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

A quick favor: was anything I wrote incorrect or misspelled, or do you still have questions? Please use this form to let me know or ask for help!

Loading...