v2.7.1
advertising_id
一个 Flutter 插件,用于访问广告 ID。封装了 iOS 上的 ASIdentifierManager.advertisingIdentifier 和 Android 上的广告 ID。
42喜欢 11.1万近 30 天下载140Pub 分数
AndroidiOS
一个用于访问广告 ID 的 Flutter 插件。
以下为英文项目原文快照,最新内容请访问 GitHub。
A Flutter plugin to access advertising ID.
Wraps ASIdentifierManager.advertisingIdentifier (on iOS) and advertising ID (on Android).
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
AdvertisingId.idGet 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.isLimitAdTrackingEnabledRetrieves 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;
}
依赖清单 1 项
{"sdk":"flutter"}先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗