iOS Guidelines

 Introduction

AdFalcon iOS SDK Integration guide contains all the information needed for iOS developers to integrate with AdFlacon Network. The guide will also show examples and  code snippets on how to perform the integration.

Prerequisites

  • Xcode: 8.0 or higher
  • Development target: iOS 8.0 or higher
  • CocoaPods to manage library dependencies with your Xcode projects (Recommended). for more information about CocoaPods visit cocoapods site

Note: If you need to support iOS 7, you can download the old SDK via AdFalcon iOS SDK v3.5.0.

Install AdFalcon SDK

There are two ways to install our SDK:

1 Use CocoaPods (Recommended)

To use the CocoaPods you should implement the steps below, For more info visit: https://cocoapods.org/pods/AdFalconSDK

Initialize the CocoaPods

The below steps illustrate the needed steps to initialize and prepare the CocoaPods.

  • Open the terminal app from your applications
  • If you haven’t installed the CocoaPods before, run this command from the terminal: sudo gem install cocoapods
  • Go to your project’s directory by running this command: cd [path of your project]
  • Create CocoaPods to your project by running this command: pod init
  • Open your project’s directory, you will find the CocoaPods project was installed and ready.

Modify the Podfile

After creating the CocoaPods project, you will find Podfile within the project’s directory. Open it via TextEdit or Xcode, then insert the below pod (pod ‘AdFalconSDK’) to your target

	platform :ios, '8.0'

	target 'YourProjectTarget' do
 		 pod 'AdFalconSDK'
	end

Install the pod

Run the below command to install AdFalcon’s pod to your project.

pod install

Update the pod

To be sure to get the latest iOS SDK into your project, run the below command from the terminal in the same path of Podfile’ directory.

pod update

2 Add AdFalcon SDK framework manually

Follow the procedure below to manually add AdFalcon SDK framework to your project:

  • Download AdFalcon iOS SDK.
  • Unzip the downloaded zip file, you will find AdFalconSDK.framework in the Framework folder.
  • Add the framework to your “Link Binary With Libraries” in “Build Phases” of your project’s target.

Configure Xcode

Add “-ObjC” to Other Linker Flags

You must add -ObjC linker flag to your project; if you forget adding the linker flag, the “Selector not recognized” exception will be raised during the runtime.

follow these steps to add -ObjC:

  1. In Xcode, choose View > Navigators > Show Project Navigator, or press ⌘
  2. Select your project under the PROJECT heading in the Project Navigator, then select the Build Settings tab.
  3. Scroll down to the Other Linker Flags build setting under the Linking collection, or type “Other Linker Flags” into the search bar.
  4. Set the value of the Other Linker Flags build setting to -ObjC.

objc

Turn Off App Transport Security (ATS)

If you build your app with iOS SDK 9.0 or later, you will need to turn off App Transport Security in your app’s plist in order to complete AdFalcon SDK integration successfully as below:

<key>NSAppTransportSecurity
<dict>
        <key>NSAllowsArbitraryLoads
       	<true/>
	<key>NSAllowsArbitraryLoadsForMedia
       	<true/>
	<key>NSAllowsArbitraryLoadsInWebContent
        <true/>
</dict>

Read More

Banner Ad
Interstitial Ads
Native Ad
Appendix A
Appendix B