【问题标题】:AdMob is not showing ads after i submit my IOS application to appStore在我将我的 IOS 应用程序提交到 appStore 后,AdMob 没有显示广告
【发布时间】:2018-11-25 22:49:10
【问题描述】:

当我在 Xcode 上编写我的 IOS 应用程序时,我使用 AdMob 来制作广告 在模拟器上进行测试时 AdMob 测试广告正确展示

但是

在我将我的应用程序提交到应用商店并发布应用程序之后 当我从 appStore 下载应用程序时,没有添加 我想知道下面的代码是否有任何问题

import GoogleMobileAds
var banner : GADBannerView! // Banner to the adds

   var interstitial: GADInterstitial!
override func viewDidLoad() {
    super.viewDidLoad()



    banner = GADBannerView(adSize: kGADAdSizeSmartBannerPortrait)
    banner.adUnitID = "ca-app-pub-8191182380005591/8534539***"
    banner.rootViewController = self
    let req : GADRequest = GADRequest()

    banner.load(req)
    banner.frame = CGRect(x:0 , y:  view.bounds.height - banner.frame.size.height , width : banner.frame.size.width ,  height: banner.frame.size.height )

    self.view.addSubview(banner)
    //show add
    self.interstitial =  createAndLoadInterstitial()



}
//CREAT ADD
func createAndLoadInterstitial() -> GADInterstitial {
    interstitial = GADInterstitial(adUnitID: "ca-app-pub-8191182380005591/338872***")
 //   guard let interstitial = interstitial else {
    //    return nil
    //}

    let request = GADRequest()
   // request.testDevices =  [kGADSimulatorID]
    interstitial.delegate = self
    interstitial.load(GADRequest())
    return interstitial
}//FUNC



func interstitialDidReceiveAd(_ ad: GADInterstitial) {


    ad.present(fromRootViewController: self)
}
func interstitialDidFail(toPresentScreen ad: GADInterstitial) {

}

这是我的代码 此外,我将应用程序从 AdMob 链接到 appStore 上的应用程序 有没有人知道我哪里有问题 如果它不在我应该搜索的代码中

谢谢

【问题讨论】:

  • AdUnitId 不同。我认为这可能是问题所在。

标签: ios iphone swift xcode admob


【解决方案1】:

在发布应用 3 周后,我终于可以投放广告了

我认为一开始没有用户使用该应用程序,所以这就是为什么没有广告,但过了一段时间,当人们开始下载该应用程序时,广告就会出现

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-27
    • 2018-08-15
    相关资源
    最近更新 更多