RevMob banner ads won't display

跟風遠走 提交于 2020-03-06 09:01:10

问题


Alright so this is the code I'm using but banner ads won't seem to load up. Testing mode is on but nothing shows up at all.

let completionBlock: () -> Void = {
    //Custom method defined below
    self.banner?.showAd()
    self.bannerView?.showAd()

}
let failureBlock: (NSError!) -> Void = {error in
    print("Gifting Chaos Session failed to start with error: \(error.localizedDescription)")
}

RevMobAds.startSession(withAppID: "myKEY", withSuccessHandler: completionBlock, andFailHandler: nil)
bannerView? = RevMobAds.session().bannerView()
let x = CGFloat(0)
let y = CGFloat(0)
let width = CGFloat(375)
let height = CGFloat(50)
self.bannerView?.frame = CGRect(x: x, y: y, width: width, height: height)
bannerView?.loadAd()
bannerView?.showAd()
banner?.releaseAd()
self.banner?.showAd()

回答1:


I believe your code is a bit confusing. You call showAd() and also releaseAd(). Could you try to just show the ad in the completion block? Also try using our Sample App and follow our documentation here

You didn't send the code that is in your viewController, but you also have to add the banner in your controller's view.



来源:https://stackoverflow.com/questions/40894706/revmob-banner-ads-wont-display

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!