iAd banner not loading when tapped
add this - ADBannerViewDelegate
create variable - var adBanner = ADBannerView()
In viewDidLoad()
adBanner = iADManager.sharedInstance
adBanner.delegate = self
if DeviceType.IS_IPAD {
adBanner.frame = CGRectMake(0, 20, self.view.frame.width, 65);
}
else {
adBanner.frame = CGRectMake(0, 20, self.view.frame.width, 50);
}
Delegate Methods [if fetched successfully ad then this will add subviews otherwise remove from view]
func bannerViewDidLoadAd(banner: ADBannerView!) {
self.view.addSubview(banner)
}
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {
banner.removeFromSuperview()
}
func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
return true
}
Below is My shareInstance class. This will more helpful for memory management and loading ads.
class iADManager{
class var sharedInstance: ADBannerView {
struct Static {
static var onceToken: dispatch_once_t = 0
static var instance: ADBannerView? = nil
}
dispatch_once(&Static.onceToken) {
Static.instance = ADBannerView(adType: ADAdType.Banner)
}
return Static.instance!
}
}
iOS - iAd Banners not appearing
Apple are discontinuing the iAd services, an email to that effect was sent out in May"
You are receiving this email because you entered into the Developer Advertising Services Agreement (“Agreement”) to use iAd’s advertising network and related services. We would like to thank you for allowing Apple to serve ads on your mobile properties. As you may know, the iAd App Network and related advertising services will be discontinued on June 30, 2016. More details about the iAd App Network shutdown are here. Note: Any outstanding payments due from Apple will be made no later than September 30, 2016, and campaign reporting data will be available until December 31, 2016.
This email shall serve as written notice that Apple will exercise its option to terminate the Agreement, effective June 30, 2016, 11:59 pm PDT. Nothing contained in, or omitted from, this notice shall be deemed a waiver of any of Apple’s rights, remedies or defenses, all of which are expressly reserved.
"
iAd banner position not updating
Problem Solved!
With the assistance from @aramusss comment I have found that I was calling the function to show the banner in the viewWIllLayoutSubViews
function, so I moved it to the viewDidLoad
function and it now works!
Thank you all for your help!
Related Topics
How to Open a Link to a PDF with Wkwebview
Uitableviewcell Without Using Deprecated Method Initwithframe:Reuseidentifier
How to Resize Views When Keyboard Pops Up Using Auto Layout
Swiftui How to Align a View That's Larger Than Screen Width
Accessibility for iOS, Voiceover Read Order Issue
How to Sort Nsmutablearray of Date Objects
How to Post on Twitter by Hiding Slcomposeviewcontroller *Tweetsheettweet Instance
How to Stop and Resume Background Audio from iPhone App
Xcode Error:Distill Failed for Unknown Reasons
Uitapgesturerecognizer on Uiimageview Within Uitablevlewcell Not Getting Called
Gcm Registration Is Not Ready with Auth Credentials in iOS9
How to Expose Existing Property on Obj-C Class Using an Extension Protocol in Swift
Xcode No Valid Compiled Storyboard at Path
Access Iphone's Built-In Ringtones
Uisearchbar's Cancel and Clear Buttons Not Working in iOS 7
Nsstrikethroughstyleattributename , How to Strike Out the String in iOS 10.3
Can the -Objc Flag Be Applied Selectively to Static Libraries