appodeal_flutter 0.0.2 copy "appodeal_flutter: ^0.0.2" to clipboard
appodeal_flutter: ^0.0.2 copied to clipboard

outdated

A Flutter plugin to display ads from Appodeal

appodeal_flutter #

GitHub Actions Pub Version ISC License

A Flutter plugin to display ads from Appodeal. It current supports Banner, Interstitial, Reward and Non-Skippable ads.

🚧 Under development #

🔴 ATTENTION: This plugin is under development and is considered to be in ALPHA STAGE. It means that many features are not implemented yet and/or subject of change in future releases. While some things are already working, please use caution when using this plugin in production.

Roadmap #

  • Display banner ads.
  • Display interstitial ads.
  • Display reward ads.
  • Support for iOS 14+.
  • Support for Consent Manager framework (GDPR/CCPA consent status).
  • Create callbacks to be notified of events when ads don't load, when they are closed, rewarded, etc.
  • Support for floating banner ads.
  • Ability to cache ads manually.
  • Other features under consideration...

⚙️ Installation #

  1. Add the dependency to the pubspec.yaml file in your project:
dependencies:
  appodeal_flutter: "^0.0.2"
  1. Install the package by running the command below in the terminal, in your project's root directory:
$ flutter pub get
  1. Follow the Appodeal installation instructions available for iOS and Android. However, ignore the steps to include the Appodeal SDK dependencies in your Gradle files (Android) and the Cocoapods dependencies (iOS) since both steps are already done by this Flutter package.

Extra step For iOS 14+ only #

  1. Follow the instructions available here on how to implement the permission request to track users, but ignore the part to include some code in the AppDelegate file. This code will be executed when you call the function Appodeal.requestTrackingAuthorization(), before the initialization of Appodeal (see below).

📱 Usage #

Import the package as early as possible somewhere in your project (ideally in the file main.dart) and then initialize the plugin using calling the method Appodeal.initialize():

Initialization #

import 'package:appodeal_flutter/appodeal_flutter.dart';

// iOS 14+: request permission to track users
// on iOS <= 13 and on Android this function does nothing and just returns true
await Appodeal.requestTrackingAuthorization();

// Initialize Appodeal
await Appodeal.initialize(
  androidAppKey: '<your-appodeal-android-key>',
  iosAppKey: '<your-appodeal-ios-key>',
  adTypes: [AppodealAdType.BANNER, AppodealAdType.INTERSTITIAL, AppodealAdType.REWARD],
  testMode: true
);

// At this point you can safely display ads
  • androidAppKey and iosAppKey (mandatory): you must set these fields with the appropriate key associated with your app in your Appodeal account. You must set at least one of these fields during the initialization (either Android or iOS). If no key is set then this function will throw an error.

  • adTypes (optional) you must set a list (of type AppodealAdType) with all the ad types that you would like to present in your app. If this parameter is undefined or an empty list then no ads will be loaded.

  • testMode (optional) you must set false (default) or true depending if you are running the ads during development/test or production.

To include a banner ad in UI, just include the AppodealBanner somewhere in your widget tree:

...
Center(
  child: AppodealBanner()
)
...

Interstitial & Reward ads #

To show an interstitial or a reward ad, call the function Appodeal.show() passing the type of ad that you would show to show as a paremeter:

Appodeal.show(AppodealAdType.INTERSTITIAL)  // Show an interstitial ad
Appodeal.show(AppodealAdType.REWARD)        // Show a reward ad
Appodeal.show(AppodealAdType.NON_SKIPPABLE) // Show a non-skippable ad

📝 License #

appodeal_flutter is released under the ISC License. See LICENSE for details.

👨🏾‍💻 Author #

Vinicius Egidio (vinicius.io)

73
likes
0
pub points
59%
popularity

Publisher

unverified uploader

A Flutter plugin to display ads from Appodeal

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on appodeal_flutter