npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-sim-cards-manager

v1.0.28

Published

react-native-sim-cards-manager description

Readme

📱 react-native-sim-cards-manager

A unified library merging features from multiple SIM card management libraries:


🚀 Why use this library?

✅ Unified APIs for eSIM and SIM data management.
✅ Bug fixes and enhancements for improved stability.
✅ Simplified transition from previous libraries (requires some code adaptation).


📦 Installation

Install the package using npm:

npm install react-native-sim-cards-manager

🛠 Debugging

Android

To debug device logs during eSIM setup, use the following command:

adb logcat | grep "Euicc"

🔐 Permissions

Android

  • Minimum API Level: 22
  • Add the following permission in AndroidManifest.xml for TelephonyManager:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

For eSIM features:

  • For regular apps, follow the instructions in the carrier privileges guide.
  • For system apps, include the following permission:
<uses-permission android:name="android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS" />

More details here.

iOS

  • Minimum API Level: 12 (eSIM features)
  • Requires eSIM entitlement. Learn more here.

⚠️ Note: As of iOS 14.2, there is a known bug where an unknown result may be returned before completing eSIM setup. Details here.


📖 Usage

📲 Retrieve SIM Cards

Fetch a list of SIM cards. The result may contain no elements (if no SIM cards are detected) or multiple entries.

📌 Method: getSimCards

Handles permission requests and accepts an optional _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>) => {
    // Handle results
  })
  .catch((error) => {
    // Handle errors
  });

📌 Method: getSimCardsNative

Used internally by getSimCards. Does not handle permissions.

import SimCardsManagerModule from 'react-native-sim-cards-manager';

SimCardsManagerModule.getSimCardsNative()
  .then((array: Array<any>) => {
    // Handle results
  })
  .catch((error) => {
    // Handle errors
  });

📊 Available Data

| Field | iOS | Android | | ------------------|-----|---------| | carrierName | ✅ | ✅ | | displayName | ❌ | ✅ | | isoCountryCode | ✅ | ✅ | | mobileCountryCode | ✅ | ✅ | | mobileNetworkCode | ✅ | ✅ | | isNetworkRoaming | ❌ | ✅ | | isDataRoaming | ❌ | ✅ | | simSlotIndex | ❌ | ✅ | | phoneNumber | ❌ | ✅ | | simSerialNumber | ❌ | ✅ | | subscriptionId | ❌ | ✅ | | allowsVOIP | ✅ | ❌ |


🔍 eSIM Support Check

Verify if the device supports eSIM functionality.

import SimCardsManagerModule from 'react-native-sim-cards-manager';

SimCardsManagerModule.isEsimSupported()
  .then((isSupported: boolean) => {
    // Handle result
  })
  .catch((error) => {
    // Handle errors
  });

⚙️ eSIM Setup

Configure an eSIM using an activation code.

📌 Parameters

| Field | Mandatory | Description | |------------------|-----------|-------------| | address | N/A | Carrier network's eSIM server address. | | confirmationCode | N/A | Confirmation code for eSIM provisioning. | | eid | N/A | eUICC identifier. | | iccid | N/A | Integrated Circuit Card Identifier. | | matchingId | N/A | Matching identifier for the eSIM profile. | | oid | N/A | Object Identifier for the provisioning request. |

⚠️ Error Codes

| Code | Description | |------------------|-------------| | 0 | Feature not available. | | 1 | Device does not support cellular plans. | | 2 | OS failed to add the plan. | | 3 (iOS) | Unknown OS error. | | 3 (Android) | OS or Intent/Activity error. |

import SimCardsManagerModule from 'react-native-sim-cards-manager';

SimCardsManagerModule.setupEsim({
  confirmationCode,
  address: '',
})
  .then((isPlanAdded: boolean) => {
    // Handle success
  })
  .catch((error) => {
    // Handle errors
  });

👨‍💻 Contributing

Read the Contributing Guide for details on how to contribute to the project.


📜 License

MIT License.