How to get IMEI number in nativescript


#1

Hi, I want to get IMEI number of the device. How can I get IMEI number in nativescript?

I’ve found a snippet here
Get IMEI number

But I’m facing this error.

System.err: Error: java.lang.SecurityException: getDeviceId: Neither user 10338 nor current process has android.permission.READ_PHONE_STATE.
System.err:     android.os.Parcel.readException(Parcel.java:1683)
System.err:     android.os.Parcel.readException(Parcel.java:1636)
System.err:     com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:4275)
System.err:     android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:804)
System.err:     com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     com.tns.Runtime.callJSMethod(Runtime.java:933)

It would be great if someone helps me on this.


#2

Try this plugin,