如何在android设备上的ionic2中获取IMEI [英] How to get IMEI in ionic2 on an android device

查看:468
本文介绍了如何在android设备上的ionic2中获取IMEI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在离子2中获得一个Android设备的imei,但到目前为止还没有运气。

I am trying to obtain the imei of an android device in ionic 2, but so far no luck.

在离子1升中我刚刚使用了像cordova这样的ngCordova插件-uid https://github.com/hygieiasoft/cordova-plugin-uid

In ionic 1 l just used an ngCordova plugin like cordova-uid https://github.com/hygieiasoft/cordova-plugin-uid.

我是否可以使用离子本机的插件来获取imei,或者是否有任何其他方式来获取imei。

Is there a plugin for ionic-native that I can use to obtain the imei or is there any other way to get the imei.

推荐答案

可以使用此代码。


cordova插件添加org.hygieiasoft.cordova.uid

cordova plugin add org.hygieiasoft.cordova.uid


cordova插件添加 https://github.com/hygieiasoft/cordova -plugin-uid

对于测试用途console.log

For test use console.log

  declare var cordova: any;

  export class MyApp {

  constructor(platform: Platform ) {
    platform.ready().then(() => {
       console.log(cordova.plugins.uid.IMEI);
    });
  }

这篇关于如何在android设备上的ionic2中获取IMEI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆