【问题标题】:Admob Native Ads Not showing in AndroidAdmob 原生广告未在 Android 中显示
【发布时间】:2016-09-07 20:08:35
【问题描述】:

我正在尝试在我的 Android 应用中加载 Admob 原生广告。但他们没有表现出来。我无法理解这个问题。请通过下面的代码。

注意:我正在使用 Admob 原生广告,广告尺寸为“280x132”

XML 文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.radioaudio.motivationalaudios.MyYouTubePlayer">

    <com.google.android.youtube.player.YouTubePlayerView
        android:id="@+id/youtube_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/videoTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:text="Arise, Awake and stop not till the truth is known - Radio Story | IIT Kanpur Radio"
        android:textColor="#000"
        android:textSize="20dp" />

    <com.google.android.gms.ads.NativeExpressAdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ads:adUnitId="ca-app-pub-5059726881726792/7013814664"
        ads:adSize="280x132">
    </com.google.android.gms.ads.NativeExpressAdView>

</LinearLayout>

Java 文件

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_youtube_player);
        //Admob Ad
        NativeExpressAdView adView = (NativeExpressAdView) findViewById(R.id.adView);

        AdRequest request = new AdRequest.Builder()
                .addTestDevice("A5E3E2068BD88202CBC281AD76984BEE")
                .build();
        adView.loadAd(request);
    }

【问题讨论】:

  • 也请分享您的日志。过滤广告
  • 您好,您找到解决方案了吗?

标签: android admob


【解决方案1】:

原生广告需要时间才能展示。所以请等待2-3小时。它们会自动弹出。

【讨论】:

    【解决方案2】:

    在此处添加更多日志,以便我们了解。尝试关闭并在一段时间后再次打开您的应用程序。如果它不能解决可能是日志可以帮助我们。

    另外供您参考,当我们的布局中有 YouTube 播放器视图时,我们无法展示广告。这就是你所拥有的。这是我在 Play Store 上发布我的应用时遇到的问题之一。

    这有点像两种获利方式: 1.在播放器视频中会显示广告 2. 同时展示banner/原生广告

    Google 方面不允许这样做。

    这也可能是一个问题,没有显示广告。 祝你好运

    【讨论】:

      【解决方案3】:

      您永远不能在同一页面上与 youtube 或任何属于 google 的服务一起展示广告。

      【讨论】:

        猜你喜欢
        • 2016-10-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-06-09
        相关资源
        最近更新 更多