
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-native-sim-cards-manager
Advanced tools
A new library that merge multiple sim cards libraries into a single one:
Bridges have been adapted, so you will have to adapt your code if you come from one of those libraries.
Bugs fixed and some improvements have been made.
npm install react-native-sim-cards-manager
In order to debug the device during the setup of the eSIM to obtain more detailed logs, please use the following command to filter the logs:
adb logcat | grep "Euicc"
Minimum API Level is 22
TelephonyManager require Android permission READ_PHONE_STATE:
Add in your Android Manifest:
<uses-permission
android:name="android.permission.READ_PHONE_STATE" />
To use eSIM features, for regular apps, please follow this
To use eSIM features, for system apps, add in your Android Manifest:
<uses-permission
android:name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" />
More info here
This API won't work without eSIM entitlement. You can read more about it here
Minimum API Level is 12 for eSIM methods
Note: At the moment (iOS 14.2) there might a bug in iOS SDK which returns uknown result before eSIM setup completion. More about it here
The list can be empty (no simcards detected) or one/many element(s) Two methods are availabe :
This handle the permission request and takes an optionnal rationale Parameter
import SimCardsManagerModule from 'react-native-sim-cards-manager';
SimCardsManagerModule.getSimCards({
title: 'App Permission',
message: 'Custom message',
buttonNeutral: 'Not now',
buttonNegative: 'Not OK',
buttonPositive: 'OK',
})
.then((array: Array<any>) => {
//
})
.catch((error) => {
//
});
This is the method used internally by getSimCards. It does not handle the permission request and leaves the user of this lib.
import SimCardsManagerModule from 'react-native-sim-cards-manager';
SimCardsManagerModule.getSimCardsNative()
.then((array: Array<any>) => {
//
})
.catch((error) => {
//
});
Available set of data per platform:
Platform | iOS | Android |
---|---|---|
carrierName | ✅ | ✅ |
displayName | ❌ | ✅ |
isoCountryCode | ✅ | ✅ |
mobileCountryCode | ✅ | ✅ |
mobileNetworkCode | ✅ | ✅ |
isNetworkRoaming | ❌ | ✅ |
isDataRoaming | ❌ | ✅ |
simSlotIndex | ❌ | ✅ |
phoneNumber | ❌ | ✅ |
simSerialNumber | ❌ | ✅ |
subscriptionId | ❌ | ✅ |
allowsVOIP | ✅ | ❌ |
Return true/false is the device support eSim feature
import SimCardsManagerModule from 'react-native-sim-cards-manager';
SimCardsManagerModule.isEsimSupported()
.then((isSupported: boolean) => {
//
})
.catch((error) => {
//
});
Entry parameters for the bridge:
Entry parameters | Mandatory | Description |
---|---|---|
address | N/A | The address of the carrier network’s eSIM server |
confirmationCode | N/A | The provisioning request’s confirmation code, provided by the network operator when initiating an eSIM download |
eid | N/A | The provisioning request’s eUICC identifier |
iccid | N/A | The provisioning request’s Integrated Circuit Card Identifier |
matchingId | N/A | The provisioning request’s matching identifier |
oid | N/A | The provisioning request’s Object Identifier |
Error code that can be returned by the bridge:
Error code | Description |
---|---|
0 | Feature not available for that OS / device |
1 | The device doesn't support a cellular plan |
2 | The OS failed to add the new plan |
3 (iOS) | The OS has returned an unknow error |
3 (Android) | The OS has returned an error or something goes wrong with the Intent/Activity |
import SimCardsManagerModule from 'react-native-sim-cards-manager';
SimCardsManagerModule.setupEsim({
confirmationCode,
address: '',
})
.then((isPlanAdded: boolean) => {
//
})
.catch((error) => {
//
});
sendPhoneCall
with phone number and sim slot indexSee the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
react-native-sim-cards-manager description
We found that react-native-sim-cards-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.