Flutter Device IMEI

Build version

Flutter Device IMEI is a Flutter plugin designed to provide a reliable and consistent method for retrieving a device's unique identifier across Android and iOS platforms. This plugin helps developers access IMEI (International Mobile Equipment Identity) on Android devices and a consistent UUID string on iOS.

Features

  • Retrieves the IMEI for Android devices running versions below Android 10.
  • For Android 10 and above, it returns a Settings.Secure.ANDROID_ID.
  • Provides a consistent UUID identifier on iOS.
  • Requires runtime permission for IMEI retrieval on Android devices below Android 10.

Installation

Add the package to your pubspec.yaml file:

dependencies:
  flutter_device_imei: latest_version

Run the following command to install:

flutter pub get

Usage

Import the package and use it to retrieve the IMEI or device identifier:

import 'package:flutter_device_imei/flutter_device_imei.dart';

void getDeviceIMEI() async {
  String imei = await FlutterDeviceImei.instance.getIMEI();
  print("Device IMEI/Identifier: $imei");
}

Permissions

For Android devices running below Android 10, add the following permission to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

For Android 10 and above, no additional permissions are required as the plugin fetches the ANDROID_ID.

Compatibility

Platform Support
Android ✅ (IMEI for < Android 10, ANDROID_ID for ≥ Android 10)
iOS ✅ (Consistent UUID)

Support

If you find this package helpful, consider supporting my work:

ko-fi
BuyMeACoffee

Author

This plugin is developed and maintained by Pranil Shah.