Mengintegrasikan InMobi dengan mediasi

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

Daftar untuk mendapatkan akun InMobi.

Bidding

Pilih Use InMobi SSP with Google Open Bidding dan masukkan ID Penayang Google Anda.

Waterfall

Tidak ada langkah tambahan yang diperlukan untuk integrasi waterfall.

Login ke akun InMobi Anda setelah diverifikasi.

Tambahkan aplikasi

Untuk menambahkan aplikasi ke dasbor InMobi, klik Inventory > Inventory Settings.

Klik Tambahkan Inventaris dan pilih saluran Aplikasi Seluler dari menu drop-down.

Mulailah mengetik URL app store yang dipublikasikan di kotak penelusuran dan pilih aplikasi dari hasil yang terisi otomatis. Klik Continue.

Jika aplikasi Anda tidak dipublikasikan, klik Tautkan secara manual dan masukkan detail yang diperlukan. Klik Continue.

Tinjau setelan Kepatuhan Aplikasi & Situs lalu klik Simpan dan Buat Penempatan.

Penempatan

Setelah Anda menyiapkan inventaris, sistem akan mengalihkan Anda ke alur kerja pembuatan penempatan.

Bidding

Pilih jenis unit iklan. Masukkan Nama Penempatan, pilih Aktif dan Google Bidding Terbuka untuk Bidding Audiens dan Partner, lalu isi formulir lainnya. Klik Create Placement setelah selesai.

Waterfall

Pilih jenis unit iklan. Kemudian, masukkan Nama Penempatan, pilih Nonaktif untuk Bidding Audiens, dan isi formulir lainnya. Klik Create Placement setelah selesai.

Setelah penempatan dibuat, detailnya akan ditampilkan. Catat ID Penempatan, yang akan digunakan untuk menyiapkan unit iklanAdMob Anda.

ID Akun

ID akun InMobi Anda tersedia di bagian Keuangan > Setelan Pembayaran > Informasi Pembayaran.

Menemukan Kunci InMobi Reporting API

Bidding

Langkah ini tidak diperlukan untuk integrasi bidding.

Waterfall

Buka Akun Saya > Setelan Akun. Buka tab Kunci API lalu klik Buat Kunci API.

Pilih email pengguna yang memerlukan kunci, lalu klik Generate API Key. File yang berisi kunci API dan nama pengguna/nama login akan dibuat.

Hanya administrator penayang akun yang akan dapat membuat kunci API untuk semua pengguna. Jika lupa kunci API yang dibuat sebelumnya, reset kunci API dengan mengarahkan kursor ke email Anda di tab Kunci API.

Aktifkan mode pengujian

Aktifkan Mode Pengujian untuk penempatan Anda di semua tayangan iklan aktif atau perangkat pengujian tertentu saja.

Step 2: Set up InMobi demand in AdMob UI

Mengonfigurasi setelan mediasi untuk unit iklan

Android

Untuk mengetahui petunjuknya, lihat langkah 2 dalam panduan untuk Android.

iOS

Untuk mengetahui petunjuknya, lihat langkah 2 dalam panduan untuk iOS.

Add InMobi to GDPR and US state regulations ad partners list

Ikuti langkah-langkah di Setelan GDPR dan Setelan peraturan negara bagian AS untuk menambahkan InMobi ke daftar partner iklan peraturan negara bagian AS dan GDPR di UI AdMob .

Step 3: Import the InMobi SDK and adapter

Integrasi melalui pub.dev

Tambahkan dependensi berikut dengan versi terbaru InMobi SDK dan adaptor dalam paket File pubspec.yaml:

dependencies:
  gma_mediation_inmobi: ^1.0.0

Integrasi Manual

Download versi terbaru plugin mediasi Google Mobile Ads untuk InMobi, ekstrak file yang didownload, dan tambahkan folder plugin yang diekstrak (dan isinya) ke project Flutter Anda. Kemudian, rujuk plugin di pubspec.yaml dengan menambahkan dependensi berikut:

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

Aktifkan iklan percobaan

Pastikan Anda mendaftarkan perangkat pengujian Anda untuk AdMob dan mengaktifkan mode pengujian di InMobi UI.

Memverifikasi iklan percobaan

Untuk memverifikasi bahwa Anda menerima iklan pengujian dari InMobi, aktifkan pengujian sumber iklan tunggal di pemeriksa iklan menggunakan InMobi (Bidding) and InMobi (Waterfall) sumber iklan.

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.