iOS – Cocoapods – Project Setup Part I

Using Cocoapods

Pod command will add our SDK and all the other dependent resources into your project.

Reference: Using Cocoapods

Select the ad sources

a) Choose the ad sources you would like Chocolate Mediation to include. Include them in your Podfile.

pod 'ChocolatePlatform-SDK-AdColony', '~> 3.1'
pod 'ChocolatePlatform-SDK-Amazon', '~> 2.1'
pod 'ChocolatePlatform-SDK-AppLovin', '~> 3.1'
pod 'ChocolatePlatform-SDK-Google', '~> 3.0'
pod 'ChocolatePlatform-SDK-Googleadmob', '~> 2.1'
pod 'ChocolatePlatform-SDK-Tapjoy', '~> 3.1'
pod 'ChocolatePlatform-SDK-Unity', '~> 4.1'
pod 'ChocolatePlatform-SDK-Vungle', '~> 3.1'
pod 'ChocolatePlatform-SDK-Criteo', '~> 1.0'
pod 'ChocolatePlatform-SDK-Facebook', '~> 3.1'

Note: the Google pod is used for preroll ads only, for all other types, use Googleadmob

If you want to only present Chocolate Platform’s native ads, and use none of the above mediation partners, put the following command in your Podfile:

 

pod 'ChocolatePlatform-SDK-Core', '~> 3.1'

All of the partner pods have the core SDK as a dependency, and will automatically download it if included in the Podfile. You only need to explicitly include the Core pod if you do not wish ads from any source but Chocolate.

b) After adding all the adapters you wish to use in your app, save the Podfile, go to the project directory in the Terminal, and run:

pod install

Note – If you get some error while installing pod, try updating pod by running ‘pod update’ and run commands again.

 

When the installation completes, open the Xcode workspace generated by the project, and work on your code.