Getting Started with the iOS SDK

Getting started with the Appnext iOS SDK

SDK Integration

❗️

Notes:

  • Appnext is showing ads for iOS applications that support iOS 7 and above. The iOS SDK can be integrated applications that are targeting iOS 6.0 and above. However, no ads will be shown. Please make sure to run the SDK on iOS 7 and above.

📘

Download the SDK files (Latest version 1.9.4 - 10/10/18)

Download here

  • Support new webview for iOS 13

Step 1: Unzip the SDK zip files

Unzip the SDK zip file in a folder of your choice (‘Third Party’ folder for example). The zip file includes the following components:

  1. ‘AppnextIOSSDK/libAppnextLib.a’ library file (Interstitial,Rewarded/Fullscreen and Banners)
  2. ‘AppnextNativeAdsSDK/libAppnextNativeAdsSDK.a’ library file (Native Ads)
  3. ‘AppnextIOSSDK/libAppnextSDKCore.a’ library file
  4. ‘AppnextIOSSDK/include/AppnextLib’ folder which include the .h interface files
  5. ‘AppnextIOSSDK/include/AppnextSDKCore’ folder which include the .h interface files
  6. ‘AppnextNewNativeLibSDKSwiftTest’ folder which include a swift example project
  7. ‘AppnextNewNativeLibSDKTest’ folder which include an Objective-C example project
  8. ‘CHANGELOG.md’ the SDK change log file

Step 2: Add the Appnext SDK to your project

Link ‘libAppnextLib.a’ and/or ‘libAppnextNativeAdsSDK.a’ and ‘libAppnextSDKCore.a’ to your project.
a. Click on your project in the ‘Project navigator’ -> `’Build Phases’ -> ’Link Binary With Libraries’ -> ’+’ -> ’Add Other…’ and go to the folder where you unzipped the SDK package. Choose ‘libAppnextLib.a’ and/or ‘libAppnextNativeAdsSDK.a’ and ‘libAppnextSDKCore.a’.
b. Make sure to add the relative path from your project’s directory to the library in the ‘Build Settings’ -> ‘Library Search Paths’ (It should look something like – ‘$(PROJECT_DIR)/AppnextiOSSDK’ and/or ‘$(PROJECT_DIR)/AppnextNativeAdsSDK’).

Step 3: Add the Appnext SDK .h files to your project

a. Go to the ‘include/AppnextLib’ and/or ‘include/AppnextNativeAdsSDK‘ and ‘include/AppnextSDKCore’ folders and add all the .h files there to your project (grab all the .h files into the ‘Project Navigator’ area).
b. Make sure to add the relative path from your project’s directory to the ‘include’ folder in the ‘Build Settings’ -> ‘Header Search Paths’. (It should look something like – ‘$(PROJECT_DIR)/AppnextiOSSDK/include’ and/or ‘$(PROJECT_DIR)/AppnextNativeAdsSDK/include’ ).

Step 4: Add additional system frameworks to your project

These frameworks are required for the work of the SDK. Click on your project in the ‘Project navigator’ -> ’Build Phases’ -> ’Link Binary With Libraries’ -> ’+’ and add the following frameworks:

  1. ‘QuartzCore.framework’
  2. ‘Security.framework’
  3. ‘CFNetwork.framework’
  4. ‘AVFoundation.framework’
  5. ‘SystemConfiguration.framework’
  6. ‘MobileCoreServices.framework’
  7. ‘CoreGraphics.framework’
  8. ‘CoreMedia.framework’
  9. ‘AdSupport.framework’
  10. ‘UIKit.framework’
  11. ‘Foundation.framework’
  12. ‘CoreTelephony.framework’

Step 5: Add additional Linker flags

Add ‘-ObjC’ linker flag. Go to ‘Build Settings’ -> ‘Other Linker Flags’ and add ‘-ObjC’ flag

696

Step 6: Support for App Transport Security

iOS 9 introduces a new feature called App Transport Security (ATS), which prevents an app from making non-secure connections.

Some of the install redirects from the SDK go through 'http' links. If ATS is not disabled these redirects will be blocked and publisher revenue will drop.

To prevent this add a new Dictionary entry to your app's Info.plist file called NSAppTransportSecurity, then add an entry to that dictionary with a key of NSAllowsArbitraryLoads with YES as value.

After adding the entry your plist file will have the entry as marked:

720