Closed telestia closed 1 year ago
The string you provided is no Android ID:
https://distrowiki.miraheze.org/wiki/Android_13_build_TP1A.220624.014
How did you get it?
var deviceInfo = DeviceInfoPlugin(); if (Platform.isAndroid) { AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; deviceId = androidInfo.id; } else if (Platform.isIOS) { IosDeviceInfo iosInfo = await deviceInfo.iosInfo; deviceId = iosInfo.identifierForVendor; }
Makes sense. This id is not unique.
Since you've posted this issue in the android_id package: Are you looking for a unique id for Android? Please refer to the readme of this plugin 😊
But maybe just generating and storing a uuid per device would make more sense? Like https://github.com/fluttercommunity/android_id/issues/45#issuecomment-1604466963.
On a side note, you could make use of the final keyword if a variable doesn't change any more. Using a lint package can show these kinds of hints and can be helpful when learning to code.
Thank you for your answer and your advice.
I got same id on 2 different Android device, should I use fingerprint for unique deviceId?
DeviceId is: TP1A.220624.014