How to get IMEI number in PhoneGap?

前端 未结 8 538
北海茫月
北海茫月 2020-12-03 11:30

I\'m developing a PhoneGap Android mobile application using jQuery, JavaScript and HTML. I want to get the mobile IMEI. I have tried this code from this Tutorial.

I

8条回答
  •  北海茫月
    2020-12-03 11:59

    You're pointing to PhoneGap Tutorial version 1.0.0. It is very old and it lacs a lot of information. If you, for example, read the very same page for version 2.1.0 of PhoneGap you'll notice a comment made for device.uuid Quick Example, where it is said, that device.uuid returns IMEI number only in case of Tizen platform. All other platforms, including Android, you mentioned, does return something else.

    You can't get device's IMEI in pure HTML / Javascript (application compiled through PhoneGap Build). To read it, you have to build locally, for Android platform only and include some native plugin that will do the job for you -- for example something like this one.

提交回复
热议问题