FeedAd iOS SDK

This guide explains how to integrate the FeedAd SDK into an iOS app. The SDK can be used within both Objective-C and Swift apps. This guide walks you through all steps necessary to get started with the integration of the specific ad types.

Requirements

  • A FeedAd SDK client token to be found in the admin panel
  • iOS SDK 15.0+

Installation via Swift Package Manager

The FeedAd SDK is available as a xcframework that can be installed via Swift Package Manager.

Either add it to your Package.swift as a dependency:

dependencies: [
    .package(url: "https://bitbucket.org/feedad/feedad-ios-spm.git", .upToNextMajor(from: "1.6.0"))
]

Or manually add it as a package dependency in your Xcode project by following these steps:

  1. Open your project in Xcode
  2. Goto File > Add Package Dependencies ...
  3. In the search field, enter the repository URL: https://bitbucket.org/feedad/feedad-ios-spm.git
  4. Choose the dependency rule and what projects to add the package to
  5. Click Add Package

Installation via CocoaPods

The FeedAd SDK is available as a pod via CocoaPods.

Install it by adding it to the Podfile in your project:

target "YourTarget" do
  pod "FeedAd"
end

After running pod install, the library should be ready for use.

Initialization

The SDK needs to be initialized with your client token as soon as your app starts. Add the following initialization code to your app delegate:

Using Objective-C:

#import <FeedAd/FeedAd.h>

@implementation FAAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...

    // Setup config with client token
    FAConfig *config = [FAConfig new];
    config.clientToken = @"your-client-token";

    // Set to YES, if you are using a TCF 2.0 CMP and
    // want FeedAd to wait for user consent
    config.waitForConsent = NO;

    // Configure FAManager
    [[FAManager sharedManager] configure:config];

// ...
}

@end

Using Swift:

Import the FeedAd framework into your bridging header:

#import <FeedAd/FeedAd.h>

Update your app delegate:

class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// ...

    // Setup config with client token
    let config = FAConfig()
    config.clientToken = "your-client-token"

    // Set to true, if you are using a TCF 2.0 CMP and
    // want FeedAd to wait for user consent
    config.waitForConsent = false

    // Configure FAManager
    FAManager.shared().configure(config)

// ...
}

Integration Guides

Now that the SDK has been initialized, please continue with the specific integration guides for the ad types you would like to integrate into your app:

Demo Apps

If you rather prefer to dive right into the code, you can also take a look at our iOS demo apps written in Objective-C and Swift that demonstrate a working integration.