Last active
June 1, 2018 21:35
-
-
Save blau2/c6a39b31e96f74df5050fbc18f9f0906 to your computer and use it in GitHub Desktop.
Revisions
-
blau2 revised this gist
Jun 1, 2018 . No changes.There are no files selected for viewing
-
blau2 revised this gist
Jun 1, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ import AppsFlyerLib class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { -
blau2 created this gist
Jun 1, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { AppsFlyerTracker.shared().appsFlyerDevKey = Keys.AppsFlyer.devKey AppsFlyerTracker.shared().appleAppID = Keys.Apple.appId AppsFlyerTracker.shared().appInviteOneLinkID = Keys.AppsFlyer.appInviteOnelinkId AppsFlyerTracker.shared().delegate = self AppsFlyerTracker.shared().isDebug = true return true } ... } extension AppDelegate: AppsFlyerTrackerDelegate { func onConversionDataReceived(_ installData: [AnyHashable: Any]!) { print("onConversionDataReceived") guard let data = installData, let isFirstLaunch = data["is_first_launch"] as? Int, isFirstLaunch == 1, let referrerReferralCode = data["referrer_af_id"] as? String else { return } let userDefaults = UserDefaults.standard userDefaults.set(referrerReferralCode, forKey: AnalyticsManager.Constants.referralCodeKey) } }