Skip to content
Objective-C Ruby
Branch: master
Clone or download
Latest commit e8a668c Feb 11, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Oct 27, 2019
Carthage/AppsFlyerTracker.framework Jenkins auto build Dec 23, 2019
Mac Catalyst/AppsFlyerLib.xcframework Jenkins auto build Dec 23, 2019
iOS/AppsFlyerLib.framework
macOS/AppsFlyerAttribution.framework Jenkins auto build Dec 23, 2019
tvOS/AppsFlyerLib.framework Jenkins auto build Dec 23, 2019
AppsFlyerFramework.podspec
AppsFlyerLib.json Carthage Jan 20, 2020
AppsFlyerTracker.json Update Carthage to 5.0.0 Dec 16, 2019
CHANGELOG.md Update CHANGELOG.md Sep 12, 2019
LICENSE Create LICENSE Feb 27, 2019
README.md no message Feb 11, 2020

README.md

AppsFlyerFramework

Version Carthage Compatible

Table of contents

Introduction

AppsFlyer helps mobile marketers measure and improve their performance through amazing tools, really big data and over 2,000 integrations.

In order for us to provide optimal support, we would kindly ask you to submit any issues to support@appsflyer.com

When submitting an issue please specify your AppsFlyer sign-up(account) email, your app ID, production steps, logs, code snippets and any additional relevant information

Requirements

  • iOS 8.0+ / macOS 10.11+ / tvOS 9.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate AppsFlyer into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'AppsFlyerFramework'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

To integrate AppsFlyerFramework 5.1.0 version or higher for Carthage into your Xcode project, specify it in your Cartfile:

binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/AppsFlyerLib.json"

Starting from the version 5.1.0 and higher, AppsFlyerLib.framework is a static framework. In order to successfully integrate it, please follow next steps:

  • In your project settings General -> Frameworks, Libraries and Embedded Content add AppsFlyerLib.framework and set Do not embed option for it;
  • Make sure you remove and do not add any static frameworks as input/output files for /usr/local/bin/carthage copy-frameworks Run script.

In order to integrate AppsFlyerFramework version 5.0.0 and lower, specify following contents in your Cartfile:

binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/AppsFlyerTracker.json"
  • Add AppsFlyerTracker.framework file to General -> Frameworks, Libraries and Embedded Content;
  • Make sure to add AppsFlyerFramework Build path as input file for /usr/local/bin/carthage copy-frameworks Run script.

Integration AppsFlyer

Basic iOS integration

  1. Add `pod 'AppsFlyerFramework' in Podfile
  2. Run pod update
  3. Implement in AppDelegate:
import AppsFlyerLib

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        AppsFlyerTracker.shared().isDebug = true
        AppsFlyerTracker.shared().appsFlyerDevKey = "devkey";
        AppsFlyerTracker.shared().appleAppID = "1234567890"
        AppsFlyerTracker.shared().delegate = self
    }
}

func applicationDidBecomeActive(_ application: UIApplication) {        
        AppsFlyerTracker.shared().trackAppLaunch()
}
  1. Implement delegates:
extension AppDelegate: AppsFlyerTrackerDelegate {
    func onConversionDataSuccess(_ conversionInfo: [String : Any]) {
        print(conversionInfo)
    }
    
    func onConversionDataFail(_ error: Error) {
        print(error)
    }
    
    func onAppOpenAttribution(_ attributionData: [String : Any]) {
        print(attributionData)
    }
    
    func onAppOpenAttributionFailure(_ error: Error) {
        print(error)
    }
}    

Basic macOS integration(BETA)

  1. Add pod 'AppsFlyerFramework', '5.1.0' in Podfile
  2. Run pod update
  3. Implement in AppDelegate:
import AppsFlyerAttribution

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
    func applicationWillFinishLaunching(_ notification: Notification) {
        AppsFlyerTracker.shared().isDebug = true
        AppsFlyerTracker.shared().appsFlyerDevKey = "devkey";
        AppsFlyerTracker.shared().appleAppID = "1234567890"
        AppsFlyerTracker.shared().delegate = self
        AppsFlyerTracker.shared().trackAppLaunch()
    }
}    

Note: AppsFlyerTracker setup must be in -applicationWillFinishLaunching: and not in -applicationDidFinishLaunching:

Note: -trackAppLaunch call in -applicationWillFinishLaunching:

  1. Implement delegates:
extension AppDelegate: AppsFlyerTrackerDelegate {
    func onConversionDataSuccess(_ conversionInfo: [String : Any]) {
        print(conversionInfo)
    }
    
    func onConversionDataFail(_ error: Error) {
        print(error)
    }
    
    func onAppOpenAttribution(_ attributionData: [String : Any]) {
        print(attributionData)
    }
    
    func onAppOpenAttributionFailure(_ error: Error) {
        print(error)
    }
}    

Changelog


You can find the release changelog here.



You can’t perform that action at this time.