flutter_device_imei
0.0.5, released 11 months ago by pranilshah.in
Retrieve device IMEI on Android <10 or ANDROID_ID on newer, and UUID on iOS.
$ flutter pub add flutter_device_imeiWhat it does
This plugin exposes a single method to get a unique device identifier. On Android it returns the IMEI for devices below Android 10, or the ANDROID_ID for newer versions. On iOS it returns a consistent UUID string.
AI-written summary of version 0.0.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a stable device identifier for analytics or feature gating.
- You need to identify a device across app launches without storing data locally.
Skip it when
- You are concerned about privacy or need to comply with regulations that restrict IMEI usage.
- You only need a generic device ID that can be reset, such as for testing.
Strengths
- Simple API, single method call.
- Supports both Android and iOS with consistent behavior.
- No build_runner or code generation required.
Weaknesses
- Requires READ_PHONE_STATE permission on Android <10.
- IMEI is not available on Android 10+; falls back to ANDROID_ID which may change on factory reset.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add <uses-permission android:name="android.permission.READ_PHONE_STATE"/> to AndroidManifest.xml for Android <10. No additional native steps required.
import 'package:flutter_device_imei/flutter_device_imei.dart';
Future<void> getDeviceIMEI() async {
String imei = await FlutterDeviceImei.instance.getIMEI();
print("Device IMEI/Identifier: $imei");
}Alternatives
Packages that do the same job and could replace flutter_device_imei.
- android_id
A Flutter plugin for retrieving the Android ID on Android devices.
87Compare - unique_device_identifier
Provides a unique device identifier across Android, iOS, Windows, macOS, Linux, and Web.
59Compare - unique_identifier
Fetch the unique identifier (ANDROID_ID or identifierForVendor) from Android and iOS.
50Compare - platform_device_id
Get unique device IDs across Android, iOS, Windows, Linux, macOS, and Web.
50Compare
Works with
Packages commonly used together with flutter_device_imei: ones it builds on, ones built on it, and its own family.