Skip to content

Commit

Permalink
feat(sim): Add sim plugin (#317)
Browse files Browse the repository at this point in the history
* Add sim plugin

* Fix pluginRef
  • Loading branch information
biesbjerg authored and ihadeed committed Jul 17, 2016
1 parent 8bd906c commit 4f85110
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import {Printer} from './plugins/printer';
import {Push} from './plugins/push';
import {SafariViewController} from './plugins/safari-view-controller';
import {Screenshot} from './plugins/screenshot';
import {Sim} from './plugins/sim';
import {SMS} from './plugins/sms';
import {SocialSharing} from './plugins/socialsharing';
import {SpinnerDialog} from './plugins/spinnerdialog';
Expand Down Expand Up @@ -138,6 +139,7 @@ export {
PinDialog,
Screenshot,
SocialSharing,
Sim,
Splashscreen,
SQLite,
StatusBar,
Expand Down Expand Up @@ -207,6 +209,7 @@ window['IonicNative'] = {
PinDialog: PinDialog,
SafariViewController: SafariViewController,
Screenshot: Screenshot,
Sim: Sim,
SMS: SMS,
SocialSharing: SocialSharing,
SpinnerDialog: SpinnerDialog,
Expand Down
35 changes: 35 additions & 0 deletions src/plugins/sim.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {Plugin, Cordova} from './plugin';

/**
* @name Sim
* @description
* 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](https://github.com/pbakondy/cordova-plugin-sim).
*
* @usage
* ```js
* import {Sim} from 'ionic-native';
*
*
* Sim.getSimInfo().then(
* (info) => console.log('Sim info:', info),
* (err) => console.log('Unable to get sim info:', err)
* );
* ```
*/
@Plugin({
plugin: 'cordova-plugin-sim',
pluginRef: 'plugins.sim',
repo: 'https://github.com/pbakondy/cordova-plugin-sim',
platforms: ['Android', 'iOS', 'Windows Phone']
})
export class Sim {
/**
* Returns info from the SIM card.
* @returns {Promise}
*/
@Cordova()
static getSimInfo(): Promise<any> { return; }

}

0 comments on commit 4f85110

Please sign in to comment.