{"id":27247515,"url":"https://github.com/dev-family/react-native-device-country","last_synced_at":"2025-07-11T14:34:11.764Z","repository":{"id":41304514,"uuid":"394310854","full_name":"dev-family/react-native-device-country","owner":"dev-family","description":"Get device location by telephony (SIM card) or settings without using GPS tracker.","archived":false,"fork":false,"pushed_at":"2025-06-04T07:59:22.000Z","size":1430,"stargazers_count":75,"open_issues_count":1,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-07-04T18:45:15.855Z","etag":null,"topics":["device-location","gps","gps-location","location","phone-code","phone-location","phone-number","react-native","simcard"],"latest_commit_sha":null,"homepage":"","language":"Java","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/dev-family.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-09T13:55:55.000Z","updated_at":"2025-06-23T03:50:33.000Z","dependencies_parsed_at":"2024-06-18T19:50:58.448Z","dependency_job_id":"bcc81f78-3442-4702-8c12-382a03d3ce64","html_url":"https://github.com/dev-family/react-native-device-country","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.19999999999999996","last_synced_commit":"7a8cbd873e32620c8e0b1b63b8a288e5f03f15cb"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dev-family/react-native-device-country","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-family%2Freact-native-device-country","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-family%2Freact-native-device-country/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-family%2Freact-native-device-country/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-family%2Freact-native-device-country/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-family","download_url":"https://codeload.github.com/dev-family/react-native-device-country/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-family%2Freact-native-device-country/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264833280,"owners_count":23670617,"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","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":["device-location","gps","gps-location","location","phone-code","phone-location","phone-number","react-native","simcard"],"created_at":"2025-04-10T22:57:53.198Z","updated_at":"2025-07-11T14:34:11.756Z","avatar_url":"https://github.com/dev-family.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://dev.family/?utm_source=github\u0026utm_medium=react-native-device-country\u0026utm_campaign=readme\"\u003e\u003cimg width=\"auto\" center src=\"https://github.com/dev-family/react-native-device-country/blob/main/docs/logo.png?raw=true\" /\u003e\u003c/a\u003e\n\n# react-native-device-country\n\nGet device location settings without using GPS tracker or by telephony (SIM card) (Android only)\n\n[![npm version](https://badge.fury.io/js/react-native-device-country.svg)](https://www.npmjs.org/package/react-native-device-country)\n[![npm](https://img.shields.io/npm/dt/react-native-device-country.svg)](https://www.npmjs.org/package/react-native-device-country)\n[![MIT](https://img.shields.io/dub/l/vibe-d.svg)](https://opensource.org/licenses/MIT)\n\u003cbr\u003e\n[![Platform - Android](https://img.shields.io/badge/platform-Android-3ddc84.svg?style=flat\u0026logo=android)](https://www.android.com)\n[![Platform - iOS](https://img.shields.io/badge/platform-iOS-000.svg?style=flat\u0026logo=apple)](https://developer.apple.com/ios)\n\n💜[FOLLOW FOR RECENT NEWS](https://twitter.com/dev___family)💜\n\n\u003cp float=\"left\"\u003e\n\u003cimg width=\"400\" height=\"auto\" center src=\"https://github.com/dev-family/react-native-device-country/blob/main/docs/screenshot_ios.png?raw=true\" /\u003e\n\u003cimg width=\"400\" height=\"auto\" center src=\"https://github.com/dev-family/react-native-device-country/blob/main/docs/screenshot_android.png?raw=true\" /\u003e\n\u003c/p\u003e\n\n## Installation\n\n```sh\nyarn add react-native-device-country\n```\n\nor\n\n```sh\nnpm install react-native-device-country\n```\n\n_Don't forget to run `pod install` after that!_\n\n## Usage\n\n```js\nimport DeviceCountry from 'react-native-device-country';\n\n// ...\n\nDeviceCountry.getCountryCode()\n  .then((result) =\u003e {\n    console.log(result);\n    // {\"code\": \"BY\", \"type\": \"telephony\"}\n  })\n  .catch((e) =\u003e {\n    console.log(e);\n  });\n```\n\n### On Android you can use spicific method for getting country\n\n`TYPE_TELEPHONY` for getting country code from SIM card\n\n```js\nimport DeviceCountry, {\n  TYPE_TELEPHONY,\n  TYPE_CONFIGURATION,\n  TYPE_ANY,\n} from 'react-native-device-country';\n\nDeviceCountry.getCountryCode(TYPE_TELEPHONY)\n  .then((result) =\u003e {\n    console.log(result);\n    // {\"code\": \"PT\", \"type\": \"telephony\"}\n  })\n  .catch((e) =\u003e {\n    console.log(e);\n  });\n```\n\nor `TYPE_CONFIGURATION` for getting country code from phone language settings on Android\n\n```js\nDeviceCountry.getCountryCode(TYPE_CONFIGURATION)\n  .then((result) =\u003e {\n    console.log(result);\n    // {\"code\": \"RU\", \"type\": \"config\"}\n  })\n  .catch((e) =\u003e {\n    console.log(e);\n  });\n```\n\n`TYPE_ANY` will be used by default. It tries to use `TYPE_TELEPHONY` (on Android) and fallbacks with `TYPE_CONFIGURATION`, if device without SIM card.\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-family%2Freact-native-device-country","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-family%2Freact-native-device-country","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-family%2Freact-native-device-country/lists"}