Reputation: 255
Hi i am trying to add admob ads into an application that is already uploaded to the appstore using swift. I made an app in the admob and copied appid, and ads ids and showed respective banner and interstitial ads. The problem here is that when i write this line
request.testDevices = [ "53441f52e531b870fe8c34151a2f6013" ]
the test ads show and work perfectly but when i comment this line the following error is shown in the console.
Request Error: No ad to show.
This message is printed in the overloaded method of GADBannerViewDelegate
public func interstitial(_ ad: GADInterstitial, didFailToReceiveAdWithError error: GADRequestError){
print("Inter error: \(error.localizedDescription)")
}
Please help me through this problem. I am really not sure why is it happening?
Upvotes: 0
Views: 2683
Reputation: 2438
Nothing wrong in your code. Sometimes ads are not displayed due to lack of inventory. It depends upon where you are displaying your advertisements, Which country you are trying to display ads?
If you want 100% fill rate for your ads try an advertisements mediation
https://developers.google.com/admob/android/mediation
Upvotes: 4