masterfabric_device_identifiers 0.0.2
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 IDDeviceIdentifiers.getImei()- Android IMEI (requires permission)
- Proper error handling with try-catch support
- Platform-specific implementations using method channels
- Returns
nullgracefully 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.