搜索插件、代码仓与 APP 分类

flutter_funding_choices 封面
插件详情v1.1.0

flutter_funding_choices

Funding Choices 的 Flutter 实现,这是 Google 提供的一项服务,允许在 AdMob 中请求用户对个性化广告的同意。

AndroidiOS
近 30 天下载
76
喜欢数
55
Pub 分数
150

安装插件

flutter pub add flutter_funding_choices

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Flutter Funding Choices 是一个 Flutter 包,集成了 Google 的 Funding Choices API,使应用能够在 AdMob 中请求用户对个性化广告的同意。该包通过在 Android 和 iOS 平台上显示必要的同意对话框,提供了一种无缝的方式以遵守隐私法规。该包通过简单的方法来检查同意状态并触发同意流程,简化了实现过程。它确保符合 GDPR 及其他隐私标准,同时保持与现有广告投放工作流的兼容性。

适合场景

  • 请求用户同意用于个性化广告
  • 遵守GDPR和隐私法规
  • 在Flutter应用中集成AdMob
  • 在 Android 和 iOS 上显示同意对话框
  • 管理广告个性化设置

主要特点

  • 官方 Google 资金选择集成
  • 同时支持 Android 和 iOS
  • 用于同意检查和对话的简单 API
  • 自动处理同意状态
  • 轻量且易于集成

适合对象

  • 使用 AdMob 的 Flutter 应用
  • 面向欧盟用户的开发者
  • 需要遵守GDPR的应用程序
  • 发布者管理广告个性化
  • 专注于隐私的移动应用开发者

使用建议

  • 需要 AdMob 设置
  • 在显示个性化广告之前必须获得同意
  • 仅限谷歌的资助选择服务
  • 可能需要额外的UI来管理同意
  • 不适用于非个性化广告场景

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Flutter Funding Choices

Flutter Funding Choices is an unofficial Flutter implementation of Funding Choices, a Google service that allows to request user consent for personalized ads in AdMob.

Prerequisites

You must have linked your FundingChoices account to your Admob account. See this documentation on Google Support.

Installation

Android

Your app must use Android Embedding V2. Also, you need to add an app id in your AndroidManifest.xml (in the application tag) :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="fr.skyost.example">

   <application
       <!--
         Some attributes here...
        -->
    >
       <meta-data
           android:name="com.google.android.gms.ads.APPLICATION_ID"
           android:value="YOUR-APP-ID"/>
       <!--
         Activities, ...
        -->
   </application>

</manifest>

You can obtain your app ID by following these instructions.

iOS

You need to add an app id in your Info.plist :

<key>GADApplicationIdentifier</key>
<string>YOUR-APP-ID</string>

You can obtain your app ID by following these instructions. You may also need to handle Apple's App Tracking Transparency message by putting this in your Info.plist :

<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>

Feel free to configure the message as you want.

How to use

There are three methods :

  • FlutterFundingChoices.requestConsentInformation() : Allows to get current user consent information (whether you need to show the consent form, whether the user wants personalized ads, ...).
  • FlutterFundingChoices.showConsentForm() : Loads and shows the consent form. You must check first that there is a consent form (with isConsentFormAvailable on the returned object of the previous method).
  • FlutterFundingChoices.reset() : Resets the consent information.

You typically want to use it like this on Android :

@override
void initState() {
  super.initState();
  WidgetsBinding.instance.addPostFrameCallback((_) async {
    ConsentInformation consentInfo = await FlutterFundingChoices.requestConsentInformation();
    if (consentInfo.isConsentFormAvailable && consentInfo.consentStatus == ConsentStatus.required) {  
      await FlutterFundingChoices.showConsentForm();
      // You can check the result by calling `FlutterFundingChoices.requestConsentInformation()` again !
    }
  });
}

Contributions

You have a lot of options to contribute to this project ! You can :

所属分类

源码仓库

使用此插件的项目

暂无相关数据。