0
votes

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?

1
I don't really see what the problem is. Why do you want to comment out request.testDevices = [ "53441f52e531b870fe8c34151a2f6013" ] ?El Tomato
@ElTomato when i comment that line my ads don't show at my device. If i don't comment that line then only test ads show.Salman Ali
sometimes add show but usually they don't. they say Request Error: No ad to showSalman Ali

1 Answers

4
votes

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