I have been trying to implement Native Ads from admob.
I got some sample code from Github. I tried to implement this code, and the demo code works fine. The native ads show up properly.
I then created my own Admob account and obtained an Ad Unit ID
. The previous demo code for native ad did not work with this id, and I got an error with error code 0
although my created Ad Unit ID
works fine for banner type ads.
Can someone help me out?
guys i have facing same issue and finally i have a solution for it hope this will you all..:)
Here in this image when you are trying to create an AdUnitId make sure that the width and height here will be same width and height in the XML file like this
<com.google.android.gms.ads.NativeExpressAdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="360x320"
ads:adUnitId="@string/NativeAdId">
</com.google.android.gms.ads.NativeExpressAdView>
One more thing you have to keep in mind that the width and height you are going to make ad will be fit in your xml layout ,So for this just first try It in your xml and then create an Native add for this.
Just try it and feel free to tell me if you will be facing any problem after doing this. Thank you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With