- Download sample app give by Google for DFP integration from Modified Google's AdMob Sample App for reference
- Refer to DoubleClick for Publishers (DFP) Network Mediation for detailed steps and any references
Steps for iOS
- Download the Google Admob SDK from https://developers.google.com/mobile-ads-sdk/download#downloadios.
- Add mediation library to the same folder. Download it from DFP Mediation Library.
- Create a folder (any name like library) and add the above downloaded SDK into it.
- Add this folder to your sample project. Please see below:
Figure 1 Adding library to sample Project
- The code highlighted below in the screenshot can be copied below:
Figure 2 Library added successfully
Copy highlighted code in the above screen from the following box below:
NSString *udid = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; GADRequest *request = [GADRequest request]; // Make the request for a test ad. Put in an identifier for the simulator as well as any devices // you want to receive test ads. request.testDevices = @[ udid ];
Add your publisher ID.
Run the application and the Ad will look like this:
Figure 4 Ad on iOS device
If you are adding a MREC ad, use Vdopia supported 320 x 250 size instead of the usual 300 x 250 size provided by Google.
CGSize customadSize = CGSizeMake(320, 250);
GADAdSize customad = GADAdSizeFromCGSize(customadSize);