1

私のアプリケーションには Google 広告 SDK が実装されており、キャンペーンをアプリケーションに表示することができます。つまり、広告モジュールの半分が完了しました :)

ただし、Google DFP から配信される広告を処理する以外に、外部 URL からのネイティブ広告を処理する必要があります (広告の詳細はサーバーから取得されます)。カスタム URL からネイティブ広告を取得するように Google DFP を設定する方法はありますか? 広告ネットワークの URL を提供できる VAST 広告リクエストと同様の処理を行う必要があり、DFP が残りの作業を行います (DFP は広告ネットワークとエンド ユーザー間のリクエストを処理します)。

4

1 に答える 1

2

これはあなたを助けるかもしれません:

AdLoader adLoader = new AdLoader.Builder(context, "/6499/example/native")
    .forAppInstallAd(new OnAppInstallAdLoadedListener() {
        @Override
        public void onAppInstallAdLoaded(NativeAppInstallAd appInstallAd) {
            // Show the app install ad.
        }
    })
    .forContentAd(new OnContentAdLoadedListener() {
        @Override
        public void onContentAdLoaded(NativeContentAd contentAd) {
            // Show the content ad.
        }
    })
    .withAdListener(new AdListener() {
        @Override
        public void onAdFailedToLoad(int errorCode) {
            // Handle the failure by logging, altering the UI, etc.
        }
    })
    .withNativeAdOptions(new NativeAdOptions.Builder()
            // Methods in the NativeAdOptions.Builder class can be
            // used here to specify individual options settings.
            .build())
    .build();

ここで完全な「チュートリアル」を見つけることができます。

于 2016-09-02T07:38:13.027 に答える