FLUTTER ECOSYSTEM

operando/advertising_id

一個用於存取廣告 ID 的 Flutter 插件。

advertising_id 專案封面
Stars
14
Forks
38
最近推送(UTC)
2024年9月6日
專案狀態
已封存
Shinobu Okano GitHub avatar
GITHUB User

Shinobu Okano ↗

語言RubyKotlinDartSwiftObjective-CMakefile

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 1 項
  • flutter{"sdk":"flutter"}

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 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;
}