This guide shows you how to use the Google Mobile Ads SDK to load and display ads from ironSource using mediation, covering waterfall integrations. It covers how to add ironSource to an ad unit's mediation configuration, and how to integrate the ironSource SDK and adapter into a Flutter app.
Supported integrations and ad formats
The AdMob mediation adapter for ironSource has the following capabilities:
Integration | |
---|---|
Bidding | |
Waterfall | |
Formats | |
Banner | |
Interstitial | |
Rewarded | |
Rewarded Interstitial |
Requirements
- Latest Google Mobile Ads SDK
- Flutter 3.7.0 or higher
- To deploy on Android
- Android API level 21 or higher
- To deploy on iOS
- iOS deployment target of 12.0 or higher
- A working Flutter project configured with Google Mobile Ads SDK. See Get Started for details.
- Complete the mediation Get started guide
Step 1: Set up configurations in ironSource UI
如需将应用添加到 ironSource 信息中心,请点击 New App 按钮。
输入应用详情
选择 Live App,输入应用的 网址,然后点击 Import App Info。
如果您的应用不可用,请选择 App Not Live in the App Store 并为您的应用提供一个临时名称。选择您的平台。
填写表单的其余部分,然后点击添加应用。
记下新的应用密钥,它在添加应用后显示。在设置广告单元 ID 时,您需要使用此值。AdMob 选择您的应用支持的广告格式。然后点击继续。
Android
iOS
创建实例
接下来,为您添加的应用配置网络实例;ironSource 支持为激励广告和插页式广告使用多个网络实例。
依次前往广告 > 设置 > 实例。选择该应用,然后点击创建实例。
输入必要的详细信息,然后点击保存并关闭。
创建实例后,实例 ID 字段中会列出实例 ID。
除了应用密钥和实例 ID 之外,您还需要 ironSource 密钥和刷新令牌来设置您的AdMob 广告单元 ID。
前往 ironSource 发布商信息中心中的我的帐号,然后点击 API 标签页。记下您的密钥和刷新令牌。
开启测试模式
请按照 ironSource 的集成测试指南中的说明启用 ironSource 测试广告。
Step 2: Set up ironSource demand in AdMob UI
Configurer les paramètres de médiation pour votre bloc d'annonces
Android
Pour obtenir des instructions, consultez l'étape 2 du guide pour Android.
iOS
Pour obtenir des instructions, reportez-vous à l'étape 2 du guide pour iOS.
Add ironSource Mobile to GDPR and US state regulations ad partners list
Suivez les étapes indiquées dans Paramètres RGPD et Paramètres des réglementations des États américains pour ajouter ironSource Mobile à la liste des partenaires publicitaires sur le RGPD et les réglementations des États américains dans l' AdMob UI.
Step 3: Import the ironSource SDK and adapter
Intégration via pub.dev
(Android uniquement) Ajoutez les dépôts suivants au fichier build.gradle
, qui se trouve dans le répertoire android
de votre projet:
repositories {
google()
mavenCentral()
maven {
url = uri("https://android-sdk.is.com/")
}
}
Ajoutez la dépendance suivante avec les dernières versions du SDKironSource et de l'adaptateur dans le fichier pubspec.yaml
de votre package:
dependencies:
gma_mediation_ironsource: ^1.0.0
Intégration manuelle
Téléchargez la dernière version du plug-in de médiation Google Mobile Ads pour ironSource, extrayez le fichier téléchargé, puis ajoutez le dossier du plug-in extrait (et son contenu) à votre projet Flutter. Ensuite, référencez le plug-in dans votre fichier pubspec.yaml
en ajoutant la dépendance suivante:
dependencies:
gma_mediation_ironsource:
path: path/to/local/package
Step 4: Implement privacy settings on ironSource SDK
EU Consent and GDPR
Under the Google EU User Consent Policy, you must ensure that certain disclosures are given to, and consents obtained from, users in the European Economic Area (EEA) regarding the use of device identifiers and personal data. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). When seeking consent, you must identify each ad network in your mediation chain that may collect, receive, or use personal data and provide information about each network's use. Google currently is unable to pass the user's consent choice to such networks automatically.
The Google Mobile Ads mediation plugin for ironSource
includes the
GmaMediationIronsource().SetConsent()
method. The following sample code shows how to pass
consent information to the ironSource SDK. If you choose to call this method, it
is recommended that you do so prior to requesting ads through the Google Mobile
Ads SDK.
import 'package:gma_mediation_ironsource/gma_mediation_ironsource.dart';
// ...
GmaMediationIronsource().setConsent(true);
See ironSource's documentation on Regulation Advanced Settings for more details.
US state privacy laws
U.S. states privacy laws require giving users the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered via a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The U.S. states privacy laws compliance guide offers the ability to enable restricted data processing for Google ad serving, but Google is unable to apply this setting to each ad network in your mediation chain. Therefore, you must identify each ad network in your mediation chain that may participate in the sale of personal information and follow guidance from each of those networks to ensure compliance.
The Google Mobile Ads mediation plugin for ironSource
includes the
GmaMediationIronsource().setDoNotSell
method. The following sample code shows how to pass
consent information to the ironSource SDK. These options must be set before you
initialize the Google Mobile Ads
SDK
to ensure they get forwarded properly to the ironSource SDK.
import 'package:gma_mediation_ironsource/gma_mediation_ironsource.dart';
// ...
GmaMediationIronsource().setDoNotSell(true);
See ironSource's documentation on Regulation Advanced Settings for both Android and iOS for more details and the values that can be provided in the method.
Step 5: Add required code
Android
Proguard Rules
If you shrink, obfuscate, and optimize your app, IronSource requires additional ProGuard rules for your project.
Consult
IronSource's Android SDK Integration guide
for more information on what ProGuard rules are required for your project,
and add those rules to your proguard-user.txt
file.
Application lifecycle
Override the onPause()
and onResume()
methods in each of
your activities to call the corresponding ironSource methods as follows:
Java
@Override
public void onResume() {
super.onResume();
IronSource.onResume(this);
}
@Override
public void onPause() {
super.onPause();
IronSource.onPause(this);
}
Kotlin
public override fun onResume() {
super.onResume()
IronSource.onResume(this)
}
public override fun onPause() {
super.onPause()
IronSource.onPause(this)
}
iOS
SKAdNetwork integration
Follow IronSource's documentation to add the SKAdNetwork identifiers to your
project's Info.plist
file.
Step 6: Test your implementation
Activer les annonces tests
Veillez à enregistrer votre appareil de test pour AdMob et à activer le mode test dans l' ironSource UI.
Valider les annonces tests
Pour vérifier que vous recevez des annonces tests deironSource, activez le test d'une source d'annonce unique dans l'inspecteur d'annonces à l'aide de ironSource (Waterfall) sources d'annonces.
Error codes
If the adapter fails to receive an ad from ironSource, publishers can check the
underlying error from the ad response using
ResponseInfo
under the
following classes:
Android
com.google.ads.mediation.ironsource.IronSourceAdapter
com.google.ads.mediation.ironsource.IronSourceRewardedAdapter
iOS
GADMAdapterIronSource
GADMAdapterIronSourceRewarded
Here are the codes and accompanying messages thrown by the ironSource adapter when an ad fails to load:
Android
Error code | Reason |
---|---|
101 | ironSource server parameters configured in the AdMob UI are missing/invalid. |
102 | ironSource requires an Activity context to initialize their SDK. |
103 | ironSource can only load 1 ad per ironSource instance ID. |
105 | The requested banner ad size is not supported by ironSource. |
106 | ironSource SDK is not initialized. |
501-1056 | ironSource SDK Errors. See documentation for more details. |
iOS
Error code | Reason |
---|---|
101 | ironSource server parameters configured in the AdMob UI are missing/invalid. |
102 | ironSource Adapter does not support the ad format being requested. |
103 | An ironSource ad is already loaded for this network configuration. |
104 | The requested banner ad size is not supported by ironSource. |
508-1037 | ironSource SDK Errors. See documentation for more details. |
ironSource Flutter Mediation Adapter Changelog
1.0.0
- Initial release.
- Verified compatibility with ironSource Android adapter version 8.0.0.0
- Verified compatibility with ironSource iOS adapter version 8.0.0.0.0
- Built and tested with the Google Mobile Ads Flutter Plugin version 5.1.0.