Let’s get started! See below for how to set up Chocolate SDK in your app.
Prerequisites
The following prerequisites must be met for integrating Chocolate SDK in iOS.
• Software Requirement: Xcode 9 or later
• Hardware Requirement: Device/simulator (with iOS 9.x or later)
Download Files
The unzipped folder contains the following two folders:
• SDK – Contains runtime library, header and SDK dependencies.
• Mediation – Contains all the partner frameworks.
Add SDK Folder to Your Project
Open your project in Xcode, then drag and drop the SDK folder onto your project or workspace (use the “Project Navigator view”) and choose “Copy items into destination group’s folder” and click Finish.
Add Mediation Folder to Your Project
Drag and drop the Mediation folder onto your project or workspace (use the “Project Navigator view” and choose “Copy items into destination group’s folder” and click Finish.
Select the ad sources
a) Choose the ad sources you would like Chocolate Mediation to include. Delete the source libraries and the corresponding adapters (libraries named “libChocolatePlatform-SDK-%SOURCE_NAME%.a”) that you would like to leave out from your project. Do not remove ChocolatePlatform_SDK_Core.framework.
b) Link the project with the libz library:
i) Click on your project name under Targets section.
ii) Go to ‘Build Phases’ Tab. Open the ‘Link Binary With Libraries’ section, click the plus sign, select the following libraries, and click “Add”.
libc++.tbd libsqlite3.0.tbd libsqlite3.tbd libxml2.tbd libz.1.2.5.tbd libz.tbd
Also, add the following system frameworks:
c) If you wish to see preroll ads from Google
i) Click on your project name under Targets section.
ii) Go to ‘General’ Tab. Under ‘Embedded Binaries’ section, add GoogleInteractiveMediaAds.framework from the Mediation/Google
folder of the SDK download
iii) Add a run script phase in to run the script at Mediation/Google/strip_for_archive.sh
The runscript code should contain the path to the script in quotes. Usually, this would be "${SRCROOT}/Mediation/Google/strip_for_archive.sh"
Please note that this only applies to preroll ads. The more common interstitial, rewarded, and inview ads from Google are delivered via Google AdMob network, adapted for Chocolate via a separate adapter library. Unless you intend to deliver preroll ads from Google, do not include SDK/libChocolatePlatform-SDK-Google.a
and Mediation/Google/GoogleInteractiveMediaAds.framework
in your Xcode project.
Add -ObjC to ‘Build Settings > Other Linker Flags’
a) Click on the “SampleApp” project name.
b) Click on the “Build Settings” tab and find “Other Linker Flags”.
c) Double click the entry field to the right of “Other Linker Flags” and enter “-ObjC”. It should automatically populate the Debug and Release rows.
Add optional frameworks
If you would like to include AdColony in the mediation, your app needs to link to Social, EventKit, and optionally to WatchConnectivity frameworks:
Chocolate by Vdopia iOS SDK works on iOS 9.0+ version and is compatible with both ARC and non-ARC projects.