Reputation: 147
I am building a mobile application and want to access the IMEI number.
I have gone through the following plugins.
And all of them are giving me 404 error.
Finally I got one plugin that I could install
and below is the code I wrote to access the IMEI
The below code is written inside my home constructor.
platform.ready().then(() => {
window["plugins"].imeiplugin.getImei(function (imei) {
console.log(imei);
});
});
But the control never goes to the console.log();
Am I doing anything wrong here??
Or if anyone has integrated the IMEI number with some other method please let me know.
Or as per suggested in the below link do I have to build my own custom plugin??
I am stuck here and I am looking for an efficient way any help is appreciated.
Thanks in advance
Upvotes: 1
Views: 3112
Reputation: 1024
Actually this plugin works: https://github.com/hygieiasoft/cordova-plugin-uid
(Using: cordova plugin add org.hygieiasoft.cordova.uid returns 404)
So try this instead:
cordova plugin add https://github.com/hygieiasoft/cordova-plugin-uid
platform.ready().then(() => {
alert(cordova.plugins.uid.IMEI);
});
Upvotes: 5