1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AdMob + メディエーションでFacebook Audience Network(FAN)を使う

Posted at

ときにハマったので、書いておきます。

使った広告ユニット: Navive Advanced

導入

以下のドキュメントに従う。
Integrating Facebook Audience Network with Mediation  |  AdMob for iOS  |  Google Developers
AdMobやFANで適切な設定をしたあと、 pod 'GoogleMobileAdsMediationFacebook' を追加してうごかす。

googleads-mobile-ios-examples にサンプルコードがあるので、まずはこれを利用して試すのが良いです。(FANの広告を確認するには実機が必要)

わかったこと

  • メディエーションを使う場合はadtypeを2つのtype両方で指定しないといけない
    NSArray *adTypes = [[NSMutableArray alloc] initWithArray:@[kGADAdLoaderAdTypeNativeAppInstall, kGADAdLoaderAdTypeNativeContent]];

  • 以下のような GADRequestの testDevices を設定していると出てこないので、もし設定していたら外すこと
    request.testDevices = @[kGADSimulatorID, ...]

  • メディエーションで得られる広告は必ず GADNativeAppInstallAd になる(内容がContentAdだとしてもこれになる)

  • ドキュメントには

Toggle the Carousel Ads switch and Video Ads switch to Off.

と書いてあるけど、VideoをONにしたら動画のある広告も出てきた

参考

ハマった末に、SDKサポートのGoogleグループに投稿しました。
https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/ios/rGV5Rxo0-xY
わりとすぐに返信がもらえて、解決できたので良かったです

SDK versions from Podfile

  - Google-Mobile-Ads-SDK (7.24.1)
  - GoogleMobileAdsMediationFacebook (4.26.0.0):
    - FBAudienceNetwork (= 4.26.0)
    - Google-Mobile-Ads-SDK (>= 7.12.0)
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?