unique_device_identifier
2.1.0, released 3 months ago by an unverified publisher
Provides a unique device identifier across Android, iOS, Windows, macOS, Linux, and Web.
What it does
Fetches a unique device identifier string using native platform APIs on Android, iOS, Windows, macOS, and Linux, and localStorage or fingerprinting on the Web. It provides a consistent static method interface across all supported platforms.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a unique hardware or installation identifier for analytics or device tracking.
- You are targeting multiple platforms including desktop, mobile, and web with a single API.
Skip it when
- You require an identifier that strictly survives app uninstalls on iOS and Android.
- You need secure unique IDs that cannot be reset or modified via local storage or browser settings on the web.
Strengths
- Supports all major platforms: Android, iOS, Windows, macOS, Linux, and Web.
- No external dependencies required beyond Flutter.
- Clean static method interface for easy calling.
Weaknesses
- UUID may change after uninstalling and reinstalling the app on iOS and Android.
- Web implementation relies on localStorage which can be cleared by the user.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add the dependency to pubspec.yaml and call the static method asynchronously.
import 'package:unique_device_identifier/unique_device_identifier.dart';
void main() async {
final String? deviceId = await UniqueDeviceIdentifier.getUniqueIdentifier();
print("Device ID: $deviceId");
}Alternatives
Packages that do the same job and could replace unique_device_identifier.
- android_id
A Flutter plugin for retrieving the Android ID on Android devices.
87Compare - flutter_device_imei
Retrieve device IMEI on Android <10 or ANDROID_ID on newer, and UUID on iOS.
58Compare - system_info_plus
A flutter plugin to get device RAM size.
73Compare - unique_identifier
Fetch the unique identifier (ANDROID_ID or identifierForVendor) from Android and iOS.
50Compare
Works with
Packages commonly used together with unique_device_identifier: ones it builds on, ones built on it, and its own family.