Sure. Based on one of the answers in this thread, you can implement in React Native like this -
import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View } from 'react-native'; export default class Test extends Component { constructor(props) { super(props); this.state = { countryName: '', regionName: '' }; } componentDidMount() { var url = 'https://freegeoip.net/json/'; fetch(url) .then((response) => response.json()) .then((responseJson) => {
source share