To start with the integration of our SDK, it is needed to add the following dependency into the Podfile file of the project, just as shown below:
source 'https://cdn.cocoapods.org/'
platform :ios, '12.0'
...
target 'MyTarget' do
use frameworks!
...
pod 'WortiseSDK' '>= 1.6.1'
end
Currently, the Wortise SDK is only distributed through Cocoapods. In the future, there will be support for its integration with Swift Package Manager (SPM).
Setup Info.plist
It is needed to add the following parameter in the Info.plist file, with Google's application ID as value:
It is very recommended to request the user consent to be able to show personalised ads. This will allow to display content of more interest and generate higher revenues.
You can consult the following section to implement this request and obtain the user consent: User consent
Initialize SDK
Our recommendation is to initialize the SDK in the AppDelegate class of the app, but it can also be done in any main ViewController.
To do so, it is necessary to integrate the following code in the application(didFinishLaunchingWithOptions:) method:
There are two possible ways to know when the SDK finishes its initialization:
Passing a delegate as the last parameter of the method WortiseAds.shared.initialize
WortiseAds.shared.initialize(assetKey: "your app key") {
// This delegate will be invoked when the initialization finishes
}
Using the method WortiseAds.shared.wait
WortiseAds.shared.wait {
// This delegate will be invoked when the initialization finishes
}
Test mode
To verify the integration, the SDK provides a test mode that allows the app to always receive ads.
Beside the option that is available in our dashboard, you can programmatically enable this test mode, from the SDK itself, by using the following code: