react-native-public-ip

react-native-public-ip JS library on GitHub react-native-public-ip JS library on npm Download react-native-public-ip JS library

Get public IP address in React Native

Version 1.0.2 License MIT
react-native-public-ip has no homepage
react-native-public-ip JS library on GitHub
react-native-public-ip JS library on npm
Download react-native-public-ip JS library
Keywords
ipipv4ipv6addresspublicexternalown

react-native-public-ip

Get public IP address in React Native

Using the ipify API

Install

$ npm install --save react-native-public-ip

Usage

import publicIP from 'react-native-public-ip';

publicIP()
  .then(ip => {
    console.log(ip);
    // '47.122.71.234'
  })
  .catch(error => {
    console.log(error);
    // 'Unable to get IP address.'
  });

API

publicIP()

Returns a Promise for the IP address.

License

MIT © Alex Hinson