I am using google admob in the app when I used it with the test Id of the project it was working well but when I changed it to the live id the ads stop to come. this is my java code :
MobileAds.initialize(this, getString(R.string.ad_mob_used_id));
mInterstitialAd = new InterstitialAd(this);
mInterstitialAd.setAdUnitId(getString(R.string.ad_mob_used_id));
mInterstitialAd.loadAd(new AdRequest.Builder().build());
mInterstitialAd.setAdListener(new AdListener(){
@Override
public void onAdLoaded() {
super.onAdLoaded();
mInterstitialAd.show();//TODO : check this
}
});
and this is the code in the manifest :
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/ad_mob_used_id"/>
and this is the code in the strings :
<string name="ad_mob_live_id">ca-app-pub-1283544791526621~9315704399</string>
<string name="ad_mob_test_id">ca-app-pub-1283544791526621/5955878039</string>
<!-- either live or debug -->
<string name="ad_mob_used_id">ca-app-pub-1283544791526621~9315704399</string>
Check below statement, Is it your typing mistake or your mistake ??
You're using same value in admob_app_id
and ad_unit_id
!!!
mInterstitialAd.setAdUnitId(getString(R.string.ad_mob_used_id)); // use adunit id instead of AD_ID
should be
mInterstitialAd.setAdUnitId(getString(R.string.ad_mob_live_ad_unit)); //something in format of ca-app-pub-3940256099942544/1033173712
If this is your just typing mistake then wait for a few hours.
Because According to Google :
"It could be that you have only recently created a new Ad Unit ID and requesting for live ads. It could take a few hours for ads to start getting served if that is that case. If you are receiving test ads then your implementation is fine. Just wait a few hours and see if you are able to receive live ads then. If not, can send us your Ad Unit ID for us to look into."