如何在科尔多瓦获取IMEI号码? [英] How to get IMEI Number in Cordova?
问题描述
我正在 Cordova 中开发一个应用程序,该程序需要以编程方式获取任何设备的 IMEI编号.科尔多瓦提供 UUID 号码,但对我不起作用,我需要IMEI号码.
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.
或者是否有任何插件可以直接获取IMEI号码?
Or is there any plugin to get the IMEI Number directly?
"Android中的IMEI PhoneGap插件"提供了仅适用于android的自定义插件,我需要支持android和ios的插件.
"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.
如何以编程方式在Android中获取设备IMEI/ESN",它为Android提供了Java代码,那么如何在angularjs中转换Java代码?
"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.
推荐答案
仅在 android设备中
$ cordova插件添加 https://github.com/vliesaputra/DeviceInformationPlugin.git
$ cordova plugin add https://github.com/vliesaputra/DeviceInformationPlugin.git
上面列出的是cordova插件,用于获取设备信息.获取该插件的方法 生成一个JSON,您可以在其中查看Android设备的IMEI号码.
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.
使用代码:
var deviceInfo = cordova.require("cordova/plugin/DeviceInformation");
deviceInfo.get(
function(result) {
console.log("result = " + result);
},function() {
console.log("error");
});
不使用代码:
- 在设备的硬件中插入SIM卡
- 在设备的设置"->关于手机"->状态"->"IMEI OR"(SIM卡状态-> IMEI)
- 拨号:*#06#
- In device’s hardware where you insert your SIM
- In device’s Setting->About phone->Status->IMEI OR (SIM status -> IMEI)
- Dial: *#06#
IMEI号实际上是SIM卡端口号.因此您无法访问SIMEILESS设备的IMEI号码. (例如:-没有SIM卡平板电脑)
IMEI number is actually SIM card port number. so you can not access IMEI number of SIM-LESS devices. (ex.:- without SIM tablet)
这篇关于如何在科尔多瓦获取IMEI号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!