The 2017 Ionic Developer Survey Results are in!

Sim

Improve this doc

Gets info from the Sim card like the carrier name, mcc, mnc and country code and other system dependent info.

Requires Cordova plugin: cordova-plugin-sim. For more info, please see the Cordova Sim docs.

Repo: https://github.com/pbakondy/cordova-plugin-sim

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-sim
    $ npm install --save @ionic-native/sim
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { Sim } from '@ionic-native/sim';


constructor(private sim: Sim) { }

...

this.sim.getSimInfo().then(
  (info) => console.log('Sim info: ', info),
  (err) => console.log('Unable to get sim info: ', err)
);

this.sim.hasReadPermission().then(
  (info) => console.log('Has permission: ', info)
);

this.sim.requestReadPermission().then(
  () => console.log('Permission granted'),
  () => console.log('Permission denied')
);

Instance Members

getSimInfo()

Returns info from the SIM card.

Returns: Promise<any>

hasReadPermission()

Platforms:Android 

Check permission

Returns: Promise<any>

requestReadPermission()

Platforms:Android 

Request permission

Returns: Promise<any>

API

Native

General