Home>

I created an app with Xcode yesterday and distributed it to the iTunes store, but the admob test ad is displayed, but it is not displayed when it is an actual ad. How can I make ads visible?

According to Apple's rules, you can't put all the code, but put the code of the advertisement part.

let AdMobID = "Actual AdmobID"
    let TEST_ID = "ca-app-pub-3940256099942544/2934735716"
    let AdMobTest: Bool = false
// Below ViewDidLoad
var admobView = GADBannerView ()
            admobView = GADBannerView (adSize: kGADAdSizeBanner)
            admobView.frame.origin = CGPoint (x: 0, y: self.view.frame.size.height-admobView.frame.height)
            admobView.frame.size = CGSize (width: self.view.frame.width, height: admobView.frame.height)
            if AdMobTest {
                admobView.adUnitID = "ca-app-pub-3940256099942544/2934735716"
            }
            else {
                admobView.adUnitID = AdMobID
            }
            admobView.rootViewController = self
            admobView.load (GADRequest ())
            self.view.addSubview (admobView)

In fact, the actual ID is placed in place of"actual AdMobID" ;.
If AdMobTest is set to true, a test advertisement will appear. If it is set to false, nothing will appear.