Created
June 10, 2015 23:04
-
-
Save ydn/eefb68232405c3363630 to your computer and use it in GitHub Desktop.
Configure Ad Serving (Swift)
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(); | |
} | |
// Example of setting the user's location to support ad targeting | |
func locationManager(manager: CLLocationManager!, didUpdateLocations newLocation: CLLocation) { | |
let adInterstitial = FlurryAdInterstitial(space:"ADSPACE"); | |
let adTargeting = FlurryAdTargeting(); | |
adTargeting.location = locationManager.location; | |
adInterstitial.targeting = adTargeting; | |
adInterstitial.fetchAd(); | |
} | |
// Example of setting user cookies to be appended to the rewarded ads server side callback | |
func showInterstitialAddUserCookies { | |
let cookies = ["xyz123": "UserCharacterId"]; | |
let adInterstitial = FlurryAdInterstitial(space:"ADSPACE"); | |
let adTargeting = FlurryAdTargeting(); | |
adTargeting.userCookies = cookies; | |
adInterstitial.targeting = adTargeting; | |
adInterstitial.fetchAd(); | |
} | |
// Example of setting keywords to be used in keyword targeting | |
func showInterstitialAddKeyWords() { | |
let keywords = ["UserParameterName": "UserParameterValue"]; | |
let adInterstitial = FlurryAdInterstitial(space: "ADSPACE"); | |
let adTargeting = FlurryAdTargeting(); | |
adTargeting.keywords = keywords; | |
adInterstitial.targeting = adTargeting; | |
adInterstitial.fetchAd(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment