Merge branch 'master' of github.com:ionic-team/ionic-native

This commit is contained in:
Ibby Hadeed 2017-09-27 17:45:49 -04:00
commit 429529a5ee
2 changed files with 76 additions and 0 deletions

View File

@ -159,6 +159,13 @@ export class QRScanner extends IonicNativePlugin {
})
enableLight(): Promise<QRScannerStatus> { return; }
/**
* Destroy the scanner instance.
* @returns {Promise<QRScannerStatus>}
*/
@Cordova()
destroy(): Promise<QRScannerStatus> { return; }
/**
* Disable the device's light.
* @return {Promise<QRScannerStatus>}

View File

@ -0,0 +1,69 @@
import { Injectable } from '@angular/core';
import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
/**
* @name Uid
* @description
* Get unique identifiers: UUID, IMEI, IMSI, ICCID and MAC.
*
* @usage
* ```typescript
* import { Uid } from '@ionic-native/uid';
* import { AndroidPermissions } from '@ionic-native/android-permissions';
*
* constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { }
*
*
* async getImei() {
* const { hasPermission } = await this.androidPermissions.checkPermission(
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
* );
*
* if (!hasPermission) {
* const result = await this.androidPermissions.requestPermission(
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
* );
*
* if (!result.hasPermission) {
* throw new Error('Permissions required');
* }
*
* // ok, a user gave us permission, we can get him identifiers after restart app
* return;
* }
*
* return this.uid.IMEI
* }
* ```
*/
@Plugin({
pluginName: 'Uid',
plugin: 'https://github.com/hygieiasoft/cordova-plugin-uid',
pluginRef: 'cordova.plugins.uid',
repo: 'https://github.com/hygieiasoft/cordova-plugin-uid',
platforms: ['Android']
})
@Injectable()
export class Uid extends IonicNativePlugin {
/** Get the device Universally Unique Identifier (UUID). */
@CordovaProperty
UUID: string;
/** Get the device International Mobile Station Equipment Identity (IMEI). */
@CordovaProperty
IMEI: string;
/** Get the device International mobile Subscriber Identity (IMSI). */
@CordovaProperty
IMSI: string;
/** Get the sim Integrated Circuit Card Identifier (ICCID). */
@CordovaProperty
ICCID: string;
/** Get the Media Access Control address (MAC). */
@CordovaProperty
MAC: string;
}