簡體   English   中英

Admob在Android Studio中顯示測試廣告,但在Google Play中完全沒有廣告

[英]Admob shows Test ads in android studio but no ads at all in google play

表現

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="hightimes.fourtwenty">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="4:20"
    android:theme="@style/AppTheme" >
    <!--This meta-data tag is required to use Google Play Services.-->
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
    <activity android:name=".MainActivity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <!--Include the AdActivity configChanges and theme. -->
    <activity android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme="@android:style/Theme.Translucent" />
</application>

java的

MobileAds.initialize(this,"@string/banner_app_id");

mAdView = (AdView) findViewById(R.id.myAdView);

AdRequest adRequest = new AdRequest.Builder()

.build();


mAdView.loadAd(adRequest);

布局文件

    <com.google.android.gms.ads.AdView
    android:id="@+id/myAdView"
    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"
    />

Gradle腳本文件

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.android.support:design:23.4.0'
}


apply plugin: 'com.google.gms.google-services'

使用android studio可以很好地加載測試廣告,而在不同的測試設備和位置上完全不會展示實時Google Play廣告。 我在admob應用程序管理頁面內鏈接了該廣告,它顯示為1個活動廣告。 我正在使用admob生成的appID和adunitID,並且還包含google-services.json文件。我唯一能想到的是,廣告需要花費幾天的時間來填充,或者我的應用程序顯示與毒品相關的材料,它的評分為+18,但我從未收到admob的通知,也沒有看到任何帳戶被暫停的信息。 感謝您對高級的任何幫助!

MobileAds.initialize(此, “@串/ banner_app_id”);

您正在傳遞字符串“ @ string / banner_app_id”作為應用程序ID。

要查找與您的應用程序對應的應用程序ID,請在AdMob帳戶頁面上的設置下拉菜單(位於右上角)下單擊“應用程序管理”選項。 應用程序ID的格式為ca-app-pub-XXXXXXXXXXXXXXXX〜NNNNNNNNNN。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM