How to scan IMEI of mobile and get this number as string ionic 2


#1

how to scan IMEI of mobile and get this number as string ionic 2


#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:


#3

Just search for it…


#4

Your computer browser doens’t support cordova. That means you’ll have to use that functionality on a real smartphone or virtual device.