Search code examples
javascriptreact-nativeexpo

Is there Any way to get public ip address without using any packages (EXPO)


im using expos 'expo-network' package, i want to remove unnecessary packages from package.json any workaround for getting public ip address

i tried


Solution

    • Try to use ipfy API request : GET https://api.ipify.org?format=json response :{ "ip": "<public ip of requester>" }

    • For more information see ipify docs

    • there is no usage limit

    • WARN! : it will introduce a new async request, So Handle With Care !