Skip to content
pubscout

unique_identifier

0.4.0, released 2 years ago by altercode.xyz

Fetch the unique identifier (ANDROID_ID or identifierForVendor) from Android and iOS.

WASM-ready
$ flutter pub add unique_identifier
Source repository

What it does

A Flutter plugin that allows developers to fetch the unique device identifier. It retrieves the ANDROID_ID on Android and identifierForVendor on iOS.

AI-written summary of version 0.4.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to retrieve the unique device identifier for analytics or tracking purposes.
  • Your app targets both Android and iOS platforms.

Skip it when

  • You need detailed device hardware information beyond a single unique string identifier.
  • You need a general device info package that provides SDK versions, models, and manufacturer details.

Strengths

  • Simple and straightforward API for fetching a unique device ID.
  • Supports both Android and iOS platforms.

Weaknesses

  • Very limited functionality compared to broader device info packages.
  • Behavior of unique identifiers can change across Android versions, factory resets, or reinstalls.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
1

No special native permissions or complex setup documented beyond standard plugin installation.

Future<void> initUniqueIdentifierState() async {
  String identifier;
  try {
    identifier = await UniqueIdentifier.serial;
  } on PlatformException {
    identifier = 'Failed to get Unique Identifier';
  }
  setState(() {
    _identifier = identifier;
  });
}

Alternatives

Packages that do the same job and could replace unique_identifier.

  • device_info_plus

    Provides comprehensive device information including unique identifiers along with OS version, hardware details, and platform specifics.

Works with

Packages commonly used together with unique_identifier: ones it builds on, ones built on it, and its own family.