getId2 method
Implementation
Future<String> getId2() async {
var deviceData = <String, dynamic>{};
String id = "";
try {
if (kIsWeb) {
} else {
if (Platform.isAndroid) {
String androidId;
deviceData =
_readAndroidBuildData(await deviceInfoPlugin.androidInfo);
id = await _androidIdPlugin.getId() ?? 'Unknown ID';
} else if (Platform.isIOS) {
deviceData = _readIosDeviceInfo(await deviceInfoPlugin.iosInfo);
} else if (Platform.isLinux) {
} else if (Platform.isMacOS) {
} else if (Platform.isWindows) {}
}
} on PlatformException {
deviceData = <String, dynamic>{
'Error:': 'Failed to get platform version.'
};
}
if (Platform.isAndroid) {
} else if (Platform.isIOS) {
id = deviceData["identifierForVendor"];
}
return id;
}