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
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
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);
}