From d14f82ede4fb15e944b6c772f7eb26eb752ced82 Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Wed, 20 Apr 2022 11:59:54 -0700 Subject: [PATCH 1/7] Added ability to add xcframework as an artifact --- .gitignore | 3 +++ Build.sh | 19 +++++++++++++------ RELEASING.md | 4 ++-- release.sh | 12 ++++++++---- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 5d51014f..2f1648db 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,6 @@ iOSInjectionProject/ Package.resolved *.xcuserdatad /.swiftpm/xcode/xcshareddata + +# XCFramework +Segment-Package_XCFramework diff --git a/Build.sh b/Build.sh index 052d2a43..610fc3d7 100755 --- a/Build.sh +++ b/Build.sh @@ -10,18 +10,22 @@ FRAMEWORK_FOLDER_NAME="${PROJECT_NAME}_XCFramework" FRAMEWORK_NAME="Segment" #xcframework path -FRAMEWORK_PATH="${HOME}/Desktop/${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_NAME}.xcframework" +FRAMEWORK_PATH="${FRAMEWORK_FOLDER_NAME}/${FRAMEWORK_NAME}.xcframework" # set path for iOS simulator archive -SIMULATOR_ARCHIVE_PATH="${HOME}/Desktop/${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive" +SIMULATOR_ARCHIVE_PATH="${FRAMEWORK_FOLDER_NAME}/simulator.xcarchive" # set path for iOS device archive -IOS_DEVICE_ARCHIVE_PATH="${HOME}/Desktop/${FRAMEWORK_FOLDER_NAME}/iOS.xcarchive" +IOS_DEVICE_ARCHIVE_PATH="${FRAMEWORK_FOLDER_NAME}/iOS.xcarchive" -rm -rf "${HOME}/Desktop/${FRAMEWORK_FOLDER_NAME}" +# clean up old releases +zip -r Segment.xcframework.zip +echo "Deleted the xcframework" + +rm -rf "${FRAMEWORK_FOLDER_NAME}" echo "Deleted ${FRAMEWORK_FOLDER_NAME}" -mkdir "${HOME}/Desktop/${FRAMEWORK_FOLDER_NAME}" +mkdir "${FRAMEWORK_FOLDER_NAME}" echo "Created ${FRAMEWORK_FOLDER_NAME}" echo "Archiving ${FRAMEWORK_NAME}" @@ -34,4 +38,7 @@ xcodebuild archive -scheme ${PROJECT_NAME} -destination="iOS" -archivePath "${IO xcodebuild -create-xcframework -framework ${SIMULATOR_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework -framework ${IOS_DEVICE_ARCHIVE_PATH}/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework -output "${FRAMEWORK_PATH}" rm -rf "${SIMULATOR_ARCHIVE_PATH}" rm -rf "${IOS_DEVICE_ARCHIVE_PATH}" -open "${HOME}/Desktop/${FRAMEWORK_FOLDER_NAME}" + +zip -r Segment.xcframework.zip "${FRAMEWORK_FOLDER_NAME}/Segment.xcframework" + +open "${FRAMEWORK_FOLDER_NAME}" diff --git a/RELEASING.md b/RELEASING.md index 5fb0b198..64e68ed8 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -2,8 +2,8 @@ Releasing ========= Use `release.sh` to perform releases. This script will perform all the safety checks as well -as update Version.swfit, commit the change, and create tag + release. History since the last +as update Version.swift, commit the change, and create tag + release. History since the last released version will be used as the changelog for the release. ex: $ ./release.sh 1.1.1 - \ No newline at end of file + diff --git a/release.sh b/release.sh index c12e8aaf..bcbc9f80 100755 --- a/release.sh +++ b/release.sh @@ -49,7 +49,7 @@ fi # check that we're on the `main` branch branch=$(git rev-parse --abbrev-ref HEAD) -if [ $branch != 'main' ] +if [ $branch != 'main' ] then echo "The 'main' must be the current branch to make a release." echo "You are currently on: $branch" @@ -68,7 +68,7 @@ version=$(sed "s/[' \"]//g" <<< "$version") echo "Analytics-Swift current version: $version" # no args, so give usage. -if [ $# -eq 0 ] +if [ $# -eq 0 ] then echo "Release automation script" echo "" @@ -87,7 +87,7 @@ case $? in 2) op='<';; esac -if [ $op != '>' ] +if [ $op != '>' ] then echo "New version must be greater than previous version ($version)." exit 1 @@ -95,7 +95,7 @@ fi read -r -p "Are you sure you want to release $newVersion? [y/N] " response case "$response" in - [yY][eE][sS]|[yY]) + [yY][eE][sS]|[yY]) ;; *) exit 1 @@ -123,4 +123,8 @@ gh release create $newVersion -F $tempFile -t "Version $newVersion" # remove the tempfile. rm $tempFile +# build up the xcframework to upload to github +./build.sh +# upload the release +gh release upload $version Segment.xcframework.zip From ba53f0f2fb4f3b98b14885f18143220138f6e84e Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Wed, 20 Apr 2022 13:48:26 -0700 Subject: [PATCH 2/7] Renamed Build.sh to build.sh --- Build.sh => build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Build.sh => build.sh (100%) diff --git a/Build.sh b/build.sh similarity index 100% rename from Build.sh rename to build.sh From 7f31f2b1e977372ae6695eee213755f25d26457e Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Wed, 20 Apr 2022 15:08:07 -0700 Subject: [PATCH 3/7] Added *.zip ignore to git --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2f1648db..7c800627 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,4 @@ Package.resolved # XCFramework Segment-Package_XCFramework +*.zip From 05972e64d7245077735dd7c4bfae63910a6378cc Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Wed, 20 Apr 2022 16:46:04 -0700 Subject: [PATCH 4/7] Added mac support --- Segment.xcodeproj/project.pbxproj | 4 + .../Platforms/Mac/macOSLifecycleEvents.swift | 188 ++++++++++++++++++ Sources/Segment/Startup.swift | 3 +- 3 files changed, 193 insertions(+), 2 deletions(-) create mode 100644 Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift diff --git a/Segment.xcodeproj/project.pbxproj b/Segment.xcodeproj/project.pbxproj index 1de1de0d..dcbb6a22 100644 --- a/Segment.xcodeproj/project.pbxproj +++ b/Segment.xcodeproj/project.pbxproj @@ -59,6 +59,7 @@ 967C40E3258D4DAF008EB0B6 /* Metrics_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967C40E2258D4DAF008EB0B6 /* Metrics_Tests.swift */; }; 9692724E25A4E5B7009B5298 /* Startup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9692724D25A4E5B7009B5298 /* Startup.swift */; }; 9692726825A583A6009B5298 /* SegmentDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9692726725A583A6009B5298 /* SegmentDestination.swift */; }; + 96A9624E2810C6B80011DE54 /* macOSLifecycleEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A9624D2810C6B80011DE54 /* macOSLifecycleEvents.swift */; }; 96A9668927BC137F00078F8B /* iOSLifecycle_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A9668827BC137F00078F8B /* iOSLifecycle_Tests.swift */; }; 96C33A9C25880A5E00F3D538 /* SegmentLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96C33A9B25880A5E00F3D538 /* SegmentLog.swift */; }; 96C33AB1258961F500F3D538 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96C33AB0258961F500F3D538 /* Settings.swift */; }; @@ -161,6 +162,7 @@ 967C40ED259A7311008EB0B6 /* HTTPClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPClient.swift; sourceTree = ""; }; 9692724D25A4E5B7009B5298 /* Startup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Startup.swift; sourceTree = ""; }; 9692726725A583A6009B5298 /* SegmentDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentDestination.swift; sourceTree = ""; }; + 96A9624D2810C6B80011DE54 /* macOSLifecycleEvents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = macOSLifecycleEvents.swift; sourceTree = ""; }; 96A9668827BC137F00078F8B /* iOSLifecycle_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSLifecycle_Tests.swift; sourceTree = ""; }; 96C33A9B25880A5E00F3D538 /* SegmentLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentLog.swift; sourceTree = ""; }; 96C33AB0258961F500F3D538 /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = ""; }; @@ -337,6 +339,7 @@ isa = PBXGroup; children = ( 46FE4C9625A3F35E003A7362 /* macOSLifecycleMonitor.swift */, + 96A9624D2810C6B80011DE54 /* macOSLifecycleEvents.swift */, ); path = Mac; sourceTree = ""; @@ -544,6 +547,7 @@ 46FE4CE025A53FAD003A7362 /* Storage.swift in Sources */, 465879BA2686560C00180335 /* watchOSDelegation.swift in Sources */, 46022764261E64A800A9E913 /* iOSLifecycleEvents.swift in Sources */, + 96A9624E2810C6B80011DE54 /* macOSLifecycleEvents.swift in Sources */, 4621080C2605332D00EBC4A8 /* KeyPath.swift in Sources */, A31A16262576B6F200C9CDDF /* Timeline.swift in Sources */, 96C33AB1258961F500F3D538 /* Settings.swift in Sources */, diff --git a/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift new file mode 100644 index 00000000..6e033de3 --- /dev/null +++ b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift @@ -0,0 +1,188 @@ +// +// macOSLifecycleEvents.swift +// Segment +// +// Created by Cody on 4/20/22. +// + +import Foundation + +#if os(macOS) + +import Cocoa + +class macOSLifecycleEvents: PlatformPlugin, macOSLifecycle { + static var versionKey = "SEGVersionKey" + static var buildKey = "SEGBuildKeyV2" + + let type = PluginType.before + var analytics: Analytics? + + /// Since application:didFinishLaunchingWithOptions is not automatically called with Scenes / SwiftUI, + /// this gets around by using a flag in user defaults to check for big events like application updating, + /// being installed or even opening. + @Atomic + private var didFinishLaunching = false + + func application(didFinishLaunchingWithOptions launchOptions: [String : Any]?) { + // Make sure we aren't double calling application:didFinishLaunchingWithOptions + // by resetting the check at the start + didFinishLaunching = true + + if analytics?.configuration.values.trackApplicationLifecycleEvents == false { + return + } + + let previousVersion = UserDefaults.standard.string(forKey: Self.versionKey) + let previousBuild = UserDefaults.standard.string(forKey: Self.buildKey) + + let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String + let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String + + if previousBuild == nil { + analytics?.track(name: "Application Installed", properties: [ + "version": currentVersion ?? "", + "build": currentBuild ?? "" + ]) + } else if currentBuild != previousBuild { + analytics?.track(name: "Application Updated", properties: [ + "previous_version": previousVersion ?? "", + "previous_build": previousBuild ?? "", + "version": currentVersion ?? "", + "build": currentBuild ?? "" + ]) + } + + analytics?.track(name: "Application Opened", properties: [ + "from_background": false, + "version": currentVersion ?? "", + "build": currentBuild ?? "" + ]) + + UserDefaults.standard.setValue(currentVersion, forKey: Self.versionKey) + UserDefaults.standard.setValue(currentBuild, forKey: Self.buildKey) + } + + func applicationWillUnHide() { + if analytics?.configuration.values.trackApplicationLifecycleEvents == false { + return + } + + let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String + let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String + + analytics?.track(name: "Application Opened", properties: [ + "from_background": true, + "version": currentVersion ?? "", + "build": currentBuild ?? "" + ]) + } + + func applicationDidHide() { + if analytics?.configuration.values.trackApplicationLifecycleEvents == false { + return + } + + analytics?.track(name: "Application Backgrounded") + } + func applicationDidResignActive() { + if analytics?.configuration.values.trackApplicationLifecycleEvents == false { + return + } + + analytics?.track(name: "Application Backgrounded") + } + + func applicationDidBecomeActive() { + if analytics?.configuration.values.trackApplicationLifecycleEvents == false { + return + } + + // Lets check if we skipped application:didFinishLaunchingWithOptions, + // if so, lets call it. + if didFinishLaunching == false { + // Call application did finish launching + self.application(didFinishLaunchingWithOptions: nil) + } + } + +// func application(_ application: UIApplication?, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) { +// +// // Make sure we aren't double calling application:didFinishLaunchingWithOptions +// // by resetting the check at the start +// didFinishLaunching = true +// +// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { +// return +// } +// +// let previousVersion = UserDefaults.standard.string(forKey: Self.versionKey) +// let previousBuild = UserDefaults.standard.string(forKey: Self.buildKey) +// +// let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String +// let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String +// +// if previousBuild == nil { +// analytics?.track(name: "Application Installed", properties: [ +// "version": currentVersion ?? "", +// "build": currentBuild ?? "" +// ]) +// } else if currentBuild != previousBuild { +// analytics?.track(name: "Application Updated", properties: [ +// "previous_version": previousVersion ?? "", +// "previous_build": previousBuild ?? "", +// "version": currentVersion ?? "", +// "build": currentBuild ?? "" +// ]) +// } +// +// analytics?.track(name: "Application Opened", properties: [ +// "from_background": false, +// "version": currentVersion ?? "", +// "build": currentBuild ?? "", +// "referring_application": launchOptions?[UIApplication.LaunchOptionsKey.sourceApplication] ?? "", +// "url": launchOptions?[UIApplication.LaunchOptionsKey.url] ?? "" +// ]) +// +// UserDefaults.standard.setValue(currentVersion, forKey: Self.versionKey) +// UserDefaults.standard.setValue(currentBuild, forKey: Self.buildKey) +// } + +// func applicationWillEnterForeground(application: UIApplication?) { +// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { +// return +// } +// +// let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String +// let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String +// +// analytics?.track(name: "Application Opened", properties: [ +// "from_background": true, +// "version": currentVersion ?? "", +// "build": currentBuild ?? "" +// ]) +// } + +// func applicationDidEnterBackground(application: UIApplication?) { +// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { +// return +// } +// +// analytics?.track(name: "Application Backgrounded") +// } +// +// func applicationDidBecomeActive(application: UIApplication?) { +// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { +// return +// } +// +// // Lets check if we skipped application:didFinishLaunchingWithOptions, +// // if so, lets call it. +// if didFinishLaunching == false { +// // Call application did finish launching +// self.application(nil, didFinishLaunchingWithOptions: nil) +// } +// } +} + +#endif diff --git a/Sources/Segment/Startup.swift b/Sources/Segment/Startup.swift index 23ab62e7..2b4bbb90 100644 --- a/Sources/Segment/Startup.swift +++ b/Sources/Segment/Startup.swift @@ -53,8 +53,7 @@ extension Analytics: Subscriber { plugins.append(watchOSLifecycleEvents()) #endif #if os(macOS) - // placeholder - need to build this - //plugins.append(macOSLifecycleEvents()) + plugins.append(macOSLifecycleEvents()) #endif #if os(Linux) // placeholder - not sure what this is yet From 86b3913369593aa0417c04e03b27b16c0f3ffa60 Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Wed, 20 Apr 2022 16:48:39 -0700 Subject: [PATCH 5/7] Updated mac support --- .../Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift index 6e033de3..cfeb53cf 100644 --- a/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift +++ b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift @@ -71,7 +71,7 @@ class macOSLifecycleEvents: PlatformPlugin, macOSLifecycle { let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String - analytics?.track(name: "Application Opened", properties: [ + analytics?.track(name: "Application Unhidden", properties: [ "from_background": true, "version": currentVersion ?? "", "build": currentBuild ?? "" @@ -83,7 +83,7 @@ class macOSLifecycleEvents: PlatformPlugin, macOSLifecycle { return } - analytics?.track(name: "Application Backgrounded") + analytics?.track(name: "Application Hidden") } func applicationDidResignActive() { if analytics?.configuration.values.trackApplicationLifecycleEvents == false { From 0a68380141756b124ae3609b27eb16a85ffc0159 Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Wed, 20 Apr 2022 16:51:21 -0700 Subject: [PATCH 6/7] Updated mac support --- .../Plugins/Platforms/Mac/macOSLifecycleEvents.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift index cfeb53cf..687b52f9 100644 --- a/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift +++ b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift @@ -63,7 +63,7 @@ class macOSLifecycleEvents: PlatformPlugin, macOSLifecycle { UserDefaults.standard.setValue(currentBuild, forKey: Self.buildKey) } - func applicationWillUnHide() { + func applicationDidUnhide() { if analytics?.configuration.values.trackApplicationLifecycleEvents == false { return } @@ -106,6 +106,14 @@ class macOSLifecycleEvents: PlatformPlugin, macOSLifecycle { } } + func applicationWillTerminate() { + if analytics?.configuration.values.trackApplicationLifecycleEvents == false { + return + } + + analytics?.track(name: "Application Terminated") + } + // func application(_ application: UIApplication?, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) { // // // Make sure we aren't double calling application:didFinishLaunchingWithOptions From da9954e5d4a322f993d4dd765413257aef8dcb63 Mon Sep 17 00:00:00 2001 From: Cody Garvin Date: Wed, 20 Apr 2022 16:53:59 -0700 Subject: [PATCH 7/7] Cleaned up unused mac code --- .../Platforms/Mac/macOSLifecycleEvents.swift | 78 ------------------- 1 file changed, 78 deletions(-) diff --git a/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift index 687b52f9..57509dcb 100644 --- a/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift +++ b/Sources/Segment/Plugins/Platforms/Mac/macOSLifecycleEvents.swift @@ -113,84 +113,6 @@ class macOSLifecycleEvents: PlatformPlugin, macOSLifecycle { analytics?.track(name: "Application Terminated") } - -// func application(_ application: UIApplication?, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) { -// -// // Make sure we aren't double calling application:didFinishLaunchingWithOptions -// // by resetting the check at the start -// didFinishLaunching = true -// -// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { -// return -// } -// -// let previousVersion = UserDefaults.standard.string(forKey: Self.versionKey) -// let previousBuild = UserDefaults.standard.string(forKey: Self.buildKey) -// -// let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String -// let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String -// -// if previousBuild == nil { -// analytics?.track(name: "Application Installed", properties: [ -// "version": currentVersion ?? "", -// "build": currentBuild ?? "" -// ]) -// } else if currentBuild != previousBuild { -// analytics?.track(name: "Application Updated", properties: [ -// "previous_version": previousVersion ?? "", -// "previous_build": previousBuild ?? "", -// "version": currentVersion ?? "", -// "build": currentBuild ?? "" -// ]) -// } -// -// analytics?.track(name: "Application Opened", properties: [ -// "from_background": false, -// "version": currentVersion ?? "", -// "build": currentBuild ?? "", -// "referring_application": launchOptions?[UIApplication.LaunchOptionsKey.sourceApplication] ?? "", -// "url": launchOptions?[UIApplication.LaunchOptionsKey.url] ?? "" -// ]) -// -// UserDefaults.standard.setValue(currentVersion, forKey: Self.versionKey) -// UserDefaults.standard.setValue(currentBuild, forKey: Self.buildKey) -// } - -// func applicationWillEnterForeground(application: UIApplication?) { -// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { -// return -// } -// -// let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String -// let currentBuild = Bundle.main.infoDictionary?["CFBundleVersion"] as? String -// -// analytics?.track(name: "Application Opened", properties: [ -// "from_background": true, -// "version": currentVersion ?? "", -// "build": currentBuild ?? "" -// ]) -// } - -// func applicationDidEnterBackground(application: UIApplication?) { -// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { -// return -// } -// -// analytics?.track(name: "Application Backgrounded") -// } -// -// func applicationDidBecomeActive(application: UIApplication?) { -// if analytics?.configuration.values.trackApplicationLifecycleEvents == false { -// return -// } -// -// // Lets check if we skipped application:didFinishLaunchingWithOptions, -// // if so, lets call it. -// if didFinishLaunching == false { -// // Call application did finish launching -// self.application(nil, didFinishLaunchingWithOptions: nil) -// } -// } } #endif