I need to get Device_id for my flutter web application, I mean when I open the application on the browser on mobile I need to get the device id, I have tried all sorts of libs but all they give is browser data anyone have a solution for this? thanks in advanced
use package device_info
you can use flutter package <device_info> to get device info.
following function will help to get device id
Future<String> _getId() async {
var deviceInfo = DeviceInfoPlugin();
if (Platform.isIOS) {
// import 'dart:io'
var iosDeviceInfo = await deviceInfo.iosInfo;
return iosDeviceInfo.identifierForVendor; // unique ID on iOS
} else {
var androidDeviceInfo = await deviceInfo.androidInfo;
return androidDeviceInfo.androidId; // unique ID on Android
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.