{"id":5642,"date":"2019-11-27T17:09:46","date_gmt":"2019-11-27T11:39:46","guid":{"rendered":"https:\/\/www.innovationm.com\/blog\/?p=5642"},"modified":"2026-01-14T11:53:36","modified_gmt":"2026-01-14T06:23:36","slug":"how-to-use-geolocation-geocoding-in-react-native-apps","status":"publish","type":"post","link":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/","title":{"rendered":"How to use Geolocation, Geocoding in React Native Apps?"},"content":{"rendered":"<p>In this post, we will learn, How to implement Geolocation in your App?<\/p>\n<p>Geolocation will find your current location and Geocoding gives your address (like City Name, Street Name, etc) by Coordinates (Latitude and Longitude).<br \/>\n<strong><br \/>\nWhat is Geolocation?<br \/>\n<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">The most famous and familiar location feature \u2014 <strong>Geolocation<\/strong> is the ability to track a device using GPS, cell phone towers, WiFi access points or a combination of these. Since devices area unit employed by people, geolocation uses positioning systems to trace associate degree individual\u2019s whereabouts right down to latitude and great circle coordinates, or more practically, a physical address. Both mobile and desktop devices can use geolocation.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Geolocation<\/strong> is accustomed to confirm zone and actual positioning coordinates, like for chase life or shipment shipments.<\/span><\/p>\n<p><strong>What is Geocoding and Reverse geocoding?<\/strong><\/p>\n<p><strong>Geocoding<\/strong> is the method of remodeling an address or alternative description of a location into a (latitude, longitude) coordinate.<\/p>\n<p>Reverse geocoding is the method of remodeling a (latitude, longitude) coordinate into a (partial) address. The amount of detail in a very reverse geocoded location description might vary, as an example, one would possibly contain the complete address of the closest building, whereas another would possibly contain only a city name and postal code.<\/p>\n<p><strong>Post structure<br \/>\n<\/strong><br \/>\nWe will go in a step-by-step manner to explore the Geolocation.<\/p>\n<p><strong>STEPS<\/strong><\/p>\n<ul>\n<li>Create a simple React Native app<\/li>\n<li>Install Plugins for Geocoding and Geolocation and get User Location<\/li>\n<li>Get User Current Location (Geocoding)<\/li>\n<li>Convert User Geolocation into an address (Reverse Geocoding)<\/li>\n<\/ul>\n<p><strong>We have three major objectives<\/strong><\/p>\n<ul>\n<li>Get User Current Location that we&#8217;ll get in latitude and longitude (Geolocation)<\/li>\n<li>Convert that latitude and longitude in Street Address (Reverse Geocoding)<\/li>\n<li>Install Plugins for Geocoding and Geolocation and get User Location<\/li>\n<\/ul>\n<p style=\"text-align: left;\"><strong>Step 1: &#8211; Create a simple React Native app<\/strong><\/p>\n<p>If you&#8217;re aware of native development, you&#8217;ll doubtless need to use React Native user interface.<br \/>\nIt needs Xcode or Android Studio to get started.<br \/>\nIf you have already got one of these tools installed, you should be able to get up and running within some minutes.<br \/>\nIf they&#8217;re not installed, you should expect to spend about an hour installing and configuring them.<strong><br \/>\n<\/strong><br \/>\n<strong>React Native CLI Quickstart<br \/>\n<\/strong><br \/>\nAssuming that you just have <strong>Node 10+ installed<\/strong>, you&#8217;ll be able to use <strong>npm<\/strong> to install the React Native cli command-line utility:<\/p>\n<p><strong>npm install -g react-native-cli<br \/>\n<\/strong><br \/>\nThen run the following commands to create a new React Native project known as\u00a0 \u201c<strong>AwesomeProject<\/strong>\u201d:<\/p>\n<h5><strong>react-native init AwesomeProject<\/strong><\/h5>\n<p><strong>Step2 :- react-native-geolocation-service<br \/>\n<\/strong><br \/>\nThis library is created in an attempt to fix the location timeout issue on android with the react-native current implementation of Geolocation API. This library tries to solve the issue by using Google Play Service\u2019s new <strong>FusedLocationProviderClient<\/strong> API, which Google strongly recommends over android&#8217;s default framework location API. Which provider to use based on your request configuration, It automatically decides and also prompts you to change the location mode if it doesn&#8217;t satisfy your current request configuration.<\/p>\n<p><strong>NOTE:<\/strong> Location requests can still timeout since many android devices have GPS issues on the hardware level or in the system software level.<\/p>\n<p><strong>Installation:<\/strong><\/p>\n<p><strong>yarn add react-native-geolocation-service<\/strong><\/p>\n<p><strong>npm install react-native-geolocation-service<br \/>\n<\/strong><br \/>\n<strong>Setup:<br \/>\n<\/strong><br \/>\n<strong>Android:<br \/>\n<\/strong><br \/>\nNo additional setup is required for Android.<\/p>\n<p><strong>iOS:<br \/>\n<\/strong><br \/>\nEnable geolocation in the background, you will include the <strong>NSLocationAlwaysUsageDescription<\/strong> key in <strong>Info.plist<\/strong> and add location as a background mode in the &#8216;Capabilities&#8217; tab in <strong>Xcode<\/strong>.<\/p>\n<p>Update your Podfile<\/p>\n<p><strong>pod &#8216;react-native-geolocation&#8217;, path: &#8216;..\/node_modules\/@react-native-community\/geolocation&#8217;<\/strong><\/p>\n<p>Then run pod install from ios directory<\/p>\n<p><strong>Error Codes<br \/>\n<\/strong><\/p>\n<table style=\"height: 320px;\" width=\"711\">\n<thead>\n<tr>\n<th>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Name<\/th>\n<th>\u00a0Code<\/th>\n<th>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u00a0PERMISSION_DENIED<\/td>\n<td>\u00a0 \u00a01<\/td>\n<td>\u00a0 Location permission is not granted<\/td>\n<\/tr>\n<tr>\n<td>\u00a0POSITION_UNAVAILABLE<\/td>\n<td>\u00a0 \u00a02<\/td>\n<td>\u00a0 Location provider not available<\/td>\n<\/tr>\n<tr>\n<td>\u00a0TIMEOUT<\/td>\n<td>\u00a0 \u00a03<\/td>\n<td>\u00a0 Location request timed out<\/td>\n<\/tr>\n<tr>\n<td>\u00a0PLAY_SERVICE_NOT_AVAILABLE<\/td>\n<td>\u00a0 \u00a04<\/td>\n<td>\u00a0 Google play service is not installed or has an older version\u00a0 \u00a0 \u00a0 \u00a0 \u00a0(android only)<\/td>\n<\/tr>\n<tr>\n<td>\u00a0SETTINGS_NOT_SATISFIED<\/td>\n<td>\u00a0 \u00a05<\/td>\n<td>\u00a0 Location service is not enabled or location mode is not<br \/>\nappropriate for the current request (android only)<\/td>\n<\/tr>\n<tr>\n<td>\u00a0INTERNAL_ERROR<\/td>\n<td>\u00a0 -1<\/td>\n<td>\u00a0 Library crashed for some reason or\u00a0 \u00a0 \u00a0the\u00a0<code>getCurrentActivity()<\/code>\u00a0returned null (android only)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><br \/>\nStep 3:-Get User Current Location (Geocoding)<br \/>\n<\/strong><br \/>\nSince this library was meant to be a drop-in replacement for the RN\u2019s Geolocation API, the usage is pretty\u00a0uncomplicated, with some\u00a0further\u00a0error cases to handle.<\/p>\n<p>One\u00a0issue\u00a0to notice, this library assumes that location permission is already granted by the user,\u00a0thus\u00a0you have got\u00a0to use PermissionsAndroid to request for permission before\u00a0creating\u00a0the placement\u00a0request.<\/p>\n<div id=\"art-2\">\n<p>For\u00a0obtaining\u00a0user location\u00a0you have to\u00a0import Geolocation API from a\u00a0<strong>react-native-geolocation-service<\/strong> package like this.<\/p>\n<\/div>\n<p><strong>import Geolocation from &#8216;react-native-geolocation-service&#8217;;<br \/>\n<\/strong><br \/>\nAnd add this function into your code<\/p>\n<p>if (hasLocationPermission) {<br \/>\nGeolocation.getCurrentPosition(<br \/>\n(position) =&gt; {<br \/>\nconsole.log(position);<br \/>\n},<br \/>\n(error) =&gt; {<br \/>\n\/\/ See error code charts below.<br \/>\nconsole.log(error.code, error.message);<br \/>\n},<br \/>\n{ enableHighAccuracy: true, timeout: 10000, maximumAge:10000 }<br \/>\n);<br \/>\n}<\/p>\n<p><strong>So after adding all this code your file something look like this.<\/strong><\/p>\n<div>\n<pre class=\"lang:js decode:true \">    componentDidMount() {\r\n        Geolocation.getCurrentPosition(\r\n            (position) =&gt; {\r\n                console.log(position);\r\n            },\r\n            (error) =&gt; {\r\n                \/\/ See error code charts below.\r\n                console.log(error.code, error.message);\r\n            },\r\n            { enableHighAccuracy: false, timeout: 10000, maximumAge: 100000 }\r\n        );\r\n    }<\/pre>\n<\/div>\n<p><strong>Step 4:- User Geolocation into an address (Reverse Geocoding)<\/strong><\/p>\n<p>We used a <strong>react-native-geocoding<\/strong> package for Geocoding and Reverse Geocoding.<br \/>\nA geocoding module in React native to get a location description (Street Address, City Name, etc) via coordinates(Latitude and longitude).<\/p>\n<p>This module uses the Google Maps Geocoding API and requires an API key for purposes of quota management. Please check this<strong><a href=\"https:\/\/developers.google.com\/maps\/documentation\/geocoding\/get-api-key\">\u00a0<\/a><\/strong><a href=\"https:\/\/developers.google.com\/maps\/documentation\/geocoding\/get-api-key\" target=\"_blank\" rel=\"noopener\">link<\/a>\u00a0to obtain your API key.<\/p>\n<p><strong style=\"font-size: 1rem;\">Install<\/strong><\/p>\n<p><strong style=\"font-size: 1rem;\">npm install &#8211;save react-native-geocoding<br \/>\n<\/strong><br \/>\nYou can just\u00a0 import Geocoder API from a <strong>react-native-geocoding<\/strong> package in your App.<\/p>\n<p><strong>import Geocoder from &#8216;react-native-geocoding&#8217;;<\/strong><\/p>\n<p>And then you have to initialize the module in your app<\/p>\n<p><span class=\"variable other object js\">Geocoder<\/span><span class=\"meta js\"><span class=\"meta delimiter method period js\">.<\/span><span class=\"entity name function js\">init<\/span><span class=\"punctuation definition begin round js\">(<\/span><span class=\"string quoted double js\"><span class=\"punctuation definition string begin js\">&#8220;<\/span>xxxxxxxxxxxxxxxx<span class=\"punctuation definition string end js\">&#8220;<\/span><\/span><span class=\"punctuation definition end round js\">)<\/span><\/span><span class=\"punctuation terminator statement js\">;<\/span>\u00a0<span class=\"comment line double-slash js\"><span class=\"punctuation definition comment js\">\/\/<\/span>\u00a0use\u00a0a\u00a0valid\u00a0API\u00a0key<\/span><\/p>\n<p>\/\/ With more options<\/p>\n<p>\/\/ Geocoder.init(&#8220;xxxxxxxxxxxxxxxxxxx&#8221;, {language : &#8220;en&#8221;}); \/\/ set the language<\/p>\n<p>And use also this code for Geocoding and reverse Geocoding:<\/p>\n<p>Geocoder.from(41.89, 12.49)<br \/>\n.then(json =&gt; {<br \/>\nvar addressComponent = json.results[0].address_components[0];<br \/>\nconsole.log(addressComponent);<br \/>\n})<br \/>\n.catch(error =&gt;<br \/>\n<span style=\"font-size: 1rem;\">\u00a0 \u00a0 \u00a0 \u00a0console.warn(error)<br \/>\n);<\/span><\/p>\n<p><strong>A working example of Geolocation and GeoCoding to React-Native Apps.<\/strong><\/p>\n<div>\n<pre class=\"lang:js decode:true \">import\u00a0React,\u00a0{\u00a0Component\u00a0}\u00a0from\u00a0'react';\r\nimport\u00a0{\u00a0StyleSheet,\u00a0Text,\u00a0View\u00a0}\u00a0from\u00a0'react-native';\r\nimport\u00a0Geocoder\u00a0from\u00a0'react-native-geocoding';\r\nimport\u00a0Geolocation\u00a0from\u00a0'react-native-geolocation-service';\r\n\r\nexport\u00a0default\u00a0class\u00a0LocationDemo\u00a0extends\u00a0Component\u00a0{\r\n\r\n\u00a0\u00a0\u00a0\u00a0constructor()\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0super()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.state\u00a0=\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0latitude:\u00a00,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0longitude:\u00a00,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0error:\u00a0null,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Address:\u00a0null\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\r\n\u00a0\u00a0\u00a0\u00a0async\u00a0componentDidMount()\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Geolocation.getCurrentPosition(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(position)\u00a0=&gt;\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.setState({\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0latitude:\u00a0position.coords.latitude,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0longitude:\u00a0position.coords.longitude,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Geocoder.from(position.coords.latitude,\u00a0position.coords.longitude)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.then(json\u00a0=&gt;\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(json);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var\u00a0addressComponent\u00a0=\u00a0json.results[0].address_components;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.setState({\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Address:\u00a0addressComponent\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0})\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(addressComponent);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0})\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0.catch(error\u00a0=&gt;\u00a0console.warn(error));\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0},\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0(error)\u00a0=&gt;\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0See\u00a0error\u00a0code\u00a0charts\u00a0below.\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 this.setState({\u00a0error:\u00a0error.message\u00a0}),\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(error.code,\u00a0error.message);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 },\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{\u00a0enableHighAccuracy:\u00a0false,\u00a0timeout:\u00a010000,\u00a0maximumAge:\u00a0100000\u00a0}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\r\n\u00a0\u00a0\u00a0\u00a0render()\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return\u00a0(\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;View\u00a0style={styles.MainContainer}&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Text\u00a0style={styles.text}&gt;\u00a0Latitude\u00a0=\u00a0{this.state.latitude}&lt;\/Text&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Text\u00a0style={styles.text}&gt;\u00a0Longitude\u00a0=\u00a0{this.state.longitude}&lt;\/Text&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;Text\u00a0style={styles.text}&gt;{this.state.Address}&lt;\/Text&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{this.state.error\u00a0?\u00a0&lt;Text&gt;Error:\u00a0{this.state.error}&lt;\/Text&gt;\u00a0:\u00a0null}\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/View&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0);\r\n\u00a0\u00a0\u00a0\u00a0}\r\n}\r\n\r\nconst\u00a0styles\u00a0=\u00a0StyleSheet.create({\r\n\u00a0\u00a0\u00a0\u00a0MainContainer:\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0flex:\u00a01,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0justifyContent:\u00a0'center',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0backgroundColor:\u00a0'#f5fcff',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0padding:\u00a011\r\n\u00a0\u00a0\u00a0\u00a0},\r\n\u00a0\u00a0\u00a0\u00a0text:\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0fontSize:\u00a022,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0color:\u00a0'#000',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0textAlign:\u00a0'center',\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0marginBottom:\u00a010\r\n\u00a0\u00a0\u00a0\u00a0},\r\n});<\/pre>\n<\/div>\n<p><strong>Conclusion<br \/>\n<\/strong><br \/>\nIn this blog, we learned how to implement the Geolocation React Native app. We also learned how to Convert Geocode in the Location address in a simple React Native app.<\/p>\n<p>InnovationM is a globally renowned\u00a0Mobile app development company in Noida\u00a0that caters to a strong &amp; secure Android app development, iOS app development, hybrid app development services. Our commitment &amp; engagement towards our target gives us brighter in the world of technology and has led us to establish success stories consecutively which makes us the best\u00a0Android app development company in Noida.<\/p>\n<p>Thanks for giving your valuable time. Keep reading and keep learning.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will learn, How to implement Geolocation in your App? Geolocation will find your current location and Geocoding gives your address (like City Name, Street Name, etc) by Coordinates (Latitude and Longitude). What is Geolocation? The most famous and familiar location feature \u2014 Geolocation is the ability to track a device using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5680,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,412],"tags":[],"class_list":["post-5642","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mobile","category-react-native"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to use Geolocation, Geocoding in React Native Apps? - InnovationM - Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use Geolocation, Geocoding in React Native Apps? - InnovationM - Blog\" \/>\n<meta property=\"og:description\" content=\"In this post, we will learn, How to implement Geolocation in your App? Geolocation will find your current location and Geocoding gives your address (like City Name, Street Name, etc) by Coordinates (Latitude and Longitude). What is Geolocation? The most famous and familiar location feature \u2014 Geolocation is the ability to track a device using [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/\" \/>\n<meta property=\"og:site_name\" content=\"InnovationM - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-27T11:39:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-14T06:23:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/11\/Geocoding.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1145\" \/>\n\t<meta property=\"og:image:height\" content=\"636\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InnovationM Admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InnovationM Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/\"},\"author\":{\"name\":\"InnovationM Admin\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"headline\":\"How to use Geolocation, Geocoding in React Native Apps?\",\"datePublished\":\"2019-11-27T11:39:46+00:00\",\"dateModified\":\"2026-01-14T06:23:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/\"},\"wordCount\":1049,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Geocoding.png\",\"articleSection\":[\"Mobile\",\"React Native\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/\",\"name\":\"How to use Geolocation, Geocoding in React Native Apps? - InnovationM - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Geocoding.png\",\"datePublished\":\"2019-11-27T11:39:46+00:00\",\"dateModified\":\"2026-01-14T06:23:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Geocoding.png\",\"contentUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Geocoding.png\",\"width\":1145,\"height\":636,\"caption\":\"Geolocation, Geocoding Blog\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/how-to-use-geolocation-geocoding-in-react-native-apps\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use Geolocation, Geocoding in React Native Apps?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\",\"name\":\"InnovationM - Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\",\"name\":\"InnovationM Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"caption\":\"InnovationM Admin\"},\"sameAs\":[\"http:\\\/\\\/www.innovationm.com\\\/\"],\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/author\\\/innovationmadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use Geolocation, Geocoding in React Native Apps? - InnovationM - Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/","og_locale":"en_US","og_type":"article","og_title":"How to use Geolocation, Geocoding in React Native Apps? - InnovationM - Blog","og_description":"In this post, we will learn, How to implement Geolocation in your App? Geolocation will find your current location and Geocoding gives your address (like City Name, Street Name, etc) by Coordinates (Latitude and Longitude). What is Geolocation? The most famous and familiar location feature \u2014 Geolocation is the ability to track a device using [&hellip;]","og_url":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/","og_site_name":"InnovationM - Blog","article_published_time":"2019-11-27T11:39:46+00:00","article_modified_time":"2026-01-14T06:23:36+00:00","og_image":[{"width":1145,"height":636,"url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/11\/Geocoding.png","type":"image\/png"}],"author":"InnovationM Admin","twitter_misc":{"Written by":"InnovationM Admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#article","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/"},"author":{"name":"InnovationM Admin","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"headline":"How to use Geolocation, Geocoding in React Native Apps?","datePublished":"2019-11-27T11:39:46+00:00","dateModified":"2026-01-14T06:23:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/"},"wordCount":1049,"commentCount":0,"image":{"@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/11\/Geocoding.png","articleSection":["Mobile","React Native"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/","url":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/","name":"How to use Geolocation, Geocoding in React Native Apps? - InnovationM - Blog","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#primaryimage"},"image":{"@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/11\/Geocoding.png","datePublished":"2019-11-27T11:39:46+00:00","dateModified":"2026-01-14T06:23:36+00:00","author":{"@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"breadcrumb":{"@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#primaryimage","url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/11\/Geocoding.png","contentUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2019\/11\/Geocoding.png","width":1145,"height":636,"caption":"Geolocation, Geocoding Blog"},{"@type":"BreadcrumbList","@id":"https:\/\/www.innovationm.com\/blog\/how-to-use-geolocation-geocoding-in-react-native-apps\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.innovationm.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use Geolocation, Geocoding in React Native Apps?"}]},{"@type":"WebSite","@id":"https:\/\/www.innovationm.com\/blog\/#website","url":"https:\/\/www.innovationm.com\/blog\/","name":"InnovationM - Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.innovationm.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed","name":"InnovationM Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","caption":"InnovationM Admin"},"sameAs":["http:\/\/www.innovationm.com\/"],"url":"https:\/\/www.innovationm.com\/blog\/author\/innovationmadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/5642","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/comments?post=5642"}],"version-history":[{"count":1,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/5642\/revisions"}],"predecessor-version":[{"id":8928,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/5642\/revisions\/8928"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media\/5680"}],"wp:attachment":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media?parent=5642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/categories?post=5642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/tags?post=5642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}