Native Ads allow you to include ads in your App’s look and feel. Native Ad Integration is a more advanced integration for displaying ads and requires approval to run. If you are new to in-app ads, we recommend that you integrate our Interstitial ads and Video ads available here.

This page will show you how to integrate Leadbolt Native ads in your iOS app created in Xcode. Download the SDK and native sample app. Make sure you can compile the sample app and see test ads.

To get started sign up for a Leadbolt Publisher account here or login to the Publisher Portal here.

gstart


Add your apps

Login to the Publisher Portal and select the ‘Create New App’ button from the “Apps” page. Fill in your app’s details including name and platform.

To run native ads in your App, you will need to apply and be approved. Click on “Native Ads” link in the Publisher Portal or contact your account manager. Once approved, check that a “Native Ads” section is visible under your App. Use the “Add Section” button if not visible.

 


Copy Your Integration Details

Your integration details will be displayed on the last page of the Create App process. These integration details will be needed when you integrate the Leadbolt SDK into your app.

Create App Dialogue-3


Integrating Leadbolt Native Ads

Unzip the downloaded zip file and copy the AppTracker.framework to your Xcode project.

ios-native-1

Add the required frameworks to your Xcode project

  • AdSupport.framework
  • AVFoundation.framework
  • CoreMedia.framework
  • CoreTelephony.framework
  • StoreKit.framework
  • SystemConfiguration.framework
  • libz.tbd

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


Fetch Native Ads

To display a Native ad in your app, first you will need to fetch the ads via the SDK by using the “loadNativeAds” method of the AppTracker class. Using the ATNativeAdDelegate protocol, your app can be notified when Native ads have been fetched successfully. Please use the following code in your app. You will need to implement event listeners and request one of our supported ad sizes.

Native ad sizes: 1200×627, 320×480, 320×568, 768×1024, 120×120, 1024×768, 568×320, 480×320

You will need to replace "YOUR_APP_API_KEY" with the specific api key for your app (include the double quotes). This is available in the settings menu for your app, under the option “Get App API Key” in the Publisher Portal. Please remember, to run native ads in your App, you will need to apply and be approved. Click on “Native Ads” link in the Publisher Portal or contact your account manager. Once approved, check that a “Native Ads” section is visible under your App. Use the “Add Section” button if not visible.

Display Native Ads

Once a Native ad is fetched, you can display this native ad to the user. The code below shows an example of how to display the Native Ad via simple iOS views. You can design views that match the look and feel of your App.


Troubleshooting

  • Native 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 as Test Ads are generally always available.
  • You should check your Publisher Portal and ensure the relevant native ad 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 native sample app provided to confirm any integration issues are SDK based.
  • The SDK has been tested to be compatible on Xcode Version 8.1

gstart