Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get IMEI Number in Cordova?

I am developing an application in Cordova which requires to get the IMEI number of any device programatically. Cordova Provides the UUID number but that won't work for me, I need IMEI number.

Or is there any plugin to get the IMEI Number directly?

"IMEI PhoneGap Plugin in Android" it gives custom plugin that only work for the android I need plugin which support for both android as well as ios.

"How to programmatically get the devices IMEI/ESN in Android" it gives java code for the android so how do I convert java code in angularjs?

Is there any plugin available or not? It simple as that.

like image 875
Poorav Solanki Avatar asked Mar 11 '15 13:03

Poorav Solanki


1 Answers

Simplest way to get IMEI in android device only

$ cordova plugin add https://github.com/vliesaputra/DeviceInformationPlugin.git

The above listed is cordova plugin to get device information. get method of that plugin generate a JSON In which you can see your android device’s IMEI number.

Using code:

var deviceInfo = cordova.require("cordova/plugin/DeviceInformation");
deviceInfo.get(
   function(result) {
      console.log("result = " + result);
   },function() {
      console.log("error");
});

Without using code:

  • In device’s hardware where you insert your SIM
  • In device’s Setting->About phone->Status->IMEI OR (SIM status -> IMEI)
  • Dial: *#06#

IMEI number is actually SIM card port number. so you can not access IMEI number of SIM-LESS devices. (ex.:- without SIM tablet)

like image 155
Poorav Solanki Avatar answered Sep 19 '22 09:09

Poorav Solanki