Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
965DC1232669947F00DDF9C7 /* FirebaseDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965DC1222669947F00DDF9C7 /* FirebaseDestination.swift */; };
965DC1262671656C00DDF9C7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 965DC1252671656C00DDF9C7 /* GoogleService-Info.plist */; };
9697C1F52679156C00B87EC1 /* Segment_Logo_Avatar_Grey-1024.png in Resources */ = {isa = PBXBuildFile; fileRef = 9697C1F42679156C00B87EC1 /* Segment_Logo_Avatar_Grey-1024.png */; };
BA384C9826824F3700AFEA1B /* AppsFlyerLib in Frameworks */ = {isa = PBXBuildFile; productRef = BA384C9726824F3700AFEA1B /* AppsFlyerLib */; };
BA384C9A2682973300AFEA1B /* AppsFlyerDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA384C992682973300AFEA1B /* AppsFlyerDestination.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -46,13 +48,16 @@
965DC1222669947F00DDF9C7 /* FirebaseDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseDestination.swift; sourceTree = "<group>"; };
965DC1252671656C00DDF9C7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
9697C1F42679156C00B87EC1 /* Segment_Logo_Avatar_Grey-1024.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Segment_Logo_Avatar_Grey-1024.png"; sourceTree = "<group>"; };
BA384C992682973300AFEA1B /* AppsFlyerDestination.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppsFlyerDestination.swift; sourceTree = "<group>"; };
BA384C9D2686609000AFEA1B /* DestinationsExample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DestinationsExample.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
469F7B01266011690038E773 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BA384C9826824F3700AFEA1B /* AppsFlyerLib in Frameworks */,
469EC8E0266828860068F9E3 /* FlurryAnalyticsSPM in Frameworks */,
469EC8D0266066130068F9E3 /* SystemConfiguration.framework in Frameworks */,
965DC1212669942800DDF9C7 /* FirebaseAnalytics in Frameworks */,
Expand Down Expand Up @@ -85,6 +90,7 @@
469F7B06266011690038E773 /* DestinationsExample */ = {
isa = PBXGroup;
children = (
BA384C9D2686609000AFEA1B /* DestinationsExample.entitlements */,
469F7B1E266012CB0038E773 /* destination_plugins */,
469F7B07266011690038E773 /* AppDelegate.swift */,
469F7B09266011690038E773 /* SceneDelegate.swift */,
Expand All @@ -110,6 +116,7 @@
469F7B1E266012CB0038E773 /* destination_plugins */ = {
isa = PBXGroup;
children = (
BA384C992682973300AFEA1B /* AppsFlyerDestination.swift */,
469F7B24266013320038E773 /* AdjustDestination.swift */,
965DC0F92668077400DDF9C7 /* AmplitudeSession.swift */,
965DC1222669947F00DDF9C7 /* FirebaseDestination.swift */,
Expand Down Expand Up @@ -151,6 +158,7 @@
965DC0FD2668079400DDF9C7 /* Mixpanel */,
469EC8DF266828860068F9E3 /* FlurryAnalyticsSPM */,
965DC1202669942800DDF9C7 /* FirebaseAnalytics */,
BA384C9726824F3700AFEA1B /* AppsFlyerLib */,
);
productName = DestinationsExample;
productReference = 469F7B04266011690038E773 /* DestinationsExample.app */;
Expand Down Expand Up @@ -184,6 +192,7 @@
965DC0FC2668079400DDF9C7 /* XCRemoteSwiftPackageReference "mixpanel-swift" */,
469EC8DE266828860068F9E3 /* XCRemoteSwiftPackageReference "FlurrySwiftPackage" */,
965DC11F2669942800DDF9C7 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
BA384C9626824F3700AFEA1B /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */,
);
productRefGroup = 469F7B05266011690038E773 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -214,6 +223,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BA384C9A2682973300AFEA1B /* AppsFlyerDestination.swift in Sources */,
469F7B20266012CB0038E773 /* FlurryDestination.swift in Sources */,
469F7B0C266011690038E773 /* ViewController.swift in Sources */,
965DC0FA2668077400DDF9C7 /* MixpanelDestination.swift in Sources */,
Expand Down Expand Up @@ -370,14 +380,18 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = DestinationsExample/DestinationsExample.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = V8R4668S2H;
INFOPLIST_FILE = DestinationsExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.segment.DestinationsExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -388,14 +402,18 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = DestinationsExample/DestinationsExample.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = V8R4668S2H;
INFOPLIST_FILE = DestinationsExample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.segment.DestinationsExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down Expand Up @@ -457,6 +475,14 @@
minimumVersion = 8.1.0;
};
};
BA384C9626824F3700AFEA1B /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/AppsFlyerSDK/AppsFlyerFramework";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 6.3.2;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand Down Expand Up @@ -484,6 +510,11 @@
package = 965DC11F2669942800DDF9C7 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseAnalytics;
};
BA384C9726824F3700AFEA1B /* AppsFlyerLib */ = {
isa = XCSwiftPackageProductDependency;
package = BA384C9626824F3700AFEA1B /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */;
productName = AppsFlyerLib;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 469F7AFC266011690038E773 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ import Segment

@main
class AppDelegate: UIResponder, UIApplicationDelegate {



var analytics: Analytics? = nil

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.

let configuration = Configuration(writeKey: "1234")
let configuration = Configuration(writeKey: "WRITE_KEY")
.trackApplicationLifecycleEvents(true)
.flushInterval(10)
.flushInterval(1)

analytics = Analytics(configuration: configuration)

Expand All @@ -36,25 +37,55 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// Add the Firebase destination plugin
analytics?.add(plugin: FirebaseDestination(name: "Firebase"))


//Add the AppsFlyer destination plugin
analytics?.add(plugin: AppsFlyerDestination(name: "AppsFlyer"))

return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}



//MARK: - Deep Link functionality

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
analytics?.continueUserActivity(userActivity)
return true
}

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
analytics?.continueUserActivity(userActivity)
return true
}

func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
analytics?.openURL(url)
return true
}

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
analytics?.openURL(url, options: options)
return true
}

// Report Push Notification attribution data for re-engagements
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [String : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
// this enables remote notifications for various destinations (appsflyer)
analytics?.receivedRemoteNotification(userInfo: userInfo)
}

}

extension UIApplicationDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Event Type" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5DB-ee-sx2">
<rect key="frame" x="20" y="60" width="113.5" height="29"/>
<rect key="frame" x="20" y="16" width="113.5" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<color key="textColor" red="0.32549019610000002" green="0.74509803919999995" blue="0.58823529409999997" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<nil key="highlightedColor"/>
</label>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="qhk-vM-RPB">
<rect key="frame" x="20" y="105" width="374" height="32"/>
<rect key="frame" x="20" y="61" width="440" height="32"/>
<segments>
<segment title="Track"/>
<segment title="Screen"/>
Expand All @@ -34,29 +34,29 @@
<color key="tintColor" red="0.32549019610000002" green="0.74509803919999995" blue="0.58823529409999997" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</segmentedControl>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Event Name" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MUh-za-gaw">
<rect key="frame" x="20" y="152" width="92" height="21"/>
<rect key="frame" x="20" y="108" width="92" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.32549019610000002" green="0.74509803919999995" blue="0.58823529409999997" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Name..." textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="4SR-2N-fPO">
<rect key="frame" x="127" y="145.5" width="267" height="34"/>
<rect key="frame" x="127" y="101.5" width="333" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1XN-fw-PDy" userLabel="Divider">
<rect key="frame" x="20" y="309.5" width="374" height="2"/>
<rect key="frame" x="20" y="265.5" width="440" height="2"/>
<color key="backgroundColor" red="0.32549019610000002" green="0.74509803919999995" blue="0.58823529409999997" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="height" constant="2" id="WWe-PX-Gp8"/>
</constraints>
</view>
<stepper opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" maximumValue="100" translatesAutoresizingMaskIntoConstraints="NO" id="1Ry-t2-GnA">
<rect key="frame" x="300" y="195.5" width="94" height="32"/>
<rect key="frame" x="366" y="151.5" width="94" height="32"/>
<color key="tintColor" red="0.32549019610000002" green="0.74509803919999995" blue="0.58823529409999997" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</stepper>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nRf-b5-W7w">
<rect key="frame" x="157" y="257.5" width="100" height="36"/>
<rect key="frame" x="190" y="213.5" width="100" height="36"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="1fQ-1x-tVX"/>
<constraint firstAttribute="height" constant="36" id="3Hn-fo-dIv"/>
Expand All @@ -69,13 +69,13 @@
</connections>
</button>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="vyv-SU-C0g">
<rect key="frame" x="20" y="242.5" width="374" height="0.0"/>
<rect key="frame" x="20" y="198.5" width="440" height="0.0"/>
<constraints>
<constraint firstAttribute="height" placeholder="YES" id="q83-lW-xvT"/>
</constraints>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Properties" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Dd-dt-9Ni">
<rect key="frame" x="20" y="201" width="265" height="21"/>
<rect key="frame" x="20" y="157" width="331" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.32549019610000002" green="0.74509803919999995" blue="0.58823529409999997" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -121,7 +121,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="108.69565217391305" y="137.94642857142856"/>
<point key="canvasLocation" x="107.5" y="136.875"/>
</scene>
</scenes>
<resources>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:swifttest.onelink.me</string>
</array>
</dict>
</plist>
21 changes: 21 additions & 0 deletions Examples/apps/DestinationsExample/DestinationsExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,25 @@
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.segment.DestinationsExample</string>
<key>CFBundleURLSchemes</key>
<array>
<string>swifttest</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSUserTrackingUsageDescription</key>
<string>"Test for IDFA"</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand All @@ -41,6 +56,12 @@
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>processing</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//
// Created by Brandon Sneed on 5/27/21.
//

import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit
import Segment
import AppsFlyerLib

enum SpecEvent: Int {
case track
Expand Down Expand Up @@ -43,7 +44,7 @@ class ViewController: UIViewController {

private var keysFields = [UITextField]()
private var propertiesFields = [UITextField]()

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
Expand Down
Loading