gpt4 book ai didi

android - AdMob - 检查应用程序是否已被禁用

转载 作者:行者123 更新时间:2023-11-29 02:42:20 25 4
gpt4 key购买 nike

我想知道是否有办法检查我的应用程序是否已被禁止转换来自 AdMob 的广告。我在 Google Play 商店中发布了一个旧应用程序,该应用程序上曾经有广告,现在我开始重新开发该应用程序,并且我一直在尝试再次添加 AdMob,但没有成功。尝试在真实设备上转换广告时出现以下错误。

注意:如果我将真实设备添加为测试设备,测试广告会正确显示,测试广告也会在模拟器中正确显示。

There was a problem getting an ad response. ErrorCode: 0
Failed to load ad: 0

我一直在通过互联网上的多个线程寻找解决方案,其中一些线程建议我的应用程序已被禁用,无法从 AdMob 转换广告,我应该收到一封包含相关信息的电子邮件,此应用程序已无人看管几个月了,所以我可能丢失了那封电子邮件,我们有办法从 AdMob 控制台检查特定应用的状态吗?

注意:我的帐户在 AdMob 控制台中的状态为“打开”。

如果有帮助,这是我的应用程序当前的依赖项和代码:

Gradle 依赖:

...
compile 'com.firebaseui:firebase-ui:1.2.0'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.github.jkwiecien:EasyImage:1.3.1'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.google.firebase:firebase-ads:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
...

登录 Activity .java

...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
MobileAds.initialize(this, "ca-app-pub-X~Y");
...

主要 fragment .java

...

AdView mAdView = (AdView) view.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
...

fragment _main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.x.y.MainActivity"

android:background="@color/tw__composer_deep_gray">


<android.support.v7.widget.CardView
android:id="@+id/titleCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="10dp">

<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/usernameTitle"
android:layout_margin="10dp" />
</android.support.v7.widget.CardView>

<android.support.v7.widget.CardView
android:id="@+id/imageCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/titleCardView"
android:layout_above="@+id/adView"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="10dp">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/com_facebook_button_background"
android:id="@+id/profileImage"
android:layout_gravity="center_vertical|center_horizontal" />
</android.support.v7.widget.CardView>


<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="@string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>

最佳答案

如果您刚刚创建了一个 AdMob 广告单元,则必须等待几个小时才能使用它。

或者您只是添加了错误的广告 ID。

关于android - AdMob - 检查应用程序是否已被禁用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43249829/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com