I think I carefully read and understand admob implementation instructions.
It works really well with test ads when developing. But when I deploy it to market with real app unit id, it returns nothing, shows nothing. When debugging I get onAdFailedToLoad() Code 3 which is ERROR_CODE_NO_FILL means "The ad request was successful, but no ad was returned due to lack of ad inventory.", its been a week since I release to play store.
I have a problem with admob the other day, my previous admob account got terminated because invalid traffic which I did not do anything to artificially increase ads impression, etc. so I remove admob from my apps and create apps version 2 with new admob account, but with the same apps.
Could be the problem is google admob disabled your apps too(not only your admob account) so when you create new account but with same apps, your apps won't display any ads because your apps is disabled from admob service?
Code snippet:
gradle:
//firebase
implementation 'com.google.firebase:firebase-core:16.0.6'
//admob
implementation 'com.google.android.gms:play-services-ads:17.1.2'
manifest:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="[ADMOB_APP_ID]"/>
Main.java code:
@BindView(R.id.adView)
AdView adView;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
MobileAds.initialize(this, ADMOB_APP_ID);
adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
...
}
activity_main.xml code:
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="[Banner_Unit_Id]" />
Or am I doing anything wrong with the code?