The get_mac package is a Flutter plugin designed to retrieve the MAC address of Android and iOS devices. It provides a simple, cross-platform API to access the device's network interface identifier, useful for identifying devices on a local network. The plugin works without requiring root or special permissions on Android, though it may return a placeholder or randomized MAC on newer Android versions due to privacy restrictions. On iOS, it leverages system APIs with appropriate entitlements. The package is lightweight and integrates seamlessly into existing Flutter projects.
Use cases
- Device identification on local networks
- Network-based authentication
- Local device tracking
- Debugging network-related issues
- Connecting to IoT devices
Key features
- Cross-platform support (Android & iOS)
- Simple API for MAC retrieval
- No need for root access on Android
- Respects modern privacy restrictions
- Lightweight and easy to integrate
Suitable for
- Developers building network-aware apps
- Apps requiring unique device identifiers
- IoT and local network applications
- Testing and debugging network connectivity
Considerations
- MAC address may be randomized on Android 10+
- iOS requires proper entitlements
- Privacy policies may restrict usage
- Not reliable for user identification
- Limited availability on some devices