GithubHelp home page GithubHelp logo

dmorrow / segment-appsflyer-ios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from appsflyersdk/segment-appsflyer-ios

0.0 1.0 0.0 944 KB

The AppsFlyer SDKiOS integration with Segment

Home Page: https://segment.com/docs/integrations/appsflyer/

License: MIT License

Objective-C 89.39% Ruby 10.61%

segment-appsflyer-ios's Introduction

AppsFlyer integration for Segment.

This is a Segment wrapper for AppsFlyer SDK framework.

Table of content

Segment AppsFlyer uses AppsFlyer static framework from Cocoapods. Add the appsFlyerFramework to podfile and run pod install.

Example:

  pod 'AppsFlyerFramework'
  pod 'Analytics', '~> 3.5'

Next step, copy manually 5 files to your project:

  • SEGAppsFlyerIntegration.h
  • SEGAppsFlyerIntegration.m
  • SegAppsFlyerIntegrationFactory.h
  • SegAppsFlyerIntegrationFactory.m
  • SegmentAppsFlyeriOS.h

You can find them here: segment appsflyer ios wrapper

To use SDK from a Swift source just follow the instructions from Apple here.

First of all, you must provide values for AppsFlyer Dev Key, Apple App ID (iTunes) and client secret in Segment's dashboard for AppsFlyer integration

Open AppDelegate.h and add:

#import "SEGAppsFlyerIntegrationFactory.h"
#import <Analytics/SEGAnalytics.h>

In AppDelegate.m โžœ didFinishLaunchingWithOptions:

SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"SEGMENT_KEY"];
    
    [config use:[SEGAppsFlyerIntegrationFactory instance]];
    
    config.enableAdvertisingTracking = YES;       //OPTIONAL
    config.trackApplicationLifecycleEvents = YES; //OPTIONAL
    config.trackDeepLinks = YES;                  //OPTIONAL
    config.trackPushNotifications = YES;          //OPTIONAL
    config.trackAttributionData = YES;            //OPTIONAL   
    [SEGAnalytics debug:YES];                     //OPTIONAL
    [SEGAnalytics setupWithConfiguration:config];

Open/Create <Your-App-name>-Bridging-Header.h and add:

#import "SEGAppsFlyerIntegrationFactory.h"

Open AppDelegate.swift โžœ didFinishLaunchingWithOptions and add:

import Analytics

//...

let config:Analytics.SEGAnalyticsConfiguration = SEGAnalyticsConfiguration(writeKey: "SEGMENT_KEY")
        
        config.use(SEGAppsFlyerIntegrationFactory())
        config.enableAdvertisingTracking = true       //OPTIONAL
        config.trackApplicationLifecycleEvents = true //OPTIONAL
        config.trackDeepLinks = true                  //OPTIONAL
        config.trackPushNotifications = true          //OPTIONAL
        config.trackAttributionData = true            //OPTIONAL

        Analytics.SEGAnalytics.debug(true)
        Analytics.SEGAnalytics.setup(with: config)

AppsFlyer integration responds to identify call. To read more about it, visit Segment identify method documentation. In identify call traits dictionary setCustomerUserID and currencyCode

This project has 2 examples for objective-C and Swift. To give it a try , clone this repo and from each example first run pod install to install project dependancies.

  • Create Podspec with sybspec for users who are unable to bundle static libraries as dependencies (mostly for Swift users)

segment-appsflyer-ios's People

Contributors

af-fess avatar arabold avatar dmorrow avatar edowling avatar f2prateek avatar fson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.