Untitled
unknown
dart
3 years ago
498 B
11
Indexable
class DeviceInfoHelper {
DeviceInfoHelper._();
static var shared = DeviceInfoHelper._();
Future getId() async {
var deviceInfo = DeviceInfoPlugin();
if (Platform.isIOS) {
IosDeviceInfo iosDeviceInfo = await deviceInfo.iosInfo;
return iosDeviceInfo.identifierForVendor; // unique ID on iOS
} else if (Platform.isAndroid) {
AndroidDeviceInfo androidDeviceInfo = await deviceInfo.androidInfo;
return androidDeviceInfo.id; // unique ID on Android
}
}
}Editor is loading...