ionic cordova plugin add cordova-plugin-device
cnpm install @ionic-native/device
app.module.ts
import { Device } from '@ionic-native/device/ngx';
providers中增加Device
使用地方
import { Device } from '@ionic-native/device/ngx';
constructor(private device: Device){}
信息获取
this.uuids=this.device.uuid;
this.imei=this.device.imei;
this.model=this.device.model;
this.cordova=this.device.cordova;
this.platform=this.device.platform;
this.version=this.device.version;
this.manufacturer=this.device.manufacturer;
this.isVirtual = this.device.isVirtual;
this.serial=this.device.serial;