1

我的应用程序实现了 Google Ads SDK,并且我能够在应用程序中显示我的广告系列 - 所以我的广告模块完成了一半 :)

但是,除了处理从 Google DFP 投放的广告外,我还需要处理来自外部 URL 的原生广告(广告详细信息将从我的服务器获取)。有什么方法可以配置 Google DFP 从我的自定义 URL 获取原生广告?我需要做一些类似于 VAST 广告请求的事情,我可以在其中提供广告网络的 URL,而 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 回答