GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

GAM module - iOS

Use this module for Google Ad Manager (GAM) custom native and banner ads with the Experiences SDK for iOS. It uses the Google Mobile Ads SDK.

Set up the GAM module

1. Add the dependency

Add the module with CocoaPods, Swift Package Manager (SPM), or by adding the framework manually.

CocoaPods

In your Podfile, add BlazeGAM next to the Experiences SDK pod:

source 'https://github.com/WSCSports/blaze-specs-ios.git'

target 'YourProjectName' do
  use_frameworks!
  pod 'BlazeSDK', '~> VersionNumber'
  pod 'BlazeGAM', '~> VersionNumber'
end

Swift Package Manager

Follow the steps in SDK integration.

Manual

  1. Download the source from the WSC Sports blaze-specs-ios repository.
  2. Add the files to your project.

2. Set your Ad Manager app ID

Add your Ad Manager app ID to the app Info.plist under the GADApplicationIdentifier key. Find it in Google Ad Manager under Inventory > Apps (Google labels it App ID):

3. Enable ads

Call from your AppDelegate (or equivalent app entry point).

Custom native ads

BlazeGAM.shared.enableCustomNativeAds(
  defaultCustomNativeAdsConfig: BlazeGAMCustomNativeAdsDefaultConfig?,
  delegate: BlazeGAMCustomNativeAdsDelegate?
)

To disable:

BlazeGAM.shared.disableCustomNativeAds()

The older enableCustomNativeAds(defaultAdsConfig:delegate:) signature is unavailable. Use enableCustomNativeAds(defaultCustomNativeAdsConfig:delegate:) instead.

Banner ads

BlazeGAM.shared.enableBannerAds(delegate: BlazeGAMBannerAdsDelegate?)

To disable:

BlazeGAM.shared.disableBannerAds()

Did this page help you?