Get SIM Information using Phonegap / Apache Cordova

Want create site? Find Free WordPress Themes and plugins.


This article, we’re going to see how to get sim information using Phonegap / Apache Cordova. Using this plugin we can get following information like Carrier Name, Phone Number,  sim serial and more.

Plugin used:

Step By Step Guide:

  • Create a New Project / Use your existing project
  • Add you platform
  • Add Plugin
cordova plugin add cordova-plugin-sim

Use this Code:

window.plugins.sim.getSimInfo(successCallback, errorCallback);

Get SIM Information using Phonegap / Apache Cordova Full Example Code

<!DOCTYPE html>
<html lang="en">
 <meta charset="UTF-8">
 <script type="text/javascript" src="cordova.js"></script>
 <script type="text/javascript">
 function onDeviceReady(){
 window.plugins.sim.getSimInfo(successCallback, errorCallback);
 function successCallback(result) {
function errorCallback(error) {
 <p id="simInfo"></p>




Did you find apk for android? You can find new Free Android Games and apps.
  • Udi Shitrit

    Will apple approve the app for the store if you will get sim info?

    • You need to write Privacy & policies

      • vasagan nadar

        hi i am from tirunelveli but working in mumbai , i have a doubt, can we get a gps location of others mobile without using the server ?

        • You can use geolocation plugin

          • vasagan nadar

            can i get mobile gps location of my friends mobile without using server?

            If so how to get the location

          • Yes..!, you need to write logic

          • vasagan nadar

            i am totally blank , can you please give me some suggestions???? for ex A and B both are mobiles if i on the gps location on mobile A, the lat, lon details will be stored on A device only, so with out uploading these latitude, lon to server how can i access the details from A in B

          • You can hire me as consultant

  • Eswar Kumar

    everything is coming up. except phone number. phonenumber is blank. how to get phone number??

    • Device contact may not have a mobile number

    • Swapnil Akolkar

      if you have 2 cards

      for single card
      working depends on telephone operator for some operators it returns blank.

  • Seung Cheol Choi

    Why did the error occur?
    cannot find symbol
    ContextCompat.checkSelfPermission(this.cordova.getActivity(), type));
    symbol: method checkSelfPermission(Activity,String)
    location: class ContextCompat
    ActivityCompat.requestPermissions(this.cordova.getActivity(), new String[]{type}, 12345);
    symbol: method requestPermissions(Activity,String[],int)
    location: class ActivityCompat
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details

  • abhi

    Can you tell me how to get Imei number from the modile device using phonegap

MyMail WordPress Plugin free
Save $50 USD on Ionic Firebase Chat Source CodeEXPLORE