From 10eb3eeeeb52baeee90a3944909d1fc032f47b74 Mon Sep 17 00:00:00 2001 From: Inconspicuously Date: Wed, 27 Sep 2017 23:44:38 +0200 Subject: [PATCH 1/2] feat(qr-scanner): added destroy method (#1916) (#1971) fix(qr-scanner): added destroy method (#1916) --- src/@ionic-native/plugins/qr-scanner/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/@ionic-native/plugins/qr-scanner/index.ts b/src/@ionic-native/plugins/qr-scanner/index.ts index 135df901f..da96e1ea4 100644 --- a/src/@ionic-native/plugins/qr-scanner/index.ts +++ b/src/@ionic-native/plugins/qr-scanner/index.ts @@ -159,6 +159,13 @@ export class QRScanner extends IonicNativePlugin { }) enableLight(): Promise { return; } + /** + * Destroy the scanner instance. + * @returns {Promise} + */ + @Cordova() + destroy(): Promise { return; } + /** * Disable the device's light. * @return {Promise} From e2419a26b2258683fe82287d587b7fe451461d44 Mon Sep 17 00:00:00 2001 From: Gordeev Artem Date: Thu, 28 Sep 2017 00:45:44 +0300 Subject: [PATCH 2/2] feat(uid): add UID plugin (#1946) --- src/@ionic-native/plugins/uid/index.ts | 69 ++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/@ionic-native/plugins/uid/index.ts diff --git a/src/@ionic-native/plugins/uid/index.ts b/src/@ionic-native/plugins/uid/index.ts new file mode 100644 index 000000000..aa417a832 --- /dev/null +++ b/src/@ionic-native/plugins/uid/index.ts @@ -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; + +}