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