masterfabric_device_identifiers 0.0.2 copy "masterfabric_device_identifiers: ^0.0.2" to clipboard
masterfabric_device_identifiers: ^0.0.2 copied to clipboard

A Flutter plugin that provides unique device identifiers for Android and iOS platforms.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.0.1 - 2026-01-13 #

πŸŽ‰ Initial Release #

Package Information

  • Package Name: masterfabric_device_identifiers
  • Example Package: masterfabric_device_identifiers_example
  • Organization: MasterFabric (@masterfabric)
  • Author: GΓΌrkan Fikret GΓΌnak (@gurkanfikretgunak)

Added

  • ✨ Core functionality to retrieve unique device identifiers
  • πŸ“± Android support using Settings.Secure.ANDROID_ID
  • 🍎 iOS support using UIDevice.identifierForVendor
  • πŸ”’ IMEI support for Android with DeviceIdentifiers.getImei()
  • πŸ”’ Runtime permission handling for IMEI (READ_PHONE_STATE)
  • πŸ”Œ Platform interface for extensibility
  • πŸ§ͺ Unit tests with mock platform implementation
  • πŸ“– Comprehensive documentation with examples
  • πŸ›‘οΈ Null-safe implementation
  • ⚑ Lightweight with minimal dependencies
  • 🎨 Professional example app using MasterFabric Core architecture
  • πŸ“„ MIT License with MasterFabric copyright

Features

  • Simple API with two methods:
    • DeviceIdentifiers.getDeviceIdentifier() - Cross-platform device ID
    • DeviceIdentifiers.getImei() - Android IMEI (requires permission)
  • Proper error handling with try-catch support
  • Platform-specific implementations using method channels
  • Returns null gracefully when identifier is unavailable
  • Permission exception handling for IMEI access
  • Example app demonstrating permission requests
  • Full null-safety support
  • Comprehensive inline documentation

Usage Example

import 'package:masterfabric_device_identifiers/masterfabric_device_identifiers.dart';

// Get Device ID
final deviceId = await DeviceIdentifiers.getDeviceIdentifier();
print('Device ID: $deviceId');

// Get IMEI (Android only)
try {
  final imei = await DeviceIdentifiers.getImei();
  print('IMEI: $imei');
} on PlatformException catch (e) {
  if (e.code == 'PERMISSION_DENIED') {
    print('Permission denied');
  }
}

Supported Platforms

  • Android API 16+ (Android 4.1 Jelly Bean and above)
  • iOS 11.0+

Technical Details

  • Built with Flutter SDK >=1.17.0
  • Dart SDK ^3.10.4
  • Package name: masterfabric_device_identifiers
  • Main library file: masterfabric_device_identifiers.dart
  • Uses plugin_platform_interface ^2.0.0
  • Uses permission_handler ^11.2.0
  • Follows Flutter plugin best practices
  • Android: Uses TelephonyManager for IMEI
  • iOS: IMEI not available (platform restriction)

Library Structure

lib/
β”œβ”€β”€ masterfabric_device_identifiers.dart (main export)
└── src/
    β”œβ”€β”€ masterfabric_device_identifiers_platform_interface.dart
    └── masterfabric_device_identifiers_method_channel.dart

Example App Architecture

  • πŸ—οΈ MasterFabric Core pattern implementation
  • πŸ’‰ Dependency injection with Injectable + GetIt
  • 🧭 GoRouter for declarative navigation
  • 🎨 Material Design 3 custom theme
  • πŸ”„ State management with BaseViewModelCubit
  • πŸ“± Separate views for Device ID and IMEI
  • πŸ” Complete permission request flow
  • ⚑ Error handling and loading states
  • 🎯 Professional UI with Lucide Icons

IMEI Implementation

  • Android 8.0+ (API 26+): Uses TelephonyManager.getImei()
  • Android < 8.0: Uses TelephonyManager.getDeviceId()
  • Requires READ_PHONE_STATE permission
  • Throws PlatformException when permission denied
  • Returns null for tablets without cellular capability

0.0.2 - 2026-01-14 #

Fixed #

  • πŸ”§ Uncommented iOS platform specification in example Podfile to resolve CocoaPods warning
  • βœ… Explicitly set iOS platform to version 13.0 in example/ios/Podfile

Changed #

  • πŸ“ Improved CocoaPods configuration for example app

[Unreleased] #

Planned Features #

  • Additional device information methods
  • macOS, Windows, and Linux support
  • Web platform support (limited functionality)
  • Enhanced error reporting
  • Performance optimizations
  • More device identifiers (Serial Number, MAC address, etc.)

Example App Improvements #

  • Device ID and IMEI views currently in development
  • Enhanced permission handling UI
  • Copy to clipboard functionality
  • Platform information display

Author: GΓΌrkan Fikret GΓΌnak (@gurkanfikretgunak)
Organization: MasterFabric (@masterfabric)
License: MIT

Links:

Note: This changelog will be updated with each new release.