
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
react-native-carrier-info
Advanced tools
React Native module bridge to obtain information about the user’s home cellular service provider.
React Native module bridge to obtain information about the user’s home cellular service provider.
Makes use of the following native classes:
All APIs are async functions
boolean allowsVOIP() - Indicates if the carrier allows VoIP calls to be made on its network.
true
on Android.string carrierName() - The name of the user’s home cellular service provider.
string isoCountryCode() - The ISO country code for the user’s cellular service provider.
string mobileCountryCode() - The mobile country code (MCC) for the user’s cellular service provider.
string mobileNetworkCode() - The mobile network code (MNC) for the user’s cellular service provider.
string mobileNetworkOperator() - return MCC + MNC, e.g 46697
npm install react-native-carrier-info --save
Libraries
➜ Add Files to [your project's name]
node_modules/react-native-carrier-info/ios
and add RNCarrierInfo.xcodeproj
libRNCarrierInfo.a
to your project's Build Phases
➜ Link Binary With Libraries
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
.Cmd+R
)
dependencies {
...
compile project(':react-native-carrier-info') <-- add this
...
}
include ':react-native-carrier-info'
project(':react-native-carrier-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-carrier-info/android')
...
import com.ianlin.RNCarrierInfo.RNCarrierInfoPackage; <-- add this
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
...
new RNCarrierInfoPackage(), <-- add this
...
);
}
import CarrierInfo from 'react-native-carrier-info';
// inside your code where you would like to retrieve carrier info
CarrierInfo.allowsVOIP()
.then((result) => {
Alert.alert('Allows VoIP', JSON.stringify(result));
});
CarrierInfo.carrierName()
.then((result) => {
Alert.alert('Carrier Name', result);
});
CarrierInfo.isoCountryCode()
.then((result) => {
Alert.alert('ISO', result);
});
CarrierInfo.mobileCountryCode()
.then((result) => {
Alert.alert('MCC', result);
});
CarrierInfo.mobileNetworkCode()
.then((result) => {
Alert.alert('MNC', result);
});
CarrierInfo.mobileNetworkOperator()
.then((result) => {
Alert.alert('MCC + MNC', result);
});
There 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.
ISC License (functionality equivalent to MIT License)
FAQs
React Native module bridge to obtain information about the user’s home cellular service provider.
The npm package react-native-carrier-info receives a total of 1,444 weekly downloads. As such, react-native-carrier-info popularity was classified as popular.
We found that react-native-carrier-info demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.