How to get the IMEI code of a mobile phone in ionic3?

how to get the IMEI code of a mobile phone in ionic3?
I see that the official document has an @ ionic-native/uid component that can be obtained, but there is a problem. You can"t get it when you enter app for the first time after installing app, but you can only get it the second time. Is there any way to get

for the first time?

my code

Apr.01,2022

you got imei before applying for permission, so you have already applied for permission to get it the second time you joined app (you can't get it before you can apply for permission for the first time)
you need to get IMEI code
https://ionicframework.com/do...

after you successfully apply for permission. < hr >

read ionic's document that you need to restart app before you can get imei, and I don't know if it's the restriction of Android itself.
then you can only put the function of obtaining IMEI code into the app entry, and restart app after applying for permission

.
Menu