Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skyost/flutterfundingchoices
The Flutter implementation of Funding Choices, a Google service that allows to request user consent for personalized ads in AdMob.
https://github.com/skyost/flutterfundingchoices
admob ads dart flutter funding-choices
Last synced: 2 months ago
JSON representation
The Flutter implementation of Funding Choices, a Google service that allows to request user consent for personalized ads in AdMob.
- Host: GitHub
- URL: https://github.com/skyost/flutterfundingchoices
- Owner: Skyost
- License: mit
- Created: 2020-09-12T15:17:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-28T11:36:17.000Z (about 1 year ago)
- Last Synced: 2024-10-23T06:14:34.117Z (2 months ago)
- Topics: admob, ads, dart, flutter, funding-choices
- Language: Dart
- Homepage: https://pub.dev/packages/flutter_funding_choices
- Size: 294 KB
- Stars: 8
- Watchers: 6
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
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](https://support.google.com/fundingchoices/answer/9180084) on Google Support.## Installation
### Android
Your app must use [Android Embedding V2](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects).
Also, you need to add an app id in your `AndroidManifest.xml` (in the `application` tag) :```xml
>
```
You can obtain your app ID by following [these instructions](https://support.google.com/admob/answer/7356431).
### iOS
You need to add an app id in your `Info.plist` :
```xml
GADApplicationIdentifier
YOUR-APP-ID
```You can obtain your app ID by following [these instructions](https://support.google.com/admob/answer/7356431).
You may also need to handle Apple's App Tracking Transparency message by putting this in your `Info.plist` :```xml
NSUserTrackingUsageDescription
This identifier will be used to deliver personalized ads to you.
```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 :
```dart
@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 :
* [Fork it](https://github.com/Skyost/FlutterFundingChoices/fork) on Github.
* [Submit](https://github.com/Skyost/FlutterFundingChoices/issues/new/choose) a feature request or a bug report.
* [Donate](https://paypal.me/Skyost) to the developer.