Skip to content

teamairship/react-native-public-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Get public IP address in React Native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published