This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let nativeAd = FlurryAdNative(space: "ADSPACE"); | |
nativeAd.adDelegate = self; | |
nativeAd.viewControllerForPresentation = self; | |
nativeAd.fetchAd(); | |
nativeAd.trackingView = self; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController, FlurryAdNativeDelegate { | |
// For instance, the two most frequently used callbacks are: | |
func adNativeDidFetchAd(nativeAd: FlurryAdNative!){ | |
// The SDK returns this callback for every instance of the native ad fetched | |
// The FlurryAd object contains all of the ad assets | |
} | |
// Informational callback invoked when there is an ad error | |
func adNative(nativeAd: FlurryAdNative!, adError: FlurryAdError, errorDescription: NSError!){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController, FlurryAdNativeDelegate { | |
let nativeAd = FlurryAdNative(space:"ADSPACE"); | |
override func viewDidLoad() { | |
super.viewDidLoad(); | |
// Assign the FlurryAdNativeDelegate | |
nativeAd.adDelegate = self; | |
// UIViewController used for presentation of the full screen after the user clicks on the ad | |
nativeAd.viewControllerForPresentation = self; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController, FlurryAdInterstitialDelegate { | |
let adInterstitial = FlurryAdInterstitial(space:"ADSPACE"); | |
override func viewDidAppear(animated: Bool) { | |
super.viewDidAppear(animated); | |
adInterstitial.adDelegate = self; | |
adInterstitial.fetchAd(); | |
} | |
override func viewDidDisappear(animated: Bool) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController, FlurryAdInterstitialDelegate { | |
func adInterstitialDidFetchAd(interstitialAd: FlurryAdInterstitial!) { | |
// You can choose to present the ad as soon as it is received | |
interstitialAd.presentWithViewController(self); | |
} | |
// Invoked when the interstitial ad is rendered | |
func adInterstitialDidRender(interstitialAd: FlurryAdInterstitial!) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of enabling the test mode | |
{ | |
let adInterstitial = FlurryAdInterstitial(space:"ADSPACE"); | |
adInterstitial.adDelegate = self; | |
let adTargeting = FlurryAdTargeting(); | |
adTargeting.testAdsEnabled = true; | |
adInterstitial.targeting = adTargeting; | |
adInterstitial.fetchAd(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Capture the author info & user status | |
let articleParams = ["Author": "John Q", "User_Status": "Registered"]; | |
Flurry.logEvent("Article_Read", withParameters: articleParams); |