简体   繁体   English

原生广告测试

[英]native ad appodeal test

i just learn native ad with simple code and try to test run appodeal native ad. 我只是用简单的代码学习原生广告,然后尝试测试运行adodeal原生广告。 but theres no test-ad showd. 但没有显示测试广告。

    Appodeal.setAutoCache(Appodeal.NATIVE, false);
    Appodeal.initialize(this, "apikey", Appodeal.NATIVE);
    Appodeal.cache(this, Appodeal.NATIVE);
    Appodeal.setNativeCallbacks(new NativeCallbacks() {
        @Override
        public void onNativeLoaded() {
            Toast.makeText(MainActivity.this, "onNativeLoaded", Toast.LENGTH_SHORT).show();
         }

        @Override
        public void onNativeFailedToLoad() {
            Toast.makeText(MainActivity.this, "onNativeFailedToLoad", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onNativeShown(NativeAd nativeAd) {
            Toast.makeText(MainActivity.this, "onNativeShown", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onNativeClicked(NativeAd nativeAd) {
            Toast.makeText(MainActivity.this, "onNativeClicked", Toast.LENGTH_SHORT).show();
        }
    });
    Appodeal.getNativeAds(1);
    com.appodeal.ads.native_ad.views.NativeAdViewContentStream nav_cs = this.findViewById(R.id.native_ad_view_content_stream);
    nav_cs.setNativeAd(nativeAd);

what is wrong? 怎么了? whats my mistake? 我怎么了?

To enable test ads in Appodeal add this line to your code: Appodeal.setTesting(true); 要在Appodeal中启用测试广告,请将此行添加到您的代码中: Appodeal.setTesting(true);

This will enable test ads not only for the native Appodeal ads, but for all the ad types: banners, interstitials, etc. 这样,不仅可以针对本地Appodeal广告,还可以针对所有广告类型(横幅广告,插页式广告等)启用测试广告。

Looks like you need more time to load ads. 您似乎需要更多时间来加载广告。 Usually it takes about 20 - 60 second. 通常大约需要20-60秒。

In his case, you can try to use the following code: https://pastebin.com/Wbe0V6fm 在他的情况下,您可以尝试使用以下代码: https://pastebin.com/Wbe0V6fm : https://pastebin.com/Wbe0V6fm

Also, check our demo project: https://github.com/appodeal/appodeal-android-demo Class: https://github.com/appodeal/appodeal-android-demo/blob/master/app/src/main/java/com/appodeal/test/AppodealWrapperAdapter.java 另外,请检查我们的演示项目: https://github.com/appodeal/appodeal-android-demo : https://github.com/appodeal/appodeal-android-demo类: https://github.com/appodeal/appodeal-android-demo/blob/master/app/src/main/java/com/appodeal/test/AppodealWrapperAdapter.java : https://github.com/appodeal/appodeal-android-demo/blob/master/app/src/main/java/com/appodeal/test/AppodealWrapperAdapter.java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM