mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 00:51:07 +08:00
parent
859cbfcfc6
commit
a81a4d3edf
@ -13,12 +13,12 @@ import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
*
|
*
|
||||||
* constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { }
|
* constructor(private uid: Uid, private androidPermissions: AndroidPermissions) { }
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* async getImei() {
|
* async getImei() {
|
||||||
* const { hasPermission } = await this.androidPermissions.checkPermission(
|
* const { hasPermission } = await this.androidPermissions.checkPermission(
|
||||||
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* if (!hasPermission) {
|
* if (!hasPermission) {
|
||||||
* const result = await this.androidPermissions.requestPermission(
|
* const result = await this.androidPermissions.requestPermission(
|
||||||
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
* this.androidPermissions.PERMISSION.READ_PHONE_STATE
|
||||||
@ -27,11 +27,11 @@ import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
* if (!result.hasPermission) {
|
* if (!result.hasPermission) {
|
||||||
* throw new Error('Permissions required');
|
* throw new Error('Permissions required');
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* // ok, a user gave us permission, we can get him identifiers after restart app
|
* // ok, a user gave us permission, we can get him identifiers after restart app
|
||||||
* return;
|
* return;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* return this.uid.IMEI
|
* return this.uid.IMEI
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
@ -40,30 +40,23 @@ import { Plugin, CordovaProperty, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
pluginName: 'Uid',
|
pluginName: 'Uid',
|
||||||
plugin: 'cordova-plugin-uid',
|
plugin: 'cordova-plugin-uid',
|
||||||
pluginRef: 'cordova.plugins.uid',
|
pluginRef: 'cordova.plugins.uid',
|
||||||
repo: 'https://github.com/hygieiasoft/cordova-plugin-uid',
|
repo: 'https://github.com/lionelhe/cordova-plugin-uid',
|
||||||
platforms: ['Android']
|
platforms: ['Android']
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Uid extends IonicNativePlugin {
|
export class Uid extends IonicNativePlugin {
|
||||||
|
|
||||||
/** Get the device Universally Unique Identifier (UUID). */
|
/** Get the device Universally Unique Identifier (UUID). */
|
||||||
@CordovaProperty
|
@CordovaProperty UUID: string;
|
||||||
UUID: string;
|
|
||||||
|
|
||||||
/** Get the device International Mobile Station Equipment Identity (IMEI). */
|
/** Get the device International Mobile Station Equipment Identity (IMEI). */
|
||||||
@CordovaProperty
|
@CordovaProperty IMEI: string;
|
||||||
IMEI: string;
|
|
||||||
|
|
||||||
/** Get the device International mobile Subscriber Identity (IMSI). */
|
/** Get the device International mobile Subscriber Identity (IMSI). */
|
||||||
@CordovaProperty
|
@CordovaProperty IMSI: string;
|
||||||
IMSI: string;
|
|
||||||
|
|
||||||
/** Get the sim Integrated Circuit Card Identifier (ICCID). */
|
/** Get the sim Integrated Circuit Card Identifier (ICCID). */
|
||||||
@CordovaProperty
|
@CordovaProperty ICCID: string;
|
||||||
ICCID: string;
|
|
||||||
|
|
||||||
/** Get the Media Access Control address (MAC). */
|
/** Get the Media Access Control address (MAC). */
|
||||||
@CordovaProperty
|
@CordovaProperty MAC: string;
|
||||||
MAC: string;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user