在Dart代码中,你可以通过调用device_info_plus插件的API来获取设备的唯一ID。对于iOS设备,可以使用identifierForVendor;对于Android设备,可以使用androidId。 dart import 'package:flutter/material.dart'; import 'package:device_info_plus/device_info_plus.dart'; void main() { runApp(MyApp()); } class MyApp...
使用platform_device_id 如果您只需要运行应用程序的设备的 id,最简单快捷的解决方案是使用platform_device_id包。它适用于 Android (AndroidId)、iOS (IdentifierForVendor)、Windows (BIOS UUID)、macOS (IOPlatformUUID) 和 Linux (BIOS UUID)。在 Flutter Web 应用程序中,您将获得 UserA...
import 'package:flutter_unique_device_id/flutter_unique_device_id.dart'; About android I know there isn't any 'perfect' way of getting a unique ID without using permissions; however, sometimes we only really need to track the device installation. When it comes to creating a unique ID, we ...
如果无法获取设备mac地址则随机生成设备标识号,确保不同App在同一台设备上获取的值一致。iOS - 4.5+...