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: 3.3.1
Install the plugin by running the command below in the terminal:
$ flutter pub get
[!IMPORTANT]
- iOS 12.0 or higher. You still can integrate Appodeal SDK into a project with a lower value of minimum iOS version. However, on devices that don't support iOS 12.0+ our SDK will just be disabled.
- Appodeal SDK is compatible with both ARC and non-ARC projects.
- Use Xcode 14.3 or higher.
ios/
folder and open Podfile./ios/Podfile
:source 'https://cdn.cocoapods.org'
source 'https://github.com/appodeal/CocoaPods.git'
source 'https://github.com/bidon-io/CocoaPods_Specs.git'
platform :ios, '13.0'
use_frameworks!
def appodeal
pod 'Appodeal', '3.3.1'
pod 'APDAmazonAdapter', '3.3.1.0'
pod 'APDAppLovinAdapter', '3.3.1.0'
pod 'APDAppLovinMAXAdapter', '3.3.1.0'
pod 'APDBidMachineAdapter', '3.3.1.0'
pod 'APDBidonAdapter', '3.3.1.0'
pod 'APDBigoAdsAdapter', '3.3.1.0'
pod 'APDDTExchangeAdapter', '3.3.1.0'
pod 'APDGoogleAdMobAdapter', '3.3.1.0'
pod 'APDIABAdapter', '3.3.1.0'
pod 'APDInMobiAdapter', '3.3.1.0'
pod 'APDIronSourceAdapter', '3.3.1.0'
pod 'APDMetaAudienceNetworkAdapter', '3.3.1.0'
pod 'APDMintegralAdapter', '3.3.1.0'
pod 'APDMyTargetAdapter', '3.3.1.0'
pod 'APDPangleAdapter', '3.3.1.0'
pod 'APDSentryAdapter', '3.3.1.0'
pod 'APDUnityAdapter', '3.3.1.0'
pod 'APDVungleAdapter', '3.3.1.0'
pod 'APDYandexAdapter', '3.3.1.0'
pod 'AmazonPublisherServicesSDK', '4.9.2'
pod 'AppLovinMediationAmazonAdMarketplaceAdapter'
pod 'AppLovinMediationBidMachineAdapter'
pod 'AppLovinMediationFacebookAdapter'
pod 'AppLovinMediationFyberAdapter'
pod 'AppLovinMediationGoogleAdManagerAdapter'
pod 'AppLovinMediationGoogleAdapter'
pod 'AppLovinMediationInMobiAdapter'
pod 'AppLovinMediationIronSourceAdapter'
pod 'AppLovinMediationMintegralAdapter', '7.6.1.0.0'
pod 'AppLovinMediationMyTargetAdapter', '5.20.1.1'
pod 'AppLovinMediationUnityAdsAdapter'
pod 'AppLovinMediationVungleAdapter', '7.3.0.0'
pod 'AppLovinMediationYandexAdapter', '5.2.1.0'
pod 'BidMachineAmazonAdapter', '2.6.0.1'
pod 'BidMachineMetaAudienceAdapter', '2.6.0.0'
pod 'BidMachineMintegralAdapter', '2.6.0.0'
pod 'BidMachineMyTargetAdapter', '2.6.0.0'
pod 'BidMachinePangleAdapter', '2.6.0.0'
pod 'BidMachineVungleAdapter', '2.6.0.0'
pod 'BidonAdapterAmazon', '0.4.8.0'
pod 'BidonAdapterAppLovin', '0.4.8.0'
pod 'BidonAdapterBidMachine', '0.4.8.0'
pod 'BidonAdapterBigoAds', '0.4.8.0'
pod 'BidonAdapterDTExchange', '0.4.8.0'
pod 'BidonAdapterGoogleAdManager', '0.4.8.0'
pod 'BidonAdapterGoogleMobileAds', '0.4.8.0'
pod 'BidonAdapterInMobi', '0.4.8.0'
pod 'BidonAdapterMetaAudienceNetwork', '0.4.8.0'
pod 'BidonAdapterMintegral', '0.4.8.0'
pod 'BidonAdapterUnityAds', '0.4.8.0'
pod 'BidonAdapterVungle', '0.4.8.0'
pod 'myTrackerSDK', '3.1.7'
end
target 'Runner' do
use_frameworks!
use_modular_headers!
appodeal
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
You can change following implementation to use custom mediation setup. See docs.
Note: Appodeal requires to use
use_frameworks!
. You need to remove Flipper dependency from Podfile and AppDelegate.
pod install
.xcworkspace
info.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
.
In order to serve ads, the SDK requires you to allow arbitrary loads. Set up the following keys
in Info.plist
of your app:
To improve ad performance the following entries should be added:
[!IMPORTANT]
- Android API level 21 (Android OS 5.0) or higher.
Add dependencies into build.gradle
(module: app)
dependencies {
// ... other project dependencies
implementation ('com.appodeal.ads:sdk:3.3.1.0') {
exclude group: 'com.appodeal.ads.sdk.services', module: 'adjust'
exclude group: 'com.appodeal.ads.sdk.services', module: 'appsflyer'
exclude group: 'com.appodeal.ads.sdk.services', module: 'firebase'
exclude group: 'com.appodeal.ads.sdk.services', module: 'facebook_analytics'
}
...
}
Add repository into build.gradle
(module: project)
allprojects {
repositories {
...
jcenter()
maven { url "https://artifactory.appodeal.com/appodeal" }
...
}
}
Note: You can change following implementation to use custom mediation setup. See Docs.
Add the Network Security Configuration file to your AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application
...
android:networkSecurityConfig="@xml/network_security_config">
</application>
</manifest>
In your network_security_config.xml file, add base-config
that sets cleartextTrafficPermitted
to true
:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="https://github.com/appodeal/Appodeal-Flutter-Plugin/raw/main/system" />
</trust-anchors>
</base-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>
</network-security-config>
[!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)
dependencies {
...
// ... other project dependencies
implementation('com.appodeal.ads:sdk:3.3.1.0') {
// ad networks
exclude group: "com.appodeal.ads.sdk.networks", module: "admob"
exclude group: "org.bidon", module: "admob-adapter"
exclude group: "org.bidon", module: "gam-adapter"
exclude group: "com.applovin.mediation", module: "google-adapter"
exclude group: "com.applovin.mediation", module: "google-ad-manager-adapter"
// services
exclude group: 'com.appodeal.ads.sdk.services', module: 'adjust'
exclude group: 'com.appodeal.ads.sdk.services', module: 'appsflyer'
exclude group: 'com.appodeal.ads.sdk.services', module: 'firebase'
exclude group: 'com.appodeal.ads.sdk.services', module: 'facebook_analytics'
}
...
}
Remove next pods from Podfile
:
pod 'APDGoogleAdMobAdapter', '3.3.1.0'
pod 'BidonAdapterGoogleAdManager', '0.4.8.0'
pod 'BidonAdapterGoogleMobileAds', '0.4.8.0'
pod 'AppLovinMediationGoogleAdManagerAdapter'
pod 'AppLovinMediationGoogleAdapter'
Please, read iOS and Android docs at wiki to get deeper understanding how Appodeal SDK Services works.
Add dependencies into build.gradle (module: app)
dependencies {
// ... other project dependencies
implementation 'com.appodeal.ads.sdk.services:adjust:3.3.1.0'
}
Add dependencies into Podfile
def appodeal
// ... other project pods
pod 'APDAdjustAdapter', '3.3.1.0'
end
Add dependencies into build.gradle (module: app)
dependencies {
// ... other project dependencies
implementation 'com.appodeal.ads.sdk.services:appsflyer:3.3.1.0'
}
Add dependencies into Podfile
def appodeal
// ... other project pods
pod 'APDAppsFlyerAdapter', '3.3.1.0'
end
Add dependencies into build.gradle (module: app)
dependencies {
// ... other project dependencies
implementation 'com.appodeal.ads.sdk.services:firebase:3.3.1.0'
}
Add dependencies into Podfile
def appodeal
// ... other project pods
pod 'APDFirebaseAdapter', '3.3.1.0'
end
Add dependencies into build.gradle (module: app)
dependencies {
// ... other project dependencies
implementation 'com.appodeal.ads.sdk.services:facebook_analytics:3.3.1.0'
}
Add dependencies into Podfile
def appodeal
// ... other project pods
pod 'APDFacebookAdapter', '3.3.1.0'
end
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 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
});
Please, 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 initilisation
// 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 threatment
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 -
320x50
and300x250
.
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 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();
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>