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()
I believe your code is a bit confusing. You call
showAd()
and alsoreleaseAd()
. Could you try to just show the ad in the completion block? Also try using our Sample App and follow our documentation hereYou didn't send the code that is in your viewController, but you also have to add the banner in your controller's view.