{"id":4504,"url":"https://github.com/devfd/react-native-geocoder","last_synced_at":"2025-08-04T01:32:34.957Z","repository":{"id":57337200,"uuid":"37707149","full_name":"devfd/react-native-geocoder","owner":"devfd","description":"geocoding services for react native","archived":true,"fork":false,"pushed_at":"2020-10-22T07:19:37.000Z","size":68,"stargazers_count":426,"open_issues_count":57,"forks_count":179,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-03T22:42:09.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devfd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-19T07:04:21.000Z","updated_at":"2025-06-10T16:57:27.000Z","dependencies_parsed_at":"2022-09-12T10:00:19.066Z","dependency_job_id":null,"html_url":"https://github.com/devfd/react-native-geocoder","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/devfd/react-native-geocoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfd%2Freact-native-geocoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfd%2Freact-native-geocoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfd%2Freact-native-geocoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfd%2Freact-native-geocoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devfd","download_url":"https://codeload.github.com/devfd/react-native-geocoder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfd%2Freact-native-geocoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268636403,"owners_count":24282084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:14.592Z","updated_at":"2025-08-04T01:32:34.641Z","avatar_url":"https://github.com/devfd.png","language":"JavaScript","readme":"\n\n# react-native-geocoder\n\n[![CircleCI](https://circleci.com/gh/devfd/react-native-geocoder/tree/master.svg?style=shield)](https://circleci.com/gh/devfd/react-native-geocoder/tree/master)\n\ngeocoding services for react native\n\n\n## Version table\n| Geocoder Version | RN        |\n| ------- |:----------|\n| \u003e=0.5.0   | \u003e= 0.47.0 |\n| \u003e=0.4.6   | \u003e= 0.40.0 |\n| \u003c0.4.5   | \u003c0.40.0   |\n\n\n\n## Install\n```\nnpm install --save react-native-geocoder\n```\n## iOS\n\n1. In the XCode's \"Project navigator\", right click on Libraries folder under your project ➜ `Add Files to \u003c...\u003e`\n2. Go to `node_modules` ➜ `react-native-geocoder` and add `ios/RNGeocoder.xcodeproj` file\n3. Add libRNGeocoder.a to \"Build Phases\" -\u003e \"Link Binary With Libraries\"\n\n## Android\n1. In `android/setting.gradle`\n\n```gradle\n...\ninclude ':react-native-geocoder', ':app'\nproject(':react-native-geocoder').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-geocoder/android')\n```\n\n3. In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n    ...\n    compile project(':react-native-geocoder')\n}\n```\n\n4. register module (in MainApplication.java)\n\n```java\nimport com.devfd.RNGeocoder.RNGeocoderPackage; // \u003c--- import\n\npublic class MainActivity extends ReactActivity {\n  ......\n\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n    return Arrays.\u003cReactPackage\u003easList(\n            new MainReactPackage(),\n            new RNGeocoderPackage()); // \u003c------ add this\n  }\n\n  ......\n\n}\n\n```\n\n## Usage\n```\nimport Geocoder from 'react-native-geocoder';\n\n// Position Geocoding\nvar NY = {\n  lat: 40.7809261,\n  lng: -73.9637594\n};\n\nGeocoder.geocodePosition(NY).then(res =\u003e {\n    // res is an Array of geocoding object (see below)\n})\n.catch(err =\u003e console.log(err))\n\n// Address Geocoding\nGeocoder.geocodeAddress('New York').then(res =\u003e {\n    // res is an Array of geocoding object (see below)\n})\n.catch(err =\u003e console.log(err))\n```\n\n## Fallback to google maps geocoding\n\nGeocoding services might not be included in some Android devices (Kindle, some 4.1 devices, non-google devices). For those special cases the lib can fallback to the [online google maps geocoding service](https://developers.google.com/maps/documentation/geocoding/intro#Geocoding)\n\n```js\nimport Geocoder from 'react-native-geocoder';\n// simply add your google key\nGeocoder.fallbackToGoogle(MY_KEY);\n\n// use the lib as usual\nlet ret = await Geocoder.geocodePosition({lat, lng})\n// you get the same results\n\n```\n\n## With async / await\n```\ntry {\n\n    const res = await Geocoder.geocodePosition(NY);\n    ...\n\n    const res = await Geocoder.geocodeAddress('London');\n    ...\n}\ncatch(err) {\n    console.log(err);\n}\n```\n\n## Geocoding object format\nboth iOS and Android will return the following object:\n\n```js\n{\n    position: {lat, lng},\n    formattedAddress: String, // the full address\n    feature: String | null, // ex Yosemite Park, Eiffel Tower\n    streetNumber: String | null,\n    streetName: String | null,\n    postalCode: String | null,\n    locality: String | null, // city name\n    country: String,\n    countryCode: String\n    adminArea: String | null\n    subAdminArea: String | null,\n    subLocality: String | null\n}\n```\n\n## Notes\n\n### iOS\niOS does not allow sending multiple geocoding requests simultaneously, hence if you send a second call, the first one will be cancelled.\n\n### Android\ngeocoding may not work on older android devices (4.1) and will not work if Google play services are not available.\n\n\n","funding_links":[],"categories":["Components"],"sub_categories":["Geolocation","System"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfd%2Freact-native-geocoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevfd%2Freact-native-geocoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfd%2Freact-native-geocoder/lists"}