Get IMEI using ionic 2

0

I'm now starting to use ionic, and I would like to know how to get the device number using ionic 2.

I tried this , but I did not understand how to install the plugin

    
asked by anonymous 07.04.2017 / 22:48

1 answer

0

Ionic gives you access to some information on the device it runs on, for example: device model, operating system version, serial number, and uuid.

In the terminal, inside the project folder, you need to execute the following commands:

ionic cordova plugin add cordova-plugin-device
npm install --save @ionic-native/device

In your .ts file, use this:

import { Device } from '@ionic-native/device';

constructor(private device: Device) {}

getImei(){ 
   console.log(this.device.uuid);
}
    
17.10.2017 / 21:26