{"id":4605,"url":"https://github.com/react-native-webrtc/react-native-carrier-info","last_synced_at":"2026-03-17T21:35:09.647Z","repository":{"id":31776369,"uuid":"35342719","full_name":"react-native-webrtc/react-native-carrier-info","owner":"react-native-webrtc","description":"React Native module bridge to obtain information about the user’s home cellular service provider,","archived":false,"fork":false,"pushed_at":"2025-04-30T16:16:41.000Z","size":51,"stargazers_count":88,"open_issues_count":4,"forks_count":37,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-03T15:25:15.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/react-native-webrtc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-05-09T19:48:03.000Z","updated_at":"2025-07-21T01:12:23.000Z","dependencies_parsed_at":"2024-04-25T03:43:17.220Z","dependency_job_id":"45e13994-2396-4a7b-b6bd-665723196d04","html_url":"https://github.com/react-native-webrtc/react-native-carrier-info","commit_stats":{"total_commits":24,"total_committers":12,"mean_commits":2.0,"dds":0.7083333333333333,"last_synced_commit":"83aaf5c3b21a5d40d284dd9c3fbd1dc6048822de"},"previous_names":["anarchicknight/react-native-carrier-info"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/react-native-webrtc/react-native-carrier-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-webrtc%2Freact-native-carrier-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-webrtc%2Freact-native-carrier-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-webrtc%2Freact-native-carrier-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-webrtc%2Freact-native-carrier-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-native-webrtc","download_url":"https://codeload.github.com/react-native-webrtc/react-native-carrier-info/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-webrtc%2Freact-native-carrier-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30632032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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:17.685Z","updated_at":"2026-03-17T21:35:09.616Z","avatar_url":"https://github.com/react-native-webrtc.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["System"],"readme":"# React Native Carrier Info\n\n[![npm version](https://badge.fury.io/js/react-native-carrier-info.svg)](https://badge.fury.io/js/react-native-carrier-info)\n[![npm downloads](https://img.shields.io/npm/dm/react-native-carrier-info.svg?maxAge=2592000)](https://img.shields.io/npm/dm/react-native-carrier-info.svg?maxAge=2592000)\n\nReact Native module bridge to obtain information about the user’s home cellular service provider.\n\nMakes use of the following native classes:\n\n- iOS\n  - [CTTelephonyNetworkInfo](https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Reference/CTTelephonyNetworkInfo/index.html#//apple_ref/occ/cl/CTTelephonyNetworkInfo)\n  - [CTCarrier](https://developer.apple.com/library/prerelease/ios/documentation/NetworkingInternet/Reference/CTCarrier/index.html#//apple_ref/doc/c_ref/CTCarrier)\n- Android\n  - [TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager.html)\n\n## Version\n\n### 1.0.0\n\n- Android support\n- Promosify all APIs\n- RN 0.47 support\n\n## API\n\n**All APIs are async functions**\n\n### allowsVOIP (iOS only)\n\n```javascript\nboolean allowsVOIP() - Indicates if the carrier allows VoIP calls to be made on its network.\n```\n\n- If you configure a device for a carrier and then remove the SIM card, this property retains the Boolean value indicating the carrier’s policy regarding VoIP.\n- Always return `true` on Android.\n\n### carrierName\n\n```js\nstring carrierName() - The name of the user’s home cellular service provider.\n```\n\n- This string is provided by the carrier and formatted for presentation to the user. The value does not change if the user is roaming; it always represents the provider with whom the user has an account.\n- If you configure a device for a carrier and then remove the SIM card, this property retains the name of the carrier.\n- The value for this property is 'nil' if the device was never configured for a carrier.\n\n### isoCountryCode\n\n```js\nstring isoCountryCode() - The ISO country code for the user’s cellular service provider.\n```\n\n- This property uses the ISO 3166-1 country code representation.\n- The value for this property is 'nil' if any of the following apply:\n  - The device is in Airplane mode.\n  - There is no SIM card in the device.\n  - The device is outside of cellular service range.\n\n### mobileCountryCode\n\n```js\nstring mobileCountryCode() - The mobile country code (MCC) for the user’s cellular service provider.\n```\n\n- MCCs are defined by ITU-T Recommendation E.212, “List of Mobile Country or Geographical Area Codes.”\n- The value for this property is 'nil' if any of the following apply:\n  - There is no SIM card in the device.\n  - The device is outside of cellular service range.\n- The value may be 'nil' on hardware prior to iPhone 4S when in Airplane mode.\n\n### mobileNetworkCode\n\n```js\nstring mobileNetworkCode() - The mobile network code (MNC) for the user’s cellular service provider.\n```\n\n- The value for this property is 'nil' if any of the following apply:\n  - There is no SIM card in the device.\n  - The device is outside of cellular service range.\n- The value may be 'nil' on hardware prior to iPhone 4S when in Airplane mode.\n\n### mobileNetworkOperator\n\n```js\nstring mobileNetworkOperator() - return MCC + MNC, e.g 46697\n```\n\n## Getting Started (and running the demo project)\n\n### iOS\n\n1. From inside your project run `npm install react-native-carrier-info --save`\n2. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n3. Go to `node_modules/react-native-carrier-info/ios` and add `RNCarrierInfo.xcodeproj`\n4. In XCode, in the project navigator, select your project. Add `libRNCarrierInfo.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n5. Click `RNCarrierInfo.xcodeproj` in the project navigator and go the `Build Settings` tab. Make sure 'All' is toggled on (instead of 'Basic'). Look for `Header Search Paths` and make sure it contains both `$(SRCROOT)/../react-native/React` and `$(SRCROOT)/../../React` - mark both as `recursive`.\n6. Set up the project to run on your device (iOS simulator does not report cellular provider info)\n7. Run your project (`Cmd+R`)\n\n### Android\n\n- **app/build.gradle**\n\n```gradle\n\ndependencies {\n  ...\n  compile project(':react-native-carrier-info') \u003c-- add this\n  ...\n\n}\n\n```\n\n- **settings.gradle**\n\n```gradle\n\ninclude ':react-native-carrier-info'\nproject(':react-native-carrier-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-carrier-info/android')\n\n```\n\n- **MainApplication.java**\n\n```gradle\n\n...\nimport com.ianlin.RNCarrierInfo.RNCarrierInfoPackage; \u003c-- add this\n...\n\n@Override\nprotected List\u003cReactPackage\u003e getPackages() {\n  return Arrays.\u003cReactPackage\u003easList(\n    new MainReactPackage(),\n    ...\n    new RNCarrierInfoPackage(), \u003c-- add this\n    ...\n  );\n}\n\n```\n\n## Usage Example\n\n```js\n\nimport CarrierInfo from 'react-native-carrier-info';\n\n// inside your code where you would like to retrieve carrier info\nCarrierInfo.allowsVOIP()\n.then((result) =\u003e {\n  Alert.alert('Allows VoIP', JSON.stringify(result));\n});\n\nCarrierInfo.carrierName()\n.then((result) =\u003e {\n  Alert.alert('Carrier Name', result);\n});\n\nCarrierInfo.isoCountryCode()\n.then((result) =\u003e {\n  Alert.alert('ISO', result);\n});\n\nCarrierInfo.mobileCountryCode()\n.then((result) =\u003e {\n  Alert.alert('MCC', result);\n});\n\nCarrierInfo.mobileNetworkCode()\n.then((result) =\u003e {\n  Alert.alert('MNC', result);\n});\n\nCarrierInfo.mobileNetworkOperator()\n.then((result) =\u003e {\n  Alert.alert('MCC + MNC', result);\n});\n\n```\n\nThere is an example project supplied with the repo in the RNCarrierInfoDemo folder. The sample app needs to be run on a device as the simulator does not report cellular provider info.\n\n## Original Author:\n\n[![anarchicknight](https://avatars1.githubusercontent.com/u/11375227?s=48)](https://github.com/anarchicknight)\n\n## License\n\n[ISC License](https://opensource.org/licenses/ISC) (functionality equivalent to **MIT License**)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-webrtc%2Freact-native-carrier-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-native-webrtc%2Freact-native-carrier-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-webrtc%2Freact-native-carrier-info/lists"}