搜尋套件、儲存庫與 APP 分類

套件詳情v4.2.0

flutter_udid

用於在 iOS 和 Android 上跨重新安裝取得持久性 UDID 的外掛程式

AndroidiOSmacOSWindowsLinux
近 30 天下載
14.4萬
喜歡數
290
Pub 分數
160

安裝套件

flutter pub add flutter_udid

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

flutter_udid 是一個 Flutter 插件,可在 Android、iOS、macOS、Windows 和 Linux 上提供跨應用重裝的持久性唯一設備識別碼(UDID)。它安全地生成並儲存與設備綁定的一致 ID,有助於在不依賴暫時或易失性識別碼的情況下追蹤使用者設備。該插件利用平台特定機制確保可靠性與隱私合規性。在需要長期設備識別的場景中特別有用,例如授權管理、分析或防詐欺系統。原始碼公開托管於 GitHub 上,以確保透明度與可客製化。

適用情境

  • 設備在應用重新安裝後的追蹤
  • 許可和激活系統
  • 使用者分析與歸因
  • 反詐騙和安全監控

主要特色

  • 應用重新安裝後仍保持持久
  • 跨平台支援(Android、iOS、macOS、Windows、Linux)
  • 設備ID的安全儲存
  • 使用原生平台機制
  • 開源且透明

適合對象

  • 需要長期設備識別的應用
  • 安全敏感的應用程式
  • 分析與授權平台
  • 注重隱私和合規性的開發者

使用建議

  • 需要在 Android 和 iOS 上具有適當的權限
  • 如果被濫用,可能會引發隱私問題
  • 不適合直接用於識別使用者
  • 依賴於平台級別的持久化機制
  • 應與使用者同意和透明度一起使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_udid

pub package

Plugin to retrieve a persistent UDID across app reinstalls on iOS, Android, Mac, Windows & Linux.

Usage

import 'package:flutter_udid/flutter_udid.dart';

String udid = await FlutterUdid.udid;

This provides an UDID using the format of the corresponding platform.

Platform IDs

Platform Format Source
iOS 7946DA4E-8429-423C-B405-B3FC77914E3E identifierForVendor, saved to Keychain for persistence
Android 8af8770a27cfd182 Settings.Secure.ANDROID_ID
Mac 707E990C-D002-520B-ABA6-4216C6D514BF kIOPlatformUUIDKey
Windows 99A4D301-53F5-11CB-8CA0-9CA39A9E1F01 BIOS UUID
Linux 1124435e065241dcae2241e9caab9a6c Machine ID
iOS Keychain Availability

On iOS, the UDID is stored in Keychain with kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly. This means it is available only after the user has unlocked the device once after reboot, including later background launches while the device is locked. Before the first unlock after reboot, requesting the UDID throws a PlatformException.

Consistent Format

To get a consistent formatting on all platforms use:

import 'package:flutter_udid/flutter_udid.dart';

String udid = await FlutterUdid.consistentUdid;

This will result in an UDID of the following format:

984725b6c4f55963cc52fca0f943f9a8060b1c71900d542c79669b6dc718a64b

Persistence Notes

The UDID can change after a factory reset!

Additionally, if a device has been updated to Android 8.0 through an OTA and the app is reinstalled, the UDID may change as well due to security changes in Android 8.0.

On rooted and jailbroken devices the ID can be changed, so please take this into account. However, it should not be possible to identify as a different device through random guessing because of the complexity of the ID.

Furthermore, the UDID may also change if there is a change in the app's signing signature, for both iOS and Android. Ensure that you always use the same digital signature to sign your app.

Flutter Resources

For help getting started with Flutter, view the online documentation.

For help on editing plugin code, view the documentation.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案