Skip to content

Google AdMob Adapter

This guide covers the integration of Boldwin SDK through Google AdMob platform. The Boldwin SDK supports the following ad formats:

  • Banner
  • Interstitial
  • Rewarded

Google AdMob Integration

For comprehensive Google AdMob setup instructions, see the AdMob iOS Integration Guide.

iOS Setup

⚠️ Important Note: If you want to support Objective-C based projects, please use Cocoapods dependency manager.

Add Dependencies

Option 1: Swift Package Manager

In Xcode:

  1. In Xcode, select File > Add Package Dependencies.
  2. Add Boldwin SDK from:

    https://bitbucket.org/boldwin-sdk/boldwin-sdk-ios-public.git
    
  3. Add Boldwin AdMob Adapter from:

    https://bitbucket.org/boldwin-sdk/boldwin-admob-ios.git
    
Option 2: CocoaPods
  1. Open your project's Podfile and add this line to your app's target build configuration:

    pod 'Boldwin'
    pod 'BoldwinGoogleAdMobAdapter'
    
  2. In a terminal, run the following command:

    pod install --repo-update
    
Option 3: Direct Download

Download the Boldwin SDK and Adapter using the link below and embed it into your project:

 https://bw-sdk.s3.us-east-1.amazonaws.com/ios/boldwin-sdk/1.15.15/Boldwin.xcframework.zip
 https://bw-sdk.s3.us-east-1.amazonaws.com/ios/boldwin-sdk/1.15.15/BoldwinAdMobAdapter.xcframework.zip

Configure Boldwin as a Custom Event

Boldwin integrates with AdMob mediation as a custom event.

  1. Log in to your AdMob dashboard.
  2. Go to Mediation and click Create mediation group.
  3. Select the ad format and iOS as the platform, then click Continue.
  4. Name the group, set the eCPM and select the ad units to mediate.
  5. Under Ad sources, click Add custom event.

AdMob Mediation Group

Configure Boldwin For Ad Units

  1. Enter a Label (for example Boldwin) and the eCPM.
  2. Set Class Name to BoldwinAdMobAdapter.
  3. Set Parameter to the Boldwin configuration JSON (see below).
  4. Map the custom event to your ad units and save.

AdMob Custom Event

Example of the Parameter value:

{
    "placement_id": "<YOUR_PLACEMENT_ID>",
    "publisher_id": "<YOUR_PUBLISHER_ID>",
    "ad_sizes": [{ "w": <WIDTH>, "h": <HEIGHT> }]
}

The parameter includes the following keys:

  • placement_id - The Boldwin placement ID. Required.
  • publisher_id - The Boldwin publisher ID. Optional. Used only to initialize the Boldwin SDK when your app has not initialized it already.
  • ad_sizes - The Boldwin supported ad sizes. Optional. Used to provide several sizes for placement.

By default, the banner ad size is taken from the AdMob ad unit, so it does not need to be specified in the parameter.