Prerequisites
Targeting
- Use Xcode 16.0 or higher.
- Target iOS 17.2 or higher.
Updating your Info.plist
-
Before installing, update the application
Info.plistto A GADApplicationIdentifier key with a string value of your Ad Manager app ID found in the Ad Manager UI and of the formca-app-pub-################~##########. If you do not have this ID, please contact the Content Ignite team. -
Next add a
SKAdNetworkItemskey to yourInfo.plistwith SKAdNetworkIdentifier values for Google (cstr6suwn9.skadnetwork) and select third-party buyers who have provided these values to Google.
Installation
Use of the following methods to install the Content Ignite Mobile SDK.Swift Package Manager
To install the SDK into your project using Swift Package Manager:- In Xcode, install the Content Ignite Mobile SDK UIKit Package using File > Add Package Dependencies…
- When the prompt appears, search for the following URL for the UIKit version of the SDK:
- Select the version of the Content Ignite Mobile SDK UIKit Package you want to use. For new projects, we recommend using the Up to Next Major Version.
CocoaPods
Before you continue, review Using CocoaPods for information on creating and using Podfiles. To install the SDK into your project using CocoaPods:- Open your project’s Podfile and add this line to your app’s target build configuration:
- In a terminal, run:
- In your project’s build settings:
- Add the
-ObjClinker flag to Other linker flags.
Initialising the SDK
First we will create an instance ofCIMobileAdsConfiguration. This is achieved using CIMobileAdsConfiguration.Builder.
The builder takes one required parameter:
publisherId: String: A unique identifier to identify the publisher in the Fusion platform.
build API to create the instance.
ℹ️ When creating an instance ofCIMobileAdsConfigurationit is possible to enable optional features on the SDK, currently the only feature which can be enabled is debugging using thesetDebugFeatureAPI. This is discussed further in the Using the Debug Features section.
setTestAds(enabled: Boolean)was added toCIMobileAdsConfiguration.Builderin1.7.0to control whether test ads are enabled, this was previously only possible from the debug menu. If this is set the Debug Menu option will be hidden and if not set the Debug Menu option will be used.
CIMobileAds initialise API. This is an async-await function.
It takes one required parameter:
configuration: An instance ofCIMobileAdsConfiguration.
ℹ️ If you are currently using Google Mobile Ads SDK, it is no longer necessary to initialise this separately, and this code should be removed.An example is shown below: