Identify device by using an unique identifier flutter / android
You can use the library below in order to find the device's unique ID:
Also this is a duplicate question, so please take care next time to search for the answer prior to asking a question. :)
Lastly, I am not entirely sure of the scope of your project but if you saving user data, sensitive or not on Firebase, logging people in with the devices UID's could be problematic for example in the situation of the user losing their phone they would not be able to recover their lost data. Like I said I'm not sure the scope of your project but just something to think about.
Please let me know if you need any further help!
Crate
Updated on December 25, 2022Comments
-
Crate over 1 year
My use case is I want to uniquely identify my users devices as I want to provide them subscription and dont want to use any type of login instead use an unique identifier that I can save it on my backend so even if user uninstall or reinstall my app, still be able to access content. Also I've had tried to use androidId (SSAID) but it can change on app signin change or device reset. I am using firebase as backend and flutter on front end.
-
Crate over 3 yearsHey thanks for your quick response but as I mentioned I've already tried using this device_info (SSAID) but it changed 2 3 new builds so I cannot use this further, secondly I'm not using users sensitive information so user do not need to worry about it, if you can suggest any other ways to achieve this let me know
-
MattTheXPat over 3 yearsPlease check out the duplicate question I put in my answer as there are a few others ways and libraries of doing it. I am also just curious as to why you even have a database on the cloud if you are not concerned whether the users data is lost or not, why not use a local database?
-
Crate over 3 yearsDidn't seem to find your answer, can you please refer it here and I'm using firebase because I'm providing access to premium content in my app as the user purchases the plan, the plan amount, content all are fetched from db as well as I'm using it for push notification
-
Crate over 3 yearsAnd I'm wondering I had a build of my app 3 months ago and it's giving me different ssaid as compared to the build I made yesterday and fun fact I didnt even reset my phone also and tried checking from my friend's device got the same result as mine (showing different ssaid)
-
MattTheXPat over 3 yearsI reviewed the answer I was looking at and it seems that the library is discontinued so maybe try this library as well as look at dart packages.I would suggest from what I can see using the devices UID's without a backups such a email and password sign in is rather risky and assuming you are storing the UID's in the database directly a hacker could potentially steal all of those UID's unless salted and its possible to get other users device ID's. Look, go with what you think is right, but thats just my view.
-
Crate over 3 yearsyes I've taken email and attached to every uuid but if I roll out an update the new build, the uuid is not similar as previous one as it should be, so I've to ask the user for there email to give them access also cannot use this uuid as it will change after new releases.
-
Crate over 3 yearsDoes it change overtime or when device reset? Also does it change in lifetime ? or is it doesnot change
-
Khalil LAABOUDI over 3 yearsNo, IMEI number does not change after factory reset. Since the IMEI number is a part of the hardware, therefore, any reset that is software-based will not be able to change the IMEI of your phone.
-
MattTheXPat over 3 yearsCrate, please don't forget to mark the correct answer for future to see. :)
-
Crate over 3 yearsokay seems fair, but as I searched about if I've dual sim phone, I would be getting 2 IMEI's
-
Crate over 3 yearsI'll get back to this post after I try these solution. Glad you guys helped !!