Google DFP - Swift¶
The Pulse platform can also serve real-time ads with dynamic creative optimization using Google DFP.
Follow the instructions to integrate DFP.
This capability only works when an app is in foreground mode (i.e. when the app is open).
First, setup Google DFP SDK as Google's instructions. Click here for Google Quickstart.
Second, enable DFP feature on this app using the Pulse Platform.
Third, set up a campaign and copy its tag into your Google DFP ad serving setup
Finally, add the getDFPTags method to Google AdMob’s customTargeting method. For example :
//declare the ad banner and assign it the unit ID
bannerView.adUnitID = "/<yourDFPAccount>/<Your_DCO_Banner>"
bannerView.rootViewController = self
//make the view controller class the GADBannerViewDelegate
bannerView.delegate = self
var request:DFPRequest = DFPRequest()
// Notify DFP using custom parameters to load Pulse Creative
request.customTargeting = PulseSDK.sharedClient().getDFPTags() as! [String: String]