admob_consent
這是 Google 的使用者訊息平台 (UMP) SDK 在 Flutter 中的包裝
- 星標
- 13
- 分支
- 11
- 最近推送(UTC)
- 2021年6月22日
- 專案狀態
- 已封存
原始 README
以下為英文專案原文快照,最新內容請造訪 GitHub。
Admob Consent Plugin
User Messaging Platform wrapper used for consent gathering (i.e. GDPR, ATT or both) on Android and iOS. Uses Google's new User Messaging Platform with Funding Choices.
Screenshots
| Example 1 | Example 2 |
|---|---|
![]() |
![]() |
Usage
To use this plugin, add admob_consent as a dependency in your pubspec.yaml file.
Requirements
1. Funding Choices
- Create a Funding Choices account
- Create respective messages inside Funding Choices for your desired app and publish them
2. Android Setup
Make sure to have added your app ID to AndroidManifest.xml.
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="YOUR-APP-ID"/>
3. iOS Setup
Make sure to have added your app ID to Info.plist.
<key>GADApplicationIdentifier</key>
<string>YOUR-APP-ID</string>
3.1 iOS ATT Dialog
If you intend to use this SDK for Apple's new ATT requirement (iOS 14+), add the following to Info.plist. If you have the IDFA message enabled in Funding Choices, the ATT dialog will appear automatically after it within your app. More information here.
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
Next, you'll need to link the AppTrackingTransparency framework by going to your application's target in Xcode and clicking the plus icon on Frameworks, Libraries and Embedded Content tab. See Google's guide here.
Example
import 'package:admob_consent/admob_consent.dart';
final AdmobConsent _admobConsent = AdmobConsent();
// Form won't appear (again) if it isn't required, you can safely call this at app start
_admobConsent.show(); // Internally defaults to: forceShow: false
// Form will appear (again) even if consent was already configured (i.e. use in button to let user manage his consent)
_admobConsent.show(forceShow: true);
Listener
You can listen to the onConsentFormLoaded, onConsentFormOpened, onConsentFormObtained and onConsentFormError streams. The UMP SDK should handle most of the things though.
_admobConsent.onConsentFormObtained.listen((o) {
// Obtained consent
});
Enjoy it?
分類
使用的依賴
依賴清單 2 項
- flutter
{"sdk":"flutter"} - flutter_test開發依賴
{"sdk":"flutter"}
如何選擇適合專案的儲存庫?
先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
- 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
- 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
- 使用前在 GitHub 確認 README、授權條款與 Issues。
來源與維護
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗


