I need to get a unique id of both iOS and Android devices using Flutter. The reason is that I want to log in to an account in my application from only one device. When another device wants to log in, I will check whether it is the same device from my database and if it is not the same device, I will not log in. For this, I need a unique device id. How can I get it?
In my research, I found a feature called "identifierForVendor" on iOS devices, but I am not sure if this value is special for each device. I couldn’t find anything for Android
2
Answers
Maybe take a look to FCM SDK who can generate an unique token per app install.
May be you can use IMEI number to identify the device.
Use device_information package to get the IMEI or device ID
To get device information for android you need to specify and permit the phone permission in your
AndroidManifest.xml
file<uses-permission android:name="android.permission.READ_PHONE_STATE" />