Stafford Williams February 2016

How can I implement Facebook Audience Network notifications in Swift?

I am successfully loading ads, but I can't get the notifications to fire.

For example;

class ViewController : UIViewController , FBAdViewDelegate {
    ...
    func adViewDidLoad(adView: FBAdView) {
        print("ad loaded"); // never called, although ad displays
    }
}

Answers


Stafford Williams February 2016

I was not assigning the delegate;

self.fanView = FBAdView(placementID:PLACEMENT_ID, 
    adSize:kFBAdSizeHeight50Banner, rootViewController:self);
self.fanView.delegate = self; // needed this

Post Status

Asked in February 2016
Viewed 1,945 times
Voted 12
Answered 1 times

Search




Leave an answer