Replies: 2 comments 3 replies
-
Hi, this is a restriction by Android see: https://developer.android.com/about/versions/10/privacy/changes#non-resettable-device-ids. The solution is to use Settings.Secure.ANDROID_ID. See also: |
Beta Was this translation helpful? Give feedback.
1 reply
-
You need the READ_PRIVILEGED_PHONE_STATE permission which is not something normal apps can receive. If this app is entirely in house (including distribution) then you might be able to declare that permission and get access to the serial number. Trying to distribute through Google Play with that permission declared will yield an automatic rejection. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Cordova community,
I'm working on a Cordova 13 app targeting Android API level 34, and I previously used a custom Java interface to fetch the device's IMEI and SIM serial number like this:
However, on Android 10 and above, both of these return null, even when I include READ_PHONE_STATE in my manifest and request it at runtime.
I understand that Android has restricted access to hardware identifiers, but is there any way (even through Cordova plugins, enterprise policies, or private distribution) to still access IMEI or SIM serial numbers for valid business use cases (e.g., device tracking in enterprise apps)?
Any guidance would mean a lot, thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions