Thursday, 23 November 2017


cordova provide the plugin to get information from the SIM card like the carrier name, mcc, mnc and country code and other system dependent additional info.

You can install Cordova SIM plugin using below command
cordova plugin add cordova-plugin-sim

If you don’t want to use Cordova SIM plugin, you can remove this plugin from the project by using below command
cordova plugin remove cordova-plugin-sim


function onDeviceReady() {
    window.plugins.sim.getSimInfo(successCallback, errorCallback);

function successCallback(result) {

function errorCallback(error) {

// Android only: check permission
function hasReadPermission() {
    window.plugins.sim.hasReadPermission(successCallback, errorCallback);

// Android only: request permission
function requestReadPermission() {
    window.plugins.sim.requestReadPermission(successCallback, errorCallback);


The plugin returns a JSON object


Return object details

Json ValueTypeDescription
carrierName {String} Service Provider Name (SPN)
countryCode {String} ISO country code equivalent for the SIM provider's country code
mcc {String} MCC (mobile country code) of the provider of the SIM
mnc {String} MNC (mobile network code) of the provider of the SIM
callState{Number} call state (cellular) on the device List of Call State values and Descrition
dataActivity {Number} type of activity on a data connection (cellular) List of Data Activity values and Descriptions
networkType {Number} the NETWORK_TYPE_xxxx for current data connection List of Network Type values and Descriptions
phoneType {Number} device phone type. This indicates the type of radio used to transmit voice calls List of Phone Type Values and Descriptions
simState {Number} the state of the device SIM card List of SIM State Values and Descriptions
isNetworkRoaming {Boolean} true if the device is considered roaming on the current network, for GSM purposes
phoneCount {Number} the number of phones available. Returns 0 if none of voice, sms, data is not supported. Returns 1 for Single standby mode (Single SIM functionality). Returns 2 for Dual standby mode (Dual SIM functionality)
activeSubscriptionInfoCount {Number} [READ_PHONE_STATE] the current number of active subscriptions
activeSubscriptionInfoCountMax {Number} [READ_PHONE_STATE] the maximum number of active subscriptions
phoneNumber {String} [READ_PHONE_STATE] - phone number string for line 1, for example, the MSISDN for a GSM phone 1
deviceId {String} [READ_PHONE_STATE] the unique device ID, for example, the IMEI for GSM and the MEID or ESN for CDMA phones
deviceSoftwareVersion {String} [READ_PHONE_STATE] the software version number for the device, for example, the IMEI/SV for GSM phones
simSerialNumber {String} [READ_PHONE_STATE] the serial number of the SIM, if applicable
subscriberId {String} [READ_PHONE_STATE] the unique subscriber ID, for example, the IMSI for a GSM phone
cards {Array} [READ_PHONE_STATE] List of SIM cards
carrierName {String} the name displayed to the user that identifies Subscription provider name
displayName {String} the name displayed to the user that identifies this subscription
countryCode {String} the ISO country code
mcc {String} MCC (mobile country code) of the provider of the SIM
mnc {String} MNC (mobile network code) of the provider of the SIM
isNetworkRoaming {Boolean} Returns true if the device is considered roaming on the current network for a subscription
isDataRoaming {Boolean} the data roaming state for this subscription
simSlotIndex {Number} the slot index of this Subscription's SIM card
phoneNumber {String} the number of this subscription
deviceId {String} the unique device ID of a subscription, for example, the IMEI for GSM and the MEID for CDMA phones
simSerialNumber {String} ICC ID
subscriptionId {String} Subscription Identifier, this is a device unique number

Complete Example of cordova-plugin-device


<div class="item">
        <h2 style="text-align:center">SIM Information</h2>
    <div class="item" style="width:100%">
        <p id="SIMInformation" class="item-note" ></p>
        <p id="SIMInfo" class="item-note"></p>

var app = {
    // Application Constructor
    initialize: function () {
        document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);

    // deviceready Event Handler
    // Bind any cordova events here. Common events are:
    // 'pause', 'resume', etc.
    onDeviceReady: function () {

    // Update DOM on a Received Event
    receivedEvent: function (id) {
        var parentElement = document.getElementById(id);
        var listeningElement = parentElement.querySelector('.listening');
        var receivedElement = parentElement.querySelector('.received');

        listeningElement.setAttribute('style', 'display:none;');
        receivedElement.setAttribute('style', 'display:none;');

        console.log('Received Event: ' + id);
function simInfosuccessCallback(result) {
    var element = document.getElementById('SIMInformation');
    if (result !== undefined && result != null && result != '') {
        var tblHmlt = '<h3>Sim basic Information </h3><table style="width:100%"><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';
        tblHmlt += '<tr><td>carrierName</td><td> ' + result.carrierName + '</td></tr>' +
                 '<tr><td>countryCode</td><td> ' + result.countryCode + '</td></tr>' +
                 '<tr><td>mcc</td><td> ' + result.mcc + '</td></tr>' +
                 '<tr><td>mnc</td><td>' + result.mnc + '</td></tr>' +
                 '<tr><td>callState</td><td> ' + result.callState + '</td></tr>' +
                 '<tr><td>dataActivity</td><td> ' + result.dataActivity + '</td></tr>' +
                 '<tr><td>networkType</td><td> ' + result.networkType + '</td></tr>' +
                 '<tr><td>phoneType</td><td> ' + result.phoneType + '</td></tr>' +
                 '<tr><td>simState</td><td> ' + result.simState + '</td></tr>' +
                 '<tr><td>isNetworkRoaming</td><td> ' + result.isNetworkRoaming + '</td></tr>' +
                 '<tr><td>phoneCount</td><td> ' + result.phoneCount + '</td></tr>' +
                 '<tr><td>activeSubscriptionInfoCount</td><td> ' + result.activeSubscriptionInfoCount + '</td></tr>' +
                 '<tr><td>activeSubInfoCountMax</td><td>' + result.activeSubscriptionInfoCountMax + '</td></tr>' +
                 '<tr><td>phoneNumber</td><td> ' + result.phoneNumber + '</td></tr>' +
                 '<tr><td>deviceId</td><td> ' + result.deviceId + '</td></tr>' +
                 '<tr><td>deviceSoftwareVersion</td><td> ' + result.deviceSoftwareVersion + '</td></tr>' +
                 '<tr><td>simSerialNumber</td><td> ' + result.simSerialNumber + '</td></tr>' +
                 '<tr><td>subscriberId</td><td> ' + result.subscriberId + '</td></tr>' +

        element.innerHTML = tblHmlt;

    var elementSimInfo = document.getElementById('SIMInfo');
    if ( > 0 && result.phoneCount > 1) {
        var innerHtml = '';
        var totalSim = 1;
        for (var i = 0; i <; i++) {

            var tblHmlt = '<h3>Sim ' + totalSim + ' Information </h3>' + '<br /><table style="width:100%"><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';

            tblHmlt += '<tr><td>carrierName</td><td>' +[i].carrierName + '</td></tr>' +
                                   '<tr><td>displayName</td><td>' +[i].displayName + '</td></tr>' +
                                   '<tr><td>countryCode</td><td>' +[i].countryCode + '</td></tr>' +
                                   '<tr><td>mcc</td><td>' +[i].mcc + '</td></tr>' +
                                   '<tr><td>mnc</td><td>' +[i].mnc + '</td></tr>' +
                                   '<tr><td>isNetworkRoaming</td><td>' +[i].isNetworkRoaming + '</td></tr>' +
                                   '<tr><td>isDataRoaming</td><td>' +[i].isDataRoaming + '</td></tr>' +
                                   '<tr><td>simSlotIndex</td><td>' +[i].simSlotIndex + '</td></tr>' +
                                   '<tr><td>phoneNumber</td><td>' +[i].phoneNumber + '</td></tr>' +
                                   '<tr><td>deviceId</td><td>' +[i].deviceId + '</td></tr>' +
                                   '<tr><td>simSerialNumber</td><td>' +[i].simSerialNumber + '</td></tr>' +
                                   '<tr><td>subscriptionId</td><td>' +[i].subscriptionId + '</td></tr>' +
            innerHtml += tblHmlt
        elementSimInfo.innerHTML = innerHtml;

function HasPerminionSuccessCallback(result) {

    if (result) {
        window.plugins.sim.getSimInfo(simInfosuccessCallback, errorCallback);
    } else {

function errorCallback(error) {

    var elementSimInfo = document.getElementById('ErrorInfo');
    elementSimInfo.innerHTML = error;

function requestSuccessCallback(result) {
    if (result) {
// Android only: check permission
function hasReadPermission() {
    window.plugins.sim.hasReadPermission(HasPerminionSuccessCallback, errorCallback);

// Android only: request permission
function requestReadPermission() {
    window.plugins.sim.requestReadPermission(requestSuccessCallback, errorCallback);


Fisrt sreen will be show to allow to give the permission to acees the sim info. 


  1. For some cause the picture just isn’t loading appropriately, is at this time there an issue? ipad template

  2. I simply wanted to thank you a lot more for your amazing website you have developed here. It can be full of useful tips for those who are actually interested in this specific subject, primarily this very post. Your all so sweet in addition to thoughtful of others and reading the blog posts is a great delight in my opinion. And thats a generous present! Dan and I usually have enjoyment making use of your recommendations in what we need to do in the near future. Our checklist is a distance long and tips will certainly be put to excellent use. ipad sketch

  3. A person essentially help to make seriously articles I would state. This is the first time I frequented your website page and thus far? I surprised with the research you made to make this particular publish incredible. Fantastic job! apple tablet mockup

  4. Kinds of Engines vacation packages ‘re affordable, of benefit nevertheless, you pick up every single single single ability required by specific bargain. Search Engine Optimization apple desktop mockup

  5. This is such a great resource that you’re offering and you provide out at no cost. I appreciate seeing sites that realize the worth of offering a perfect useful resource totally free. I genuinely loved reading your submit. android mockups

  6. Immigration… [...]the time to read or visit the content or sites we have linked to below the[...]… android mock up

  7. awesome issues here. I’m very satisfied to peer your post. Thanks a lot and i am having a look forward to touch you. Will you kindly drop me a e-mail? app store mockup

  8. I thought it was going to be some boring old publish, but it really compensated for my time. I will publish a link to this page on my blog. I am confident my visitors will discover that quite useful app screenshot

  9. I likewise conceive thus, perfectly written post! . imac mockup png

  10. And Im running from a standard users account with strict limitations, which I think may be the limiting factor, but Im running the cmd as the system I am currently working on. apple watch mockup psd

  11. I think this is among the most vital info for me. And i’m satisfied studying your article. However should commentary on few normal things, The website taste is ideal, the articles is in reality excellent . Excellent activity, cheers. frontend services

  12. Very informative and great complex body part of articles , now that’s user pleasant (:. front end service

  13. This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. It's a GPL Plugins selling website

  14. I’m not sure where you’re getting your info, but great topic. I needs to spend some time learning much more or understanding more. los angeles web agency

  15. ive begun to visit this cool site a couple of times now and i have to tell you that i find it quite nice actually. itll be nice to read more in the future! =p web design agencies los angeles

  16. I really got into this article. I found it to be interesting and loaded with unique points of interest. I like to read material that makes me think. Thank you for writing this great content. web design agency

  17. I would like to say that this blog really convinced me to do it! Thanks, very good post. encrypted sim card

  18. There are many dissertation internet sites on-line after you uncover unsurprisingly identified in your website page. MVNO platform

  19. That's the reason center on it's essential to precise ground moves well before writing. Might be attainable so that you can extra advisable text that way. LESCO Online Bill

  20. I learn some new stuff from it too, thanks for sharing your information. SEO Service Provider


Note: only a member of this blog may post a comment.