If you are looking for third-party integration (like cross-platform scripting), please check the Dashboard in order to download the appropriate plug-in. Dedicated documentation is included inside each archive file.

Import the library into your project

The sample project displays the simplest way to install the SDK inside your app: Dragging & dropping the folder "appsfire-sdk" into your own project.

To get started, drag the "appsfire-sdk" folder onto your project's name in Xcode's Project Navigator:

import sdk via xcode

Check the box next to Copy items into destination group's folder, and be sure the radio button next to Create groups for any added folders is selected. Then, click Finish:

import sdk via xcode

The Appsfire iOS SDK requires additional frameworks to operate. Make sure to have them in your project.
If you fail to do so, your project will not compile and XCode will produce errors.

Navigate to the General tab, scroll down to Linked Frameworks and Libraries and then hit the "+" button.

import sdk via xcode

Search for and add the following frameworks:

  • Accelerate
  • AdSupport (you can check it as "optional")
  • CoreGraphics
  • CoreText
  • Foundation
  • QuartzCore
  • Security
  • StoreKit (you can check it as "optional")
  • SystemConfiguration
  • UIKit

import sdk via xcode

Some can be checked as "optional" if you are using iOS6+.

import sdk via xcode


Initialize the library

To begin, make sure you import the header file called AppsfireSDK.h in you App Delegate.

#import "AppsfireSDK.h"

You have a mandatory call to make in order to intialize the SDK. You'll need to add some configuration code to the applicationDidBecomeActive method in your App Delegate implementation file.


#import "AppDelegate.h" // Appsfire SDK #import "AppsfireSDK.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // connect to appsfire services [AppsfireSDK connectWithAppId:@"YOUR_APP_ID" parameters:nil]; // [...] // window & root controller creation return YES; } @end

Swift Support

In order to use the Appsfire SDK in your Swift based application, you'll need to go through a few additional steps:

  1. Grab our Objective-C bridging header file here: AppsfireSDK-Bridging-Header.zip

  2. Import this header file in your Xcode project in order to activate the mix and match feature. This will allow you to write apps that have a mixed-language codebase. In this case Objective-C and Swift.

  3. Under Build Settings in your project, make sure the Objective-C Bridging Header build setting under Swift Compiler - Code Generation has a path to the header.
    The path should be relative to your project, similar to the way your Info.plist path is specified in Build Settings. In most cases, you should not need to modify this setting.

  4. From now on you are able to consume the Appsfire SDK using the Swift syntax. As an example, here is how the SDK initialization is done is Swift:


    class AppDelegate: UIResponder, UIApplicationDelegate { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // connect to appsfire services AppsfireSDK.connectWithAppId("YOUR_APP_ID", parameters: nil) // [...] // window & root controller creation return true } }