Integrare InMobi con la mediazione

This guide shows you how to use the Google Mobile Ads SDK to load and display ads from InMobi using mediation, covering both waterfall and bidding integrations. It covers how to add InMobi to an ad unit's mediation configuration, and how to integrate the InMobi SDK and adapter into a Flutter app.

Supported integrations and ad formats

Integration
Bidding  1
Waterfall
Formats
Banner
Interstitial
Rewarded
Native  2

1 Bidding integration is in closed beta, reach out to your account manager to request access.

2 Supported only for waterfall mediation.

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 10.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 InMobi UI

Registrati per creare un account InMobi.

Offerte

Seleziona Utilizza l'SSP InMobi con Google Open Bidding e inserisci il tuo ID publisher di Google.

Struttura a cascata

Non sono necessari passaggi aggiuntivi per le integrazioni con struttura a cascata.

Al termine della verifica, accedi al tuo account InMobi.

Aggiungi un'app

Per aggiungere la tua app alla dashboard InMobi, fai clic su Inventario > Impostazioni inventario.

Fai clic su Aggiungi inventario e seleziona il canale App mobile dal menu a discesa.

Inizia a digitare l'URL dello store pubblicato nella barra di ricerca e seleziona l'app dai risultati compilati automaticamente. Fai clic su Continua.

Se la tua app non è pubblicata, fai clic su Collega manualmente e inserisci i dettagli richiesti. Fai clic su Continua.

Esamina le impostazioni di Conformità di app e siti web, quindi fai clic su Salva e crea posizionamenti.

Posizionamenti

Dopo aver configurato l'inventario, il sistema ti reindirizza al flusso di lavoro di creazione del posizionamento.

Offerte

Seleziona il tipo di unità pubblicitaria. Inserisci un Nome posizionamento, seleziona On e Google Open Bidding rispettivamente per Offerte del pubblico e Partner e compila il resto del modulo. Al termine, fai clic su Crea posizionamento.

Struttura a cascata

Seleziona il tipo di unità pubblicitaria. A questo punto, inserisci un Nome posizionamento, seleziona Off per Offerte del pubblico e compila il resto del modulo. Al termine, fai clic su Crea posizionamento.

Una volta creato il posizionamento, vengono visualizzati i relativi dettagli. Prendi nota dell'ID posizionamento, che verrà utilizzato per configurare l'AdMob unità pubblicitaria.

ID account

Il tuo ID account InMobi è disponibile in Finanza > Impostazioni pagamenti > Dati di pagamento.

Individuare la chiave API InMobi Reporting

Offerte

Questo passaggio non è obbligatorio per le integrazioni dell'asta.

Struttura a cascata

Vai a Account personale > Impostazioni account. Vai alla scheda Chiave API e fai clic su Genera chiave API.

Seleziona l'indirizzo email dell'utente per il quale è richiesta la chiave e fai clic su Genera chiave API. Verrà generato un file contenente la chiave API e il nome utente/nome di accesso.

Solo l'amministratore dell'editore dell'account potrà generare una chiave API per tutti gli utenti. Se hai dimenticato la chiave API generata in precedenza, reimpostala passando il mouse sopra la posta nella scheda Chiave API.

Attivare la modalità di test

Attiva la modalità di test per il tuo posizionamento solo su tutte le impressioni in tempo reale o solo su determinati dispositivi di test.

Step 2: Set up InMobi demand in AdMob UI

Configurare le impostazioni di mediazione per l'unità pubblicitaria

Android

Per le istruzioni, consulta il passaggio 2 della guida per Android.

iOS

Per le istruzioni, consulta il passaggio 2 nella guida per iOS.

Add InMobi to GDPR and US state regulations ad partners list

Segui i passaggi descritti in Impostazioni GDPR e Impostazioni relative alle normative statali degli Stati Uniti per aggiungere InMobi all'elenco di partner pubblicitari per le normative GDPR e statali degli Stati Uniti nell' AdMob UI.

Step 3: Import the InMobi SDK and adapter

通过 pub.dev 进行集成

将以下依赖项与最新版本的 InMobi 软件包的 pubspec.yaml 文件:

dependencies:
  gma_mediation_inmobi: ^1.0.0

手动集成

下载针对以下指标的最新版 Google 移动广告中介插件: InMobi、 将下载的文件解压缩,然后添加提取的插件文件夹 (及其内容)添加到您的 Flutter 项目中。然后,在 pubspec.yaml 文件,通过添加以下依赖项:

dependencies:
  gma_mediation_inmobi:
    path: path/to/local/package

Step 4: Implement privacy settings on InMobi SDK

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 InMobi does not support passing consent information to the InMobi SDK.

US states 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 InMobi does not support passing consent information to the InMobi SDK.

Step 5: Add required additional code

Android

No additional code is required InMobi integration.

iOS

SKAdNetwork integration

Follow InMobi's documentation to add the SKAdNetwork identifiers to your project's Info.plist file.

Step 6: Test your implementation

Attiva annunci di prova

Assicurati di registrare il dispositivo di test per AdMob e abilitare la modalità di test nell'interfaccia InMobi UI.

Verifica annunci di prova

Per verificare di ricevere annunci di prova daInMobi, attiva il test di una singola origine annuncio nello strumento di controllo degli annunci utilizzando le InMobi (Bidding) and InMobi (Waterfall) origini annuncio.

Optional steps

Android

Permissions

For optimal performance, InMobi recommends adding the following optional permissions to your app's AndroidManifest.xml file.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

You may optionally add these permissions to the Plugins/Android/GoogleMobileAdsInMobiMediation/AndroidManifest.xml file.

iOS

No additional steps required for iOS integration.

Error codes

If the adapter fails to receive an ad from InMobi, publishers can check the underlying error from the ad response using ResponseInfo under the following classes:

Android

com.google.ads.mediation.inmobi.InMobiAdapter
com.google.ads.mediation.inmobi.InMobiMediationAdapter

iOS

GADMAdapterInMobi
GADMediationAdapterInMobi

Here are the codes and accompanying messages thrown by the InMobi adapter when an ad fails to load:

Android

Error code Reason
0-99 InMobi SDK Errors. See code for more details.
100 InMobi server parameters configured in the AdMob UI are missing/invalid.
101 Failed to initialize the InMobi SDK.
102 The requested ad size does not match an InMobi supported banner size.
103 Ad request is not a unified native ad request.
104 Attempted to request an InMobi ad without initializing the InMobi SDK. This should in theory never happen since the adapter initializes the InMobi SDK prior to requesting InMobi ads.
105 InMobi's ad is not yet ready to be shown.
106 InMobi failed to display an ad.
107 InMobi returned a native ad that is missing a required asset.
108 InMobi's native ad image assets contain a malformed URL.
109 The adapter failed to download InMobi's native ad image assets.

iOS

Error code Reason
101 InMobi server parameters configured in the AdMob UI are missing/invalid.
102 InMobi Adapter does not support the ad format being requested.
103 An InMobi ad is already loaded for this network configuration.
Other InMobi SDK returned an error. See IMRequestStatus.h for more details.

InMobi Flutter Mediation Adapter Changelog

1.0.0

  • Initial release.
  • Verified compatibility with InMobi Android adapter version 10.6.7.1.
  • Verified compatibility with InMobi iOS adapter version 10.7.2.0.
  • Built and tested with the Google Mobile Ads Flutter Plugin version 5.1.0.