Important: As an App developer, as the controller of data, you must ensure that you have received unambiguous and informed consent from a user before sharing any of their data with Leadbolt or before calling any Leadbolt SDK functions for that user. Please ensure your app is updated as required.

This page will show you how to directly integrate Leadbolt Video and Interstitial ads in your iOS app using Cocos2d-X. Download the SDK and sample app. Follow the instructions below and make sure you can compile the sample app and see test ads.


New You can now integrate Leadbolt Video and Interstitial ads in Cocos2d-X apps using SDKbox. To use SDKbox, follow the instructions, including download, provided by SDKbox here after Leadbolt Publisher signup.

Before you begin Before you begin

  • Have you logged in to the Leadbolt Publisher Portal?
  • Did you add an App in the portal?
  • Ensure, you have downloaded the Leadbolt SDK and sample app from the link above

Step 1 Add Leadbolt SDK files

  • Unzip and copy Leadbolt iOS SDK into your Xcode project (in the proj.ios folder of your Cocos2d-X App). This contains libAppTracker.a  and AppTracker.h file
  • Copy the AppTrackerWrapper.h  and  files to the “Classes” folder.

Step 2 Link the required frameworks

  • Ensure that the the following frameworks are linked in your Xcode Project. AdSupport.framework, AVFoundation.framework, CoreMedia.framework, CoreTelephony.framework, StoreKit.framework, SystemConfiguration.framework and libz.tbd

Step 3 Configure App Transport Security (ATS) Settings

  • To ensure all available Leadbolt ads display correctly on apps running on iOS 9/10, please include these ATS settings by adding the following lines of code to your Apps Info.plist file:

Step 4 Add Leadbolt SDK Imports

  • In your App’s .cpp file, add the following line to import the Leadbolt SDK

Step 5 Initialize Leadbolt SDK

  • In your App’s code, add the following code to your init method.

    You will need to replace "YOUR_APP_API_KEY"  with the specific api key for your app (include the double quotes).

Step 6 To Cache and Show a non-Rewarded Ad

  • To cache a non-Rewarded Ad

  • To show a non-Rewarded Ad

  • Please ensure that in your code, you do not call loadModule directly after loadModuleToCache. It will cause the SDK to fail and not display an Ad all together.

Step 7 To Cache and Show a Rewarded Ad

  • To cache a Rewarded Ad

  • To show a Rewarded Ad

  • Please ensure that in your code, you do not call loadModule directly after loadModuleToCache. It will cause SDK to fail and not display the Rewarded Ad at all.

Test Integration Test your Integration

  • Run your Project on an Android device.
  • Ensure, test ads are displayed when the “loadModule” call is made in your App.
  • Once test ads are seen on your device, go to your Leadbolt Portal and set your App to “Live”
  • Once approved, you should see live ads in your App.

Congratulations! You have successfully integrated the Leadbolt SDK in your App

Troubleshooting Troubleshooting

  • Video and Interstitial Ads may not be available at all times in all countries. It is always best to test with your App in Test Mode in the Publisher Portal to ensure as Test Ads are generally always available.
  • You should check your Publisher Portal and ensure the relevant section is visible under your App. Use the “Add Section” button to add if not available.
  • You should check the SDK logs located in Device Logs (under Xcode -> Devices) and look for “AppTracker”.
  • Always test the sample app provided to confirm any integration issues are SDK based.
  • This plugin has been tested on the following versions of Cocos2dx: v3.13.1

Advanced Integration

Check Ad Availability Checking Ad Availability

Leadbolt SDK provides additional ability to the developers to check before hand if an Ad is available before displaying it to create a better user-experience in your App. To check if a Network or Direct Deal Ad is available please use the code below:

To check if a Rewarded Ad is available to be displayed, please use the code below:

Pass Additional Info Passing Additional Information

You can increase your App’s performance by optionally including the additional information below. This allows selected premium advertisers to display their Ads to your users. To pass this additional information, use the following methods BEFORE calling loadModuleToCache


← Return to Help Center