Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not Showing Firebase Test Native Express ads, getting only live ads, also how to make Native express ads fit the width?

i have set test device sill getting live ads..

mAdView = (NativeExpressAdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
    .addTestDevice("722378CE522E161F0EFAD13A658F5161")
    .addTestDevice("048B0A7DC3863535720E0C21AC1C58FD")
    .build();
mAdView.loadAd(adRequest);

and my xml code is:

 <com.google.android.gms.ads.NativeExpressAdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:layout_above="@+id/l2"
        ads:adSize="360x80"
        ads:adUnitId="@string/native_ads"
/>
like image 576
atendra singh Avatar asked Jun 16 '16 16:06

atendra singh


2 Answers

For getting test native express ads, use following ad unit id-

<string name="native_ad_test_unit_id">ca-app-pub-3940256099942544/6300978111</string>

For getting full width ads, use the FULL_WIDTH constant in the adSize. For example, your code should be

<com.google.android.gms.ads.NativeExpressAdView
        android:id="@+id/adView"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:layout_above="@+id/l2"
        ads:adSize="FULL_WIDTHx80"
        ads:adUnitId="@string/native_ads"
/>
like image 61
Vikram Singh Avatar answered Nov 07 '22 12:11

Vikram Singh


Use

ca-app-pub-3940256099942544/6300978111

instead of your own Ad unit id.

like image 41
Vikas Avatar answered Nov 07 '22 11:11

Vikas