admin管理员组

文章数量:1302981

I am developing a Flutter application where I need a unique device identifier that meets the following criteria:

  1. Persists even after a factory reset (should not change).
  2. Is unique for each device (no duplicates across devices).
  3. Is visible to the user (so they can share it if needed).
  4. Can be used for security purposes (e.g., detecting trusted devices and blocking fraudulent ones).

If a native Android or iOS developer knows a way to do this natively, they can also share their approach.

Approaches I Have Tried

device_info_plus package:

  • Provides androidId, but it resets after a factory reset.
  • On iOS, identifierForVendor changes after an app reinstall.

flutter_secure_storage:

  • Stores a generated UUID persistently, but it gets wiped after a factory reset.

Using IMEI or Serial Number:

  • IMEI requires special permissions and is restricted on newer Android version
  • Serial numbers are no longer accessible on newer Android versions and iOS.

Question

What is the best way to obtain a truly persistent, unique, and user-visible device identifier in Flutter?

If there is no built-in method, what alternative solutions exist (e.g., external device fingerprinting services or a combination of multiple identifiers)?

本文标签: