getDeviceId static method
Implementation
static Future<String> getDeviceId() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
if (!Platform.isAndroid) {
IosDeviceInfo iosDeviceInfo = await deviceInfo.iosInfo;
return await iosDeviceInfo.identifierForVendor; // unique ID on iOS
} else {
AndroidDeviceInfo androidDeviceInfo = await deviceInfo.androidInfo;
return await androidDeviceInfo.androidId; // unique ID on Android
}
}