Skip to content

AdExchange動画リワード

tateo-okubo edited this page Sep 12, 2019 · 12 revisions

対応OS

iOS 8.0以上

Google Mobile Ads SDKは7.28.0以上をご利用ください

AdExchange動画リワード広告と動画リワード広告、インタースティシャル広告を併用している皆さまへ

こちらより、Ad Unit IDに紐づくadstirの枠Noを 動画広告の初期化時に同時に初期化をするようにお願いします。

対応提携ネットワークについて

対応提携ネットワークについてはこちらをご覧ください。

利用準備

初期設定

adstir SDKを導入する

初期設定をご覧になり、adstir SDKをプロジェクトへ導入してください。 対応提携ネットワークを導入する場合はこちらを参考に対応提携ネットワークを導入してください。

GoogleMobileAdsを導入する

adstir SDKと、対応提携ネットワークを導入後、以下の手順でGoogleMobileAdsを導入します。

  • 手動でSDKを導入していた場合

    1. GoogleMobileAds.frameworklibAdMobMediationAdapter-AdstirAds.aを、プロジェクト内の任意の箇所にドラッグ&ドロップします。
    2. Copy items if neededにチェックを入れます。
    3. Add to targets欄で、adstir SDKを利用するすべてのターゲットにチェックを入れます。
    4. Finishをクリックします。
  • CocoaPodsを利用して導入していた場合

    • pod 'AdStir-Ads-SDK-VideoAdSDKBundled/AdMob-MediationAdapter', :path => 'AdstirAdsSdkiOS-x.x.x-VideoAdSDKBundled' を追加します。

CocoaPodsの例

# Uncomment the next line to define a global platform for your project
platform :ios, "8.0"
pod 'AdStir-Ads-SDK-VideoAdSDKBundled/All-Incentivized', :path => 'AdstirAdsSdkiOS-x.x.x-VideoAdSDKBundled'
pod 'AdStir-Ads-SDK-VideoAdSDKBundled/AdMob-MediationAdapter', :path => 'AdstirAdsSdkiOS-x.x.x-VideoAdSDKBundled'
target 'projectname' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for projectname

end

SDKの実装例

// 下記のインポートが必要です
@import GoogleMobileAds;

@interface ViewController () <GADRewardBasedVideoAdDelegate>
@end

@implementation ViewController

- (void)viewDidLoad
{
    // デリゲートは必要に応じて実装してください
    // See also: https://developers.google.com/mobile-ads-sdk/docs/adx/ios/api/reference/Protocols/GADRewardBasedVideoAdDelegate
    [GADRewardBasedVideoAd sharedInstance].delegate = self;
    // 実際に使用するAd Unit Idは営業担当者から別途お知らせ致します。
    [[GADRewardBasedVideoAd sharedInstance] loadRequest:[DFPRequest request]
                                           withAdUnitID:@"xxxxxxxxxxxxxxxxxxxxxxxx"];
}

#pragma mark GADRewardBasedVideoAdDelegate implementation

- (void)rewardBasedVideoAdDidReceiveAd:(GADRewardBasedVideoAd *)rewardBasedVideoAd {
    if ([[GADRewardBasedVideoAd sharedInstance] isReady]) {
        [[GADRewardBasedVideoAd sharedInstance] presentFromRootViewController:self];
    }
}

- (void)rewardBasedVideoAdDidOpen:(GADRewardBasedVideoAd *)rewardBasedVideoAd {
}

- (void)rewardBasedVideoAdDidStartPlaying:(GADRewardBasedVideoAd *)rewardBasedVideoAd {
}

- (void)rewardBasedVideoAdDidClose:(GADRewardBasedVideoAd *)rewardBasedVideoAd {
}

- (void)rewardBasedVideoAd:(GADRewardBasedVideoAd *)rewardBasedVideoAd
}

- (void)rewardBasedVideoAdWillLeaveApplication:(GADRewardBasedVideoAd *)rewardBasedVideoAd {
}

- (void)rewardBasedVideoAd:(GADRewardBasedVideoAd *)rewardBasedVideoAd {
}

詳細はgoogleのドキュメントをご覧ください。

Clone this wiki locally