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

套件詳情v2.7.1

advertising_id

一個 Flutter 外掛,用於存取廣告 ID。包裝了 iOS 上的 ASIdentifierManager.advertisingIdentifier 與 Android 上的廣告 ID。

AndroidiOS
近 30 天下載
10.5萬
喜歡數
42
Pub 分數
140

安裝套件

flutter pub add advertising_id

套件介紹

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

advertising_id 套件是一個 Flutter 插件,可在 Android 與 iOS 平台上提供對裝置廣告 ID 的存取。它封裝了原生 API——iOS 上的 ASIdentifierManager.advertisingIdentifier 與 Android 的廣告 ID,讓應用程式能夠取得用於目標廣告的獨特識別碼。這讓開發者能在符合各平台特定隱私指引的情況下,支援廣告個人化與分析功能。此套件輕巧且能順暢整合至 Flutter 應用中。

適用情境

  • 定向廣告
  • 使用者分析
  • 廣告歸因
  • 跨應用追蹤

主要特色

  • 跨平台支援
  • Privacy-compliant
  • 簡單 API
  • 原生整合

適合對象

  • 廣告投放應用
  • 分析工具
  • 行銷平台

使用建議

  • 需要使用者在 iOS 上的同意
  • 取決於平台權限
  • 並非所有裝置都可用
  • 可能受隱私設定限制

原始 README

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

pub package

advertising_id

A Flutter plugin to access advertising ID.

Wraps ASIdentifierManager.advertisingIdentifier (on iOS) and advertising ID (on Android).

Getting Started

Run this command

 flutter pub add advertising_id

This will add a line like this to your package's pubspec.yaml

dependencies:
  ....
  advertising_id: ^2.7.1

Usage

AdvertisingId.id

Get advertising ID.

String? advertisingId;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
  advertisingId = await AdvertisingId.id(true);
} on PlatformException {
  advertisingId = null;
}
AdvertisingId.isLimitAdTrackingEnabled

Retrieves whether the user has limit ad tracking enabled or not.

bool? isLimitAdTrackingEnabled;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
  isLimitAdTrackingEnabled = await AdvertisingId.isLimitAdTrackingEnabled;
} on PlatformException {
  isLimitAdTrackingEnabled = false;
}

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。