stack_appodeal_flutter
官方 Flutter 插件,支持 Android 和 iOS 平台的 Appodeal SDK。支持 GDPR/CCPA 区域的同意对话框。
官方 Flutter 插件,为您的 Flutter 应用程序添加 Appodeal SDK 支持。
{"sdk":"flutter"}{"sdk":"flutter"}以下为英文项目原文快照,最新内容请访问 GitHub。
Official Appodeal Flutter Plugin for your Flutter application.
Google CMP and TCF v2 Support
AdMob Bidding Support
Already included ready-made consent solution
Support Monetization + UA + Analytics data services
Add the dependency to the pubspec.yaml file in your project:
dependencies:
stack_appodeal_flutter: 4.3.0
Install the plugin by running the command below in the terminal:
$ flutter pub get
[!IMPORTANT]
- iOS 15.0 or higher for using the Appodeal Flutter plugin.
- Appodeal SDK is compatible with both ARC and non-ARC projects.
- Use Xcode 15.3 or higher. Xcode 27 and iOS 27 are supported starting from 4.3.0.
ios/ folder and open Podfile./ios/Podfile:platform :ios, '15.0'
source 'https://github.com/appodeal/CocoaPods.git'
source 'https://github.com/bidon-io/CocoaPods-Specs.git'
source 'https://cdn.cocoapods.org'
use_frameworks!
def appodeal
pod 'Appodeal', '4.3.0'
# Level Play
pod 'IronSourceAdMobAdapter', '5.10.0.0'
pod 'IronSourceBidMachineAdapter', '5.7.0.0'
pod 'IronSourceBigoAdapter', '5.9.0.0'
pod 'IronSourceFacebookAdapter', '5.3.0.0'
pod 'IronSourceFyberAdapter', '5.8.0.0'
pod 'IronSourceInMobiAdapter', '5.7.0.0'
pod 'IronSourceMintegralAdapter', '5.13.0.0'
pod 'IronSourceMobileFuseAdapter', '5.0.0.0'
pod 'IronSourceMolocoAdapter', '5.5.0.0'
pod 'IronSourceMyTargetAdapter', '5.9.0.0'
pod 'IronSourceOguryAdapter', '5.0.0.0'
pod 'IronSourcePangleAdapter', '5.5.0.0'
pod 'IronSourceSmaatoAdapter', '5.3.0.0'
pod 'IronSourceUnityAdsAdapter', '5.6.0.0'
pod 'IronSourceVerveAdapter', '5.1.0.0'
pod 'IronSourceVungleAdapter', '5.9.0.0'
pod 'IronSourceYandexAdapter', '5.7.0.0'
# Bidon
pod 'BidonAdapterAmazon', '5.5.0.0'
pod 'BidonAdapterAppLovin', '13.6.4.0'
pod 'BidonAdapterBidMachine', '3.7.1.1'
pod 'BidonAdapterBigoAds', '5.2.1.0'
pod 'BidonAdapterChartboost', '9.10.1.0'
pod 'BidonAdapterDTExchange', '8.4.7.0'
pod 'BidonAdapterInMobi', '11.3.0.0'
pod 'BidonAdapterIronSource', '9.4.0.0.0'
pod 'BidonAdapterMetaAudienceNetwork', '6.21.1.1'
pod 'BidonAdapterMintegral', '8.1.3.0'
pod 'BidonAdapterMobileFuse', '1.9.3.0'
pod 'BidonAdapterMoloco', '4.3.0.0'
pod 'BidonAdapterMyTarget', '5.43.0.0'
pod 'BidonAdapterStartIo', '4.11.0.0'
pod 'BidonAdapterTaurusX', '1.9.2.0'
pod 'BidonAdapterUnityAds', '4.17.0.0'
pod 'BidonAdapterVungle', '7.7.3.0'
pod 'BidonAdapterYandex', '7.18.4.0'
pod 'BidonAdapterZmaticoo', '2.2.0.0'
# Appodeal
pod 'AppodealAdjustAdapter', '5.7.0.1'
pod 'AppodealAmazonAdapter', '5.5.0.0'
pod 'AppodealAppLovinAdapter', '13.6.4.0'
pod 'AppodealAppLovinMAXAdapter', '13.6.4.2'
pod 'AppodealAppsFlyerAdapter', '6.18.0.2'
pod 'AppodealBidMachineAdapter', '3.7.1.0'
pod 'AppodealBidonAdapter', '0.15.0.0'
pod 'AppodealBigoAdsAdapter', '5.2.1.0'
pod 'AppodealDTExchangeAdapter', '8.4.7.0'
pod 'AppodealFacebookAdapter', '18.0.3.0'
pod 'AppodealFirebaseAdapter', '12.15.0.1'
pod 'AppodealGoogleAdMobAdapter', '13.5.0.0'
pod 'AppodealIABAdapter', '3.5.2.0'
pod 'AppodealInMobiAdapter', '11.3.0.0'
pod 'AppodealIronSourceAdapter', '9.4.0.0.0'
pod 'AppodealLevelPlayAdapter', '9.4.0.0.0'
pod 'AppodealMetaAudienceNetworkAdapter', '6.21.1.0'
pod 'AppodealMintegralAdapter', '8.1.3.0'
pod 'AppodealMyTargetAdapter', '5.43.0.0'
pod 'AppodealSentryAdapter', '8.57.2.1'
pod 'AppodealUnityAdapter', '4.17.0.0'
pod 'AppodealVungleAdapter', '7.7.3.0'
pod 'AppodealYandexAdapter', '7.18.4.1'
# AppLovin MAX
pod 'AppLovinMediationAmazonAdMarketplaceAdapter', '5.5.0.0'
pod 'AppLovinMediationBidMachineAdapter', '3.7.1.0.0'
pod 'AppLovinMediationBigoAdsAdapter', '5.2.1.0'
pod 'AppLovinMediationByteDanceAdapter', '7.7.0.7.0'
pod 'AppLovinMediationChartboostAdapter', '9.10.1.0'
pod 'AppLovinMediationFacebookAdapter', '6.21.1.0'
pod 'AppLovinMediationFyberAdapter', '8.4.7.0'
pod 'AppLovinMediationGoogleAdManagerAdapter', '13.5.0.0'
pod 'AppLovinMediationGoogleAdapter', '13.5.0.0'
pod 'AppLovinMediationInMobiAdapter', '11.3.0.1'
pod 'AppLovinMediationIronSourceAdapter', '9.4.0.0.0'
pod 'AppLovinMediationMintegralAdapter', '8.1.3.0.0'
pod 'AppLovinMediationMobileFuseAdapter', '1.9.3.0'
pod 'AppLovinMediationMolocoAdapter', '4.3.0.0'
pod 'AppLovinMediationOguryPresageAdapter', '5.1.1.0'
pod 'AppLovinMediationPubMaticAdapter', '4.10.0.0'
pod 'AppLovinMediationSmaatoAdapter', '23.2.0.0'
pod 'AppLovinMediationUnityAdsAdapter', '4.17.0.0'
pod 'AppLovinMediationVerveAdapter', '3.7.0.0'
pod 'AppLovinMediationVungleAdapter', '7.7.3.0'
pod 'AppLovinMediationYandexAdapter', '7.18.4.0'
pod 'TaurusxAdsSDK', '1.9.2'
pod 'TaurusxAdsSDK/AppLovinAdapter', '1.9.2'
pod 'zMaticooMAXAdapter', '2.2.0'
end
target 'Sample' do
project 'Sample/Sample.xcodeproj'
appodeal
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
[!TIP] Use the Appodeal Dependencies Wizard to configure mediated networks and generate an always up-to-date dependency list for your Podfile.
Note: Appodeal requires to use
use_frameworks!. You need to remove Flipper dependency from Podfile and AppDelegate.
[!NOTE] The Appodeal dependency list pulls pods from three sources (
appodeal,bidon-io,cdn.cocoapods.org). Because some pods are published in more than one of them, CocoaPods prints aFound multiple specificationswarning for each. Add the following to the top of yourPodfileto silence those warnings and speed up project generation on this large dependency graph:install! 'cocoapods', :deterministic_uuids => false, :warn_for_multiple_pod_sources => false
pod install.xcworkspaceInfo.plist.Ad networks used in Appodeal mediation support conversion tracking using Apple's SKAdNetwork,
which means ad networks are able to attribute an app install even when IDFA is unavailable. To
enable this functionality, you will need to update the SKAdNetworkItems key with an additional
dictionary in your Info.plist.
The up-to-date list of SKAdNetworkIds is available in the official documentation.
In order to serve ads, the SDK requires you to allow arbitrary loads. Set up the following keys
in Info.plist of your app:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
All of the entries below are optional. None of them is required by the Appodeal SDK itself — add only the ones that match the networks you actually integrate and the permissions you are willing to request.
CoreLocation and never requests location. Add this entry only if you integrate a network
that uses location — in the current recommended set that is Amazon
(AppodealAmazonAdapter, BidonAdapterAmazon) and BidMachine (AppodealBidMachineAdapter).
If you do not use those, omit it.Add only the keys you need — see the notes above.
<key>NSUserTrackingUsageDescription</key>
<string><App Name> needs your advertising identifier to provide personalised advertising experience tailored to you</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string><App Name> needs your location for analytics and advertising purposes</string>
<key>NSCalendarsUsageDescription</key>
<string><App Name> needs your calendar to provide personalised advertising experience tailored to you</string>
[!IMPORTANT]
- Android API level 24 (Android OS 7.0) or higher.
Add dependencies into build.gradle (module: app)
dependencies {
implementation "com.appodeal.ads.sdk:core:4.3.0"
// BidMachine
implementation "io.bidmachine:ads.networks.amazon:12.0.0.0"
implementation "io.bidmachine:ads.networks.meta_audience:6.21.0.1"
implementation "io.bidmachine:ads.networks.mintegral:17.1.61.1"
implementation "io.bidmachine:ads.networks.my_target:5.47.1.2"
implementation "io.bidmachine:ads.networks.vungle:7.7.4.0"
// AppLovin MAX
implementation "com.applovin.mediation:amazon-tam-adapter:11.3.1.0"
implementation "com.applovin.mediation:bidmachine-adapter:3.7.1.0"
implementation "com.applovin.mediation:bigoads-adapter:5.9.0.0"
implementation "com.applovin.mediation:bytedance-adapter:8.1.0.3.0"
implementation "com.applovin.mediation:chartboost-adapter:9.10.2.0"
implementation "com.applovin.mediation:facebook-adapter:6.21.0.0"
implementation "com.applovin.mediation:fyber-adapter:8.4.6.0"
implementation "com.applovin.mediation:google-ad-manager-adapter:25.2.0.0"
implementation "com.applovin.mediation:google-adapter:25.2.0.0"
implementation "com.applovin.mediation:inmobi-adapter:11.3.0.1"
implementation "com.applovin.mediation:ironsource-adapter:9.4.4.0.0"
implementation "com.applovin.mediation:mintegral-adapter:17.1.61.0"
implementation "com.applovin.mediation:mobilefuse-adapter:1.11.0.0"
implementation "com.applovin.mediation:moloco-adapter:4.3.1.0"
implementation "com.applovin.mediation:ogury-presage-adapter:6.2.0.0"
implementation "com.applovin.mediation:pubmatic-adapter:4.10.0.0"
implementation "com.applovin.mediation:smaato-adapter:22.7.2.3"
implementation "com.applovin.mediation:unityads-adapter:4.17.0.0"
implementation "com.applovin.mediation:verve-adapter:3.7.1.0"
implementation "com.applovin.mediation:vungle-adapter:7.7.4.0"
implementation "com.applovin.mediation:yandex-adapter:7.17.0.0"
// Bidon
implementation "org.bidon:amazon-adapter:12.0.0.0"
implementation "org.bidon:applovin-adapter:13.6.3.0"
implementation "org.bidon:bidmachine-adapter:3.7.1.1"
implementation "org.bidon:bigoads-adapter:5.9.0.0"
implementation "org.bidon:chartboost-adapter:9.10.2.0"
implementation "org.bidon:dtexchange-adapter:8.4.6.0"
implementation "org.bidon:inmobi-adapter:11.3.0.0"
implementation "org.bidon:ironsource-adapter:9.4.4.0"
implementation "org.bidon:meta-adapter:6.21.0.0"
implementation "org.bidon:mintegral-adapter:17.1.61.0"
implementation "org.bidon:mobilefuse-adapter:1.11.0.0"
implementation "org.bidon:moloco-adapter:4.3.1.0"
implementation "org.bidon:startio-adapter:5.2.4.1"
implementation "org.bidon:taurusx-adapter:1.12.2.0"
implementation "org.bidon:unityads-adapter:4.17.0.0"
implementation "org.bidon:vkads-adapter:5.47.1.0"
implementation "org.bidon:vungle-adapter:7.7.4.0"
implementation "org.bidon:yandex-adapter:7.17.0.0"
implementation "org.bidon:zmaticoo-adapter:2.0.7.1.0"
// Level Play
implementation "com.unity3d.ads-mediation:admob-adapter:5.7.0"
implementation "com.unity3d.ads-mediation:applovin-adapter:5.8.0"
implementation "com.unity3d.ads-mediation:bidmachine-adapter:5.7.0"
implementation "com.unity3d.ads-mediation:bigo-adapter:5.8.0"
implementation "com.unity3d.ads-mediation:facebook-adapter:5.3.0"
implementation "com.unity3d.ads-mediation:fyber-adapter:5.9.0"
implementation "com.unity3d.ads-mediation:inmobi-adapter:5.7.0"
implementation "com.unity3d.ads-mediation:mintegral-adapter:5.18.0"
implementation "com.unity3d.ads-mediation:mobilefuse-adapter:5.3.0"
implementation "com.unity3d.ads-mediation:moloco-adapter:5.6.0"
implementation "com.unity3d.ads-mediation:mytarget-adapter:5.5.0"
implementation "com.unity3d.ads-mediation:ogury-adapter:5.2.0"
implementation "com.unity3d.ads-mediation:pangle-adapter:5.18.0"
implementation "com.unity3d.ads-mediation:unityads-adapter:5.6.0"
implementation "com.unity3d.ads-mediation:verve-adapter:5.2.0"
implementation "com.unity3d.ads-mediation:vungle-adapter:5.10.0"
// Appodeal
implementation "com.appodeal.ads.sdk.adapters:adjust:5.7.0.0"
implementation "com.appodeal.ads.sdk.adapters:admob:25.2.0.0"
implementation "com.appodeal.ads.sdk.adapters:amazon:12.0.0.0"
implementation "com.appodeal.ads.sdk.adapters:applovin:13.6.3.0"
implementation "com.appodeal.ads.sdk.adapters:applovin_max:13.6.3.1"
implementation "com.appodeal.ads.sdk.adapters:appsflyer:6.18.0.1"
implementation "com.appodeal.ads.sdk.adapters:bidmachine:3.7.1.0"
implementation "com.appodeal.ads.sdk.adapters:bidon:0.14.0.0"
implementation "com.appodeal.ads.sdk.adapters:bigo_ads:5.9.0.0"
implementation "com.appodeal.ads.sdk.adapters:chartboost:9.10.2.0"
implementation "com.appodeal.ads.sdk.adapters:dt_exchange:8.4.6.0"
implementation "com.appodeal.ads.sdk.adapters:facebook_analytics:18.3.0.0"
implementation "com.appodeal.ads.sdk.adapters:firebase:23.2.0.0"
implementation "com.appodeal.ads.sdk.adapters:iab:1.8.1.0"
implementation "com.appodeal.ads.sdk.adapters:inmobi:11.3.0.0"
implementation "com.appodeal.ads.sdk.adapters:ironsource:9.4.4.0"
implementation "com.appodeal.ads.sdk.adapters:level_play:9.4.4.0"
implementation "com.appodeal.ads.sdk.adapters:meta:6.21.0.0"
implementation "com.appodeal.ads.sdk.adapters:mintegral:17.1.61.0"
implementation "com.appodeal.ads.sdk.adapters:mobilefuse:1.11.0.0"
implementation "com.appodeal.ads.sdk.adapters:moloco:4.3.1.0"
implementation "com.appodeal.ads.sdk.adapters:my_target:5.47.1.0"
implementation "com.appodeal.ads.sdk.adapters:ogury:6.2.0.0"
implementation "com.appodeal.ads.sdk.adapters:pubmatic:4.10.0.0"
implementation "com.appodeal.ads.sdk.adapters:sentry_analytics:8.44.1.0"
implementation "com.appodeal.ads.sdk.adapters:smaato:22.7.2.0"
implementation "com.appodeal.ads.sdk.adapters:startio:5.2.4.0"
implementation "com.appodeal.ads.sdk.adapters:taurusx:1.12.2.0"
implementation "com.appodeal.ads.sdk.adapters:unity_ads:4.17.0.0"
implementation "com.appodeal.ads.sdk.adapters:verve:3.7.1.0"
implementation "com.appodeal.ads.sdk.adapters:vungle:7.7.4.0"
implementation "com.appodeal.ads.sdk.adapters:yandex:7.17.0.0"
}
Add repository into build.gradle (module: project)
allprojects {
repositories {
...
maven { url "https://artifactory.appodeal.com/appodeal" }
...
}
}
[!TIP] Starting from Appodeal SDK 4.1.0, Android uses individual adapter dependencies (same approach as iOS). Use the Appodeal Dependencies Wizard to configure mediated networks and generate an always up-to-date dependency list for your
build.gradle.
[!WARNING]
AdMob Bidding is now available since Appodeal SDK 3.2.0.
Don't forget to download our newest version of AdMob Sync tool from this page and perform sync.
You can read more about AdMob Sync in our guide.
How to add AdMob Ad Network to your project:
Add your AdMob app id to meta-data tag:
<manifest>
<application>
<!-- Add your AdMob App ID -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>
</manifest>
Add your AdMob app id to Info.plist.
Use the key GADApplicationIdentifier with the value being your AdMob app ID:
<key>GADApplicationIdentifier</key>
<string>YOUR_ADMOB_APP_ID</string>
How to remove AdMob Ad Network from your project:
Change next dependencies into build.gradle (module: app)
Starting from Appodeal SDK 4.1.0, dependencies are added individually.
Simply do not include AdMob-related adapters in your build.gradle / Podfile.
Use the Dependencies Wizard to generate the correct dependency list without AdMob.
Please, read iOS and Android docs at wiki to get deeper understanding how Appodeal SDK Services works.
Appodeal SDK supports the following services: Adjust, AppsFlyer, Firebase, and Meta.
To add service adapters to your project, use the Dependencies Wizard:
Note: In-App purchase tracking will work only with connection with Adjust/Appsflyer.
It's possible to track in-app purchase information and send info to Appodeal servers for analytics. It allows to group users by the fact of purchasing in-apps. This will help you to adjust the ads for such users or simply turn it off, if needed. To make this setting work correctly, please submit the purchase info via the Appodeal SDK.
final purchase = AppodealAppStorePurchase.nonConsumable(
orderId: orderId,
price: price,
currency: currency,
transactionId: transactionId,
additionalParameters: {});
Appodeal.validateInAppPurchase(
purchase: purchase,
onInAppPurchaseValidateSuccess: (purchase, errors) {},
onInAppPurchaseValidateFail: (purchase, errors) {});
| Parameter | Description | Usage |
|---|---|---|
| orderId | Product purchased unique order id for the transaction. | Adjust/AppsFlyer |
| price | In-app event revenue. | Adjust/AppsFlyer/Appodeal |
| currency | In-app event currency. | Adjust/AppsFlyer/Appodeal |
| transactionId | Product purchased transaction id. | Adjust/AppsFlyer |
| additionalParameters | Additional parameters of the in-app event. |
final purchase = AppodealPlayStorePurchase.inapp(
orderId: orderId,
price: price,
currency: currency,
additionalParameters: {})
..sku = sku
..publicKey = publicKey
..signature = signature
..purchaseData = purchaseData
..purchaseToken = purchaseToken
..purchaseTimestamp = purchaseTimestamp
..developerPayload = developerPayload
Appodeal.validateInAppPurchase(
purchase: purchase,
onInAppPurchaseValidateSuccess: (purchase, errors) {},
onInAppPurchaseValidateFail: (purchase, errors) {});
| Parameter | Description | Usage |
|---|---|---|
| purchaseType | Purchase type. Must be InAppPurchase.Type.InApp or InAppPurchase.Type.Subs | Adjust/AppsFlyer |
| publicKey | Public key from Google Developer Console. | AppsFlyer |
| signature | Transaction signature (returned from Google API when the purchase is completed). | Adjust/AppsFlyer |
| purchaseData | Product purchased in JSON format (returned from Google API when the purchase is completed). | AppsFlyer |
| purchaseToken | Product purchased token (returned from Google API when the purchase is completed). | Adjust |
| purchaseTimestamp | Product purchased timestamp (returned from Google API when the purchase is completed). | Adjust |
| developerPayload | Product purchased developer payload (returned from Google API when the purchase is completed). | Adjust |
| orderId | Product purchased unique order id for the transaction (returned from Google API when the purchase is completed). | Adjust |
| sku | Stock keeping unit id. | Adjust |
| price | In-app event revenue. | Adjust/AppsFlyer/Appodeal |
| currency | In-app event currency. | Adjust/AppsFlyer/Appodeal |
| additionalParameters | Additional parameters of the in-app event. |
Appodeal SDK allows you to send events to all analytic services such as Firebase, AppsFlyer, Adjust and Meta using a single method:
Appodeal.logEvent("example_event_name", {
"example_param_1": "example_param_value_1",
"example_param_2": 123
});
Use this method for send event for a specific service:
Appodeal.logEvent("example_event_name", {
"example_param_1": "example_param_value_1",
"example_param_2": 123
},
AppodealServices.APPSFLYER
);
You can use one or more of these values to select the service to send the event to:
AppodealServices.ADJUST - for Adjust service;AppodealServices.APPSFLYER - for Appsflyer service;AppodealServices.FACEBOOK - for Facebook service;AppodealServices.FIREBASE - for Firebase service;AppodealServices.ALL - for ALl services;or you may combine these values, for example, to sent event to Appsflyer and Firebase services:
AppodealServices.APPSFLYER | AppodealServices.FIREBASEPlease, read iOS and Android docs at wiki to get deeper understanding how Appodeal SDK works.
Appodeal.initialize(
appKey: "YOUR_APPODEAL_APP_KEY",
adTypes: [
AppodealAdType.Interstitial,
AppodealAdType.RewardedVideo,
AppodealAdType.Banner,
AppodealAdType.MREC
],
onInitializationFinished: (errors) => {});
Note: Make sure to replace "YOUR_APPODEAL_APP_KEY" with the actual app key.
Use the type codes below to set the preferred ad format:
AppodealAdType.Interstitial for interstitial.AppodealAdType.RewardedVideo for rewarded videos.AppodealAdType.Banner for banners.AppodealAdType.MREC for 300*250 banners.Call this method before initialization
// Set ad auto caching enabled or disabled
// By default autocache is enabled for all ad types
Appodeal.setAutoCache(AppodealAdType.Interstitial, false); //default - true
// Set testing mode
Appodeal.setTesting(false); //default - false
// Set Appodeal SDK logging level
Appodeal.setLogLevel(Appodeal.LogLevelVerbose); //default - Appodeal.LogLevelNone
// Enable or disable child direct treatment
Appodeal.setChildDirectedTreatment(false); //default - false
// Disable network for specific ad type
Appodeal.disableNetwork("admob");
Appodeal.disableNetwork("admob", AppodealAdType.Interstitial);
// Set segment filter
Appodeal.setCustomFilter("levels_played", "levelsPlayed");
// Set extras
Appodeal.setExtraData("attribuition_id", "some value");
// Enable or disable tablet banners.
// SUPORTED ONLY FOR NON-VIEW DISPLAYING
// THIS METHOD DOES NOT WORK CORRECTLY FOR BANNER VIEW BECAUSE BANNER VIEW DOES NOT SUPPORT TABLET FORMAT
Appodeal.setTabletBanners(false); //default - false
// Enable or disable smart banners.
// SUPORTED ONLY FOR NON-VIEW DISPLAYING
// iOS smart banners are supported only for applications where autorotation is disabled
Appodeal.setSmartBanners(false); //default - false
// Enable or disable banner refresh animation
Appodeal.setBannerAnimation(true); //default - true
// Mute calls if calls muted on Android
Appodeal.muteVideosIfCallsMuted(bool); //default - false
// Enable or disable banner auto resume screen.
// SUPORTED ONLY FOR NON-VIEW DISPLAYING
Appodeal.setAdViewAutoResume(true); //default - true
// If you want to get revenue information you can use request callback.
// Called every time when SDK receives a revenue information for an ad.
Appodeal.setAdRevenueCallbacks(onAdRevenueReceive: (adRevenue) => {});
Set callbacks listener to get track of ad lifecycle events.
Appodeal.setBannerCallbacks(
onBannerLoaded: (isPrecache) => {},
onBannerFailedToLoad: () => {},
onBannerShown: () => {},
onBannerShowFailed: () => {},
onBannerClicked: () => {},
onBannerExpired: () => {});
Appodeal.setMrecCallbacks(
onMrecLoaded: (isPrecache) => {},
onMrecFailedToLoad: () => {},
onMrecShown: () => {},
onMrecShowFailed: () => {},
onMrecClicked: () => {},
onMrecExpired: () => {});
Appodeal.setInterstitialCallbacks(
onInterstitialLoaded: (isPrecache) => {},
onInterstitialFailedToLoad: () => {},
onInterstitialShown: () => {},
onInterstitialShowFailed: () => {},
onInterstitialClicked: () => {},
onInterstitialClosed: () => {},
onInterstitialExpired: () => {});
Appodeal.setRewardedVideoCallbacks(
onRewardedVideoLoaded: (isPrecache) => {},
onRewardedVideoFailedToLoad: () => {},
onRewardedVideoShown: () => {},
onRewardedVideoShowFailed: () => {},
onRewardedVideoFinished: (amount, reward) => {},
onRewardedVideoClosed: (isFinished) => {},
onRewardedVideoExpired: () => {},
onRewardedVideoClicked: () => {});
Note: All presentation specific methods are available only after SDK initialisation
If you disable autocache you should call cache method before trying to show any ad
Appodeal.cache(AppodealAdType.Interstitial);
// Check that interstitial
var isCanShow = await Appodeal.canShow(AppodealAdType.Interstitial);
// Check that interstitial is loaded
var isLoaded = await Appodeal.isLoaded(AppodealAdType.Interstitial);
// Show interstitial
Appodeal.show(AppodealAdType.Interstitial);
// Show banner
Appodeal.show(AppodealAdType.BannerBottom); // Display banner at the bottom of the screen
Appodeal.show(AppodealAdType.BannerTop); // Display banner at the top of the screen
Appodeal.show(AppodealAdType.BannerLeft); // Display banner at the left of the screen
Appodeal.show(AppodealAdType.BannerRight); // Display banner at the right of the screen
// Show interstitial for specific pacement
Appodeal.show(AppodealAdType.Interstitial, “placementName”);
You can hide banner/MREC ad after it was shown. Call hide method with another ad types won't affect anything
Appodeal.hide(AppodealAdType.BannerTop); //AppodealAdType.MREC
To free memory from hidden banner/MREC call the code below:
Appodeal.destroy(AppodealAdType.Banner); //AppodealAdType.MREC
Display banner/MREC ad view at a custom position
Note: Ad View presentation support only fixed banners size -
320x50and300x250.
To display a Banner view add widget:
child: AppodealBanner(adSize: AppodealBannerSize.BANNER, placement: "default");
To display a MREC view add widget:
child: AppodealBanner(adSize: AppodealBannerSize.MEDIUM_RECTANGLE, placement: "default");
Note: Keep in mind that it’s best to contact qualified legal professionals, if you haven’t done so already, to get more information and be well-prepared for compliance.
The General Data Protection Regulation, better known as GDPR, took effect on May 25, 2018. It’s a set of rules designed to give EU citizens more control over their personal data. Any businesses established in the EU or with users based in Europe are required to comply with GDPR or risk facing heavy fines. The California Consumer Privacy Act (CCPA) went into effect on January 1, 2020. We have put together some resources below to help publishers understand better the steps they need to take to be GDPR compliant.
Note: You can learn more about GDPR and CCPA and their differences. differences here.
1.1 Make sure your privacy policy includes information about advertising ID collection. Don’t forget to add information about IP address and advertising ID collection, as well as the link to Appodeal’s privacy policy to your app’s privacy policy in Google Play and App Store.
To speed up the process, you could use privacy policy generators —just insert advertising ID, IP address, and location (if you collect a user’ location) in the "Personally Identifiable Information you collect" field ( in line with other information about your app) and the link to Appodeal’s privacy policy in "Link to the privacy policy of third party service providers used by the app".
1.2 Add a privacy policy to your mobile app. You must add your explicit privacy policies in two places: your app’s Store Listing page and within your app.
You can find detailed instructions on adding your privacy policy to your app on legal service websites. For example, Iubenda, the solution tailored to legal compliance, provides a comprehensive guide on including a privacy policy in your app.
Make sure that your privacy policy website has an SSL-certificate—this point might seem to be obvious, but it’s still essential.
Here’s are two useful resources that you can utilize while working on your app compliance: Privacy, Security and Deception regulations (by Google Play) Recommendations on Developing a Meaningful Privacy Policy (by Attorney General California Department of Justice)
Note: Please note that although we’re always eager to back you up with valuable information, we’re not authorized to provide any legal advice. It’s important to address your questions to lawyers who work specifically in this area.
In order for Appodeal and our ad providers to deliver ads that are more relevant to your users, as a mobile app publisher, you need to collect explicit user consent in the regions covered by GDPR and CCPA.
To get consent for collecting personal data of your users, we suggest you use a ready-made solution - Stack Consent Manager based on Google User Messaging Platform (UMP).
[!IMPORTANT] STARTING FROM APPODEAL SDK 3.0, STACK CONSENT MANAGER IS INCLUDED BY DEFAULT. Consent will be requested automatically on SDK initialization, and consent form will be shown if it is necessary without any additional calls.
If you wish, you can manage and update consent manually using Stack Consent Manager calls.
// Load consent window
Appodeal.ConsentForm.load(
appKey: exampleAppodealKey,
onConsentFormLoadSuccess: (status) {},
onConsentFormLoadFailure: (error) {},
);
// Show consent window
Appodeal.ConsentForm.show(
onConsentFormDismissed: (error) {},
);
Appodeal.ConsentForm.loadAndShowIfRequired(
appKey: exampleAppodealKey,
onConsentFormDismissed: (error) {},
);
Appodeal.ConsentForm.revoke();
US state privacy laws (CCPA, CPA, VCDPA, and others) follow an opt-out model: data processing is allowed by default, but users must be given a permanent way to opt out — typically a "Do Not Sell or Share My Personal Information" button (the Privacy Entry Point). In the US zone no form is shown on initialization; the opt-out form must be presented on demand, in response to a user tap.
Both APIs become available only after requestConsentInfoUpdate has completed (i.e. after a
load / loadAndShowIfRequired call).
Use getPrivacyOptionsRequirementStatus() to decide whether to render the opt-out button. It
returns PrivacyOptionsRequirementStatus.required for users in regulated US states and in the
EEA (for GDPR re-consent), .notRequired elsewhere, and .unknown before
requestConsentInfoUpdate has completed.
final status = await Appodeal.ConsentForm.getPrivacyOptionsRequirementStatus();
if (status == PrivacyOptionsRequirementStatus.required) {
// Show a "Do Not Sell or Share My Personal Information" / Privacy Settings button
}
Call showPrivacyOptionsForm() from the action handler of that button. This is the only way to
display the US opt-out form (or the GDPR re-consent form in the EEA), and it must be triggered by
an explicit user interaction — not at app launch.
Appodeal.ConsentForm.showPrivacyOptionsForm(
onConsentFormDismissed: (error) {
// A non-null error means the form could not be presented.
},
);
[!NOTE] Once the user interacts with the US opt-out form, Stack Consent Manager writes the corresponding
IABGPP_*keys to the platform's default storage, where ad networks read them. Before the form has been shown at least once, these keys remain empty and ad networks may treat the user as "no consent collected".
Starting from Appodeal SDK 4.3.0 the SDK ships an on-device consent-enforcement layer (IAB TCF v2.3): it resolves consent from the CMP/TCF signals and from the publisher-set value, then applies the result to the use of restricted data categories — advertising ID, location, device fingerprint and demographics.
If you collect consent yourself, or you need to force non-personalized ads regardless of what
the CMP resolved, use setNonPersonalized. The publisher-set value takes precedence over the
CMP-resolved consent, so set it before Appodeal.initialize to have it applied from the first
ad request.
// Request non-personalized ads and disable collection of data used for ad personalization.
Appodeal.setNonPersonalized(true);
The app-ads.txt file is a text file which provides a mechanism for publishers to declare their authorized digital sellers.
You can find detailed information here.
Starting in iOS 14.5, IDFA will be unavailable until an app calls the App Tracking Transparency framework to present the app-tracking authorization request to the end-user. If an app does not present this request, the IDFA will automatically be zeroed out, which may lead to a significant loss in ad revenue.
You can read more about App Tracking Transparency in our guide.
To display the App Tracking Transparency authorization request for accessing the IDFA, update your
Info.plist to add the NSUserTrackingUsageDescription key with a custom message describing the usage.
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>