how to scan IMEI of mobile and get this number as string ionic 2
i am having the same issue please help…after using the uid.imei i am getting this error in browser but i cant get imei at all…
Code:
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;
}
client(){
//this.platform.ready().then(() =>{
//window["plugins"].imeiplugin.getImei(function (imei){
const alert = this.alertCtrl.create({
title: 'Imei Number',
subTitle: 'IMEI '+''+ this.getImei(),
buttons: ['OK']
});
alert.present();
this.navCtrl.push(ClientPage);
}
Error:
Just search for it…
Your computer browser doens’t support cordova. That means you’ll have to use that functionality on a real smartphone or virtual device.
