我试图在 ionic 2 中获取 Android 设备的 IMEI,但到目前为止还没有成功。
在 ionic 1 中,我只使用了 ngCordova 插件,例如 cordova-uidhttps://github.com/hygieiasoft/cordova-plugin-uid https://github.com/hygieiasoft/cordova-plugin-uid.
是否有 ionic-native 插件可以用来获取 IMEI,或者是否有其他方法获取 IMEI。
可以使用这个代码。
cordova 插件添加 org.hygieiasoft.cordova.uid
Or
科尔多瓦插件添加https://github.com/hygieiasoft/cordova-plugin-uid https://github.com/hygieiasoft/cordova-plugin-uid
用于测试使用 console.log
declare var cordova: any;
export class MyApp {
constructor(platform: Platform ) {
platform.ready().then(() => {
console.log(cordova.plugins.uid.IMEI);
});
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)