diff --git a/.gitignore b/.gitignore index 8615121..0cfdf50 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ DerivedData # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # -# Pods/ +Pods/ # Carthage # diff --git a/Example/Gemfile b/Example/Gemfile new file mode 100644 index 0000000..65b258a --- /dev/null +++ b/Example/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gem "cocoapods", "0.36.4" +gem "CFPropertyList", "2.3.1" diff --git a/Example/Gemfile.lock b/Example/Gemfile.lock new file mode 100644 index 0000000..e9422bc --- /dev/null +++ b/Example/Gemfile.lock @@ -0,0 +1,59 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.1) + activesupport (4.2.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + claide (0.8.1) + cocoapods (0.36.4) + activesupport (>= 3.2.15) + claide (~> 0.8.1) + cocoapods-core (= 0.36.4) + cocoapods-downloader (~> 0.9.0) + cocoapods-plugins (~> 0.4.1) + cocoapods-trunk (~> 0.6.0) + cocoapods-try (~> 0.4.3) + colored (~> 1.2) + escape (~> 0.0.4) + molinillo (~> 0.2.1) + nap (~> 0.8) + open4 (~> 1.3) + xcodeproj (~> 0.23.1) + cocoapods-core (0.36.4) + activesupport (>= 3.2.15) + fuzzy_match (~> 2.0.4) + nap (~> 0.8.0) + cocoapods-downloader (0.9.0) + cocoapods-plugins (0.4.2) + nap + cocoapods-trunk (0.6.0) + nap (>= 0.8) + netrc (= 0.7.8) + cocoapods-try (0.4.4) + colored (1.2) + escape (0.0.4) + fuzzy_match (2.0.4) + i18n (0.7.0) + json (1.8.2) + minitest (5.6.1) + molinillo (0.2.3) + nap (0.8.0) + netrc (0.7.8) + open4 (1.3.4) + thread_safe (0.3.5) + tzinfo (1.2.2) + thread_safe (~> 0.1) + xcodeproj (0.23.1) + activesupport (>= 3) + colored (~> 1.2) + +PLATFORMS + ruby + +DEPENDENCIES + CFPropertyList (= 2.3.1) + cocoapods (= 0.36.4) diff --git a/Example/HEAnalyticsExample.xcodeproj/project.pbxproj b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..939b343 --- /dev/null +++ b/Example/HEAnalyticsExample.xcodeproj/project.pbxproj @@ -0,0 +1,555 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 791FBE711AFB76F000E3453C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE701AFB76F000E3453C /* AppDelegate.swift */; }; + 791FBE731AFB76F000E3453C /* FirstViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE721AFB76F000E3453C /* FirstViewController.swift */; }; + 791FBE751AFB76F000E3453C /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE741AFB76F000E3453C /* SecondViewController.swift */; }; + 791FBE781AFB76F000E3453C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE761AFB76F000E3453C /* Main.storyboard */; }; + 791FBE7A1AFB76F000E3453C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE791AFB76F000E3453C /* Images.xcassets */; }; + 791FBE7D1AFB76F000E3453C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */; }; + 791FBE891AFB76F000E3453C /* HEAnalyticsExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */; }; + 794B108D1AFB799300D93A51 /* HEAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10851AFB799300D93A51 /* HEAnalytics.swift */; }; + 794B108E1AFB799300D93A51 /* HEAnalyticsData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10861AFB799300D93A51 /* HEAnalyticsData.swift */; }; + 794B108F1AFB799300D93A51 /* HEAnalyticsPlatform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10871AFB799300D93A51 /* HEAnalyticsPlatform.swift */; }; + 794B10901AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10881AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift */; }; + 794B10911AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B10891AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift */; }; + 794B10921AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108A1AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift */; }; + 794B10931AFB799300D93A51 /* HEJSONHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */; }; + 794B10941AFB799300D93A51 /* UIViewController+HEAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */; }; + 799860571AFCC5BD00C70A50 /* SampleAnalytics.swift in Sources */ = {isa = PBXBuildFile; fileRef = 799860561AFCC5BD00C70A50 /* SampleAnalytics.swift */; }; + A38557D5FD85E22805F9A167 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3900659B69E7C5ABD2A12D2 /* libPods.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 791FBE831AFB76F000E3453C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 791FBE631AFB76F000E3453C /* Project object */; + proxyType = 1; + remoteGlobalIDString = 791FBE6A1AFB76F000E3453C; + remoteInfo = HEAnalyticsExample; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 3C4DDED3DD9F2A52F9D4EBCC /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 791FBE6B1AFB76F000E3453C /* HEAnalyticsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HEAnalyticsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 791FBE6F1AFB76F000E3453C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 791FBE701AFB76F000E3453C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 791FBE721AFB76F000E3453C /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; + 791FBE741AFB76F000E3453C /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = ""; }; + 791FBE771AFB76F000E3453C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 791FBE791AFB76F000E3453C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 791FBE7C1AFB76F000E3453C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HEAnalyticsExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 791FBE871AFB76F000E3453C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HEAnalyticsExampleTests.swift; sourceTree = ""; }; + 794B10851AFB799300D93A51 /* HEAnalytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalytics.swift; sourceTree = ""; }; + 794B10861AFB799300D93A51 /* HEAnalyticsData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsData.swift; sourceTree = ""; }; + 794B10871AFB799300D93A51 /* HEAnalyticsPlatform.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatform.swift; sourceTree = ""; }; + 794B10881AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatformFlurry.swift; sourceTree = ""; }; + 794B10891AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatformGAI.swift; sourceTree = ""; }; + 794B108A1AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEAnalyticsPlatformMixpanel.swift; sourceTree = ""; }; + 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HEJSONHelper.swift; sourceTree = ""; }; + 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+HEAnalytics.swift"; sourceTree = ""; }; + 794B10951AFB7A4100D93A51 /* HEAnalyticsExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HEAnalyticsExample-Bridging-Header.h"; sourceTree = ""; }; + 799860561AFCC5BD00C70A50 /* SampleAnalytics.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SampleAnalytics.swift; sourceTree = ""; }; + C3900659B69E7C5ABD2A12D2 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 791FBE681AFB76F000E3453C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A38557D5FD85E22805F9A167 /* libPods.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 791FBE7F1AFB76F000E3453C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 585EB69047BCD6B9C2889A51 /* Pods */ = { + isa = PBXGroup; + children = ( + D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */, + 3C4DDED3DD9F2A52F9D4EBCC /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 791FBE621AFB76F000E3453C = { + isa = PBXGroup; + children = ( + 794B10841AFB799300D93A51 /* HEAnalytics */, + 791FBE6D1AFB76F000E3453C /* HEAnalyticsExample */, + 791FBE851AFB76F000E3453C /* HEAnalyticsExampleTests */, + 791FBE6C1AFB76F000E3453C /* Products */, + 585EB69047BCD6B9C2889A51 /* Pods */, + D952D336F3218A19D4273B4E /* Frameworks */, + ); + sourceTree = ""; + }; + 791FBE6C1AFB76F000E3453C /* Products */ = { + isa = PBXGroup; + children = ( + 791FBE6B1AFB76F000E3453C /* HEAnalyticsExample.app */, + 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 791FBE6D1AFB76F000E3453C /* HEAnalyticsExample */ = { + isa = PBXGroup; + children = ( + 799860561AFCC5BD00C70A50 /* SampleAnalytics.swift */, + 791FBE701AFB76F000E3453C /* AppDelegate.swift */, + 791FBE721AFB76F000E3453C /* FirstViewController.swift */, + 791FBE741AFB76F000E3453C /* SecondViewController.swift */, + 791FBE761AFB76F000E3453C /* Main.storyboard */, + 791FBE791AFB76F000E3453C /* Images.xcassets */, + 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */, + 791FBE6E1AFB76F000E3453C /* Supporting Files */, + ); + path = HEAnalyticsExample; + sourceTree = ""; + }; + 791FBE6E1AFB76F000E3453C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 791FBE6F1AFB76F000E3453C /* Info.plist */, + 794B10951AFB7A4100D93A51 /* HEAnalyticsExample-Bridging-Header.h */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 791FBE851AFB76F000E3453C /* HEAnalyticsExampleTests */ = { + isa = PBXGroup; + children = ( + 791FBE881AFB76F000E3453C /* HEAnalyticsExampleTests.swift */, + 791FBE861AFB76F000E3453C /* Supporting Files */, + ); + path = HEAnalyticsExampleTests; + sourceTree = ""; + }; + 791FBE861AFB76F000E3453C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 791FBE871AFB76F000E3453C /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 794B10841AFB799300D93A51 /* HEAnalytics */ = { + isa = PBXGroup; + children = ( + 794B10851AFB799300D93A51 /* HEAnalytics.swift */, + 794B10861AFB799300D93A51 /* HEAnalyticsData.swift */, + 794B10871AFB799300D93A51 /* HEAnalyticsPlatform.swift */, + 794B10881AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift */, + 794B10891AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift */, + 794B108A1AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift */, + 794B108B1AFB799300D93A51 /* HEJSONHelper.swift */, + 794B108C1AFB799300D93A51 /* UIViewController+HEAnalytics.swift */, + ); + name = HEAnalytics; + path = ../HEAnalytics; + sourceTree = ""; + }; + D952D336F3218A19D4273B4E /* Frameworks */ = { + isa = PBXGroup; + children = ( + C3900659B69E7C5ABD2A12D2 /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 791FBE6A1AFB76F000E3453C /* HEAnalyticsExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 791FBE8C1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExample" */; + buildPhases = ( + E0393E6E471229E03CBD6C30 /* Check Pods Manifest.lock */, + 791FBE671AFB76F000E3453C /* Sources */, + 791FBE681AFB76F000E3453C /* Frameworks */, + 791FBE691AFB76F000E3453C /* Resources */, + 32B7D6E56AEFFD870DE7E27D /* Copy Pods Resources */, + 799860551AFCC41300C70A50 /* Run Script - HEAnalytics Config */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HEAnalyticsExample; + productName = HEAnalyticsExample; + productReference = 791FBE6B1AFB76F000E3453C /* HEAnalyticsExample.app */; + productType = "com.apple.product-type.application"; + }; + 791FBE811AFB76F000E3453C /* HEAnalyticsExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 791FBE8F1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExampleTests" */; + buildPhases = ( + 791FBE7E1AFB76F000E3453C /* Sources */, + 791FBE7F1AFB76F000E3453C /* Frameworks */, + 791FBE801AFB76F000E3453C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 791FBE841AFB76F000E3453C /* PBXTargetDependency */, + ); + name = HEAnalyticsExampleTests; + productName = HEAnalyticsExampleTests; + productReference = 791FBE821AFB76F000E3453C /* HEAnalyticsExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 791FBE631AFB76F000E3453C /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + ORGANIZATIONNAME = "Hsoi Enterprises LLC"; + TargetAttributes = { + 791FBE6A1AFB76F000E3453C = { + CreatedOnToolsVersion = 6.4; + }; + 791FBE811AFB76F000E3453C = { + CreatedOnToolsVersion = 6.4; + TestTargetID = 791FBE6A1AFB76F000E3453C; + }; + }; + }; + buildConfigurationList = 791FBE661AFB76F000E3453C /* Build configuration list for PBXProject "HEAnalyticsExample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 791FBE621AFB76F000E3453C; + productRefGroup = 791FBE6C1AFB76F000E3453C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 791FBE6A1AFB76F000E3453C /* HEAnalyticsExample */, + 791FBE811AFB76F000E3453C /* HEAnalyticsExampleTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 791FBE691AFB76F000E3453C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 791FBE781AFB76F000E3453C /* Main.storyboard in Resources */, + 791FBE7D1AFB76F000E3453C /* LaunchScreen.xib in Resources */, + 791FBE7A1AFB76F000E3453C /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 791FBE801AFB76F000E3453C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 32B7D6E56AEFFD870DE7E27D /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 799860551AFCC41300C70A50 /* Run Script - HEAnalytics Config */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script - HEAnalytics Config"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "script_file=\"AppBuildPostflight.rb\"\n\necho \"Running a custom build phase script: $script_file\"\n${PROJECT_DIR}/HEAnalyticsExample/BuildScripts/${script_file}\nscriptExitStatus=$?\necho \"DONE with script: ${script_file} (exitStatus=${scriptExitStatus})\\n\\n\"\nexit \"${scriptExitStatus}\"\n"; + }; + E0393E6E471229E03CBD6C30 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 791FBE671AFB76F000E3453C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 791FBE751AFB76F000E3453C /* SecondViewController.swift in Sources */, + 794B10941AFB799300D93A51 /* UIViewController+HEAnalytics.swift in Sources */, + 794B108E1AFB799300D93A51 /* HEAnalyticsData.swift in Sources */, + 794B10911AFB799300D93A51 /* HEAnalyticsPlatformGAI.swift in Sources */, + 794B108D1AFB799300D93A51 /* HEAnalytics.swift in Sources */, + 794B10931AFB799300D93A51 /* HEJSONHelper.swift in Sources */, + 794B10901AFB799300D93A51 /* HEAnalyticsPlatformFlurry.swift in Sources */, + 791FBE711AFB76F000E3453C /* AppDelegate.swift in Sources */, + 794B108F1AFB799300D93A51 /* HEAnalyticsPlatform.swift in Sources */, + 791FBE731AFB76F000E3453C /* FirstViewController.swift in Sources */, + 799860571AFCC5BD00C70A50 /* SampleAnalytics.swift in Sources */, + 794B10921AFB799300D93A51 /* HEAnalyticsPlatformMixpanel.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 791FBE7E1AFB76F000E3453C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 791FBE891AFB76F000E3453C /* HEAnalyticsExampleTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 791FBE841AFB76F000E3453C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 791FBE6A1AFB76F000E3453C /* HEAnalyticsExample */; + targetProxy = 791FBE831AFB76F000E3453C /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 791FBE761AFB76F000E3453C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 791FBE771AFB76F000E3453C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 791FBE7B1AFB76F000E3453C /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 791FBE7C1AFB76F000E3453C /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 791FBE8A1AFB76F000E3453C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 791FBE8B1AFB76F000E3453C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 791FBE8D1AFB76F000E3453C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D1FB6D3D95B4C56DF5DB3762 /* Pods.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = HEAnalyticsExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h"; + }; + name = Debug; + }; + 791FBE8E1AFB76F000E3453C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3C4DDED3DD9F2A52F9D4EBCC /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = HEAnalyticsExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h"; + }; + name = Release; + }; + 791FBE901AFB76F000E3453C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = HEAnalyticsExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HEAnalyticsExample.app/HEAnalyticsExample"; + }; + name = Debug; + }; + 791FBE911AFB76F000E3453C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = HEAnalyticsExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HEAnalyticsExample.app/HEAnalyticsExample"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 791FBE661AFB76F000E3453C /* Build configuration list for PBXProject "HEAnalyticsExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 791FBE8A1AFB76F000E3453C /* Debug */, + 791FBE8B1AFB76F000E3453C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 791FBE8C1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 791FBE8D1AFB76F000E3453C /* Debug */, + 791FBE8E1AFB76F000E3453C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 791FBE8F1AFB76F000E3453C /* Build configuration list for PBXNativeTarget "HEAnalyticsExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 791FBE901AFB76F000E3453C /* Debug */, + 791FBE911AFB76F000E3453C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 791FBE631AFB76F000E3453C /* Project object */; +} diff --git a/Example/HEAnalyticsExample.xcworkspace/contents.xcworkspacedata b/Example/HEAnalyticsExample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c6e8100 --- /dev/null +++ b/Example/HEAnalyticsExample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Debug/AnalyticsPlatformConfig.plist b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Debug/AnalyticsPlatformConfig.plist new file mode 100644 index 0000000..bb4fdda --- /dev/null +++ b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Debug/AnalyticsPlatformConfig.plist @@ -0,0 +1,22 @@ + + + + + HEAnalyticsPlatformGAI + + trackingID + UA-61735748-3 + dispatchInterval + 10 + logLevel + 4 + + HEAnalyticsPlatformFlurry + + apiKey + P9YDTB5WD6288CH33YP9 + logLevel + 3 + + + diff --git a/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Release/AnalyticsPlatformConfig.plist b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Release/AnalyticsPlatformConfig.plist new file mode 100644 index 0000000..f5afca8 --- /dev/null +++ b/Example/HEAnalyticsExample/AnalyticsPlatformConfig/Release/AnalyticsPlatformConfig.plist @@ -0,0 +1,20 @@ + + + + + HEAnalyticsPlatformGAI + + trackingID + UA-61735748-3 + dispatchInterval + 15 + + HEAnalyticsPlatformFlurry + + apiKey + P9YDTB5WD6288CH33YP9 + logLevel + 0 + + + diff --git a/Example/HEAnalyticsExample/AppDelegate.swift b/Example/HEAnalyticsExample/AppDelegate.swift new file mode 100644 index 0000000..5ec497e --- /dev/null +++ b/Example/HEAnalyticsExample/AppDelegate.swift @@ -0,0 +1,67 @@ +// +// AppDelegate.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { + SampleAnalytics.sharedInstance.start() + return true + } + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + + if let tabController = window?.rootViewController as? UITabBarController { + tabController.delegate = self + } + + return true + } + + func applicationWillResignActive(application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + +} + + +extension AppDelegate : UITabBarControllerDelegate { + + func tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) { + if tabBarController.selectedIndex == 0 { + SampleAnalytics.sharedInstance.selectedTab1() + } + else if tabBarController.selectedIndex == 1 { + SampleAnalytics.sharedInstance.selectedTab2() + } + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/Base.lproj/LaunchScreen.xib b/Example/HEAnalyticsExample/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..525a7e7 --- /dev/null +++ b/Example/HEAnalyticsExample/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/HEAnalyticsExample/Base.lproj/Main.storyboard b/Example/HEAnalyticsExample/Base.lproj/Main.storyboard new file mode 100644 index 0000000..77ba998 --- /dev/null +++ b/Example/HEAnalyticsExample/Base.lproj/Main.storyboard @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/HEAnalyticsExample/BuildScripts/AppBuildPostflight.rb b/Example/HEAnalyticsExample/BuildScripts/AppBuildPostflight.rb new file mode 100755 index 0000000..36368ca --- /dev/null +++ b/Example/HEAnalyticsExample/BuildScripts/AppBuildPostflight.rb @@ -0,0 +1,42 @@ +#!/usr/bin/ruby + +# AppBuildPostflight.rb + +require 'pathname' +require 'fileutils' +require 'rubygems' +require 'cfpropertylist' # gem is actually named "CFPropertyList" + + +built_app_path = Pathname.new(ENV['CONFIGURATION_BUILD_DIR'] + "/" + ENV['EXECUTABLE_NAME'] + ENV['WRAPPER_SUFFIX']) + +### Copy in the AnalyticsPlatformConfig file. + +analyticsplatformconfig_folder_path = Pathname.new(ENV['SRCROOT'] + "/HEAnalyticsExample/AnalyticsPlatformConfig/" + ENV['CONFIGURATION']) +configplist_file_path = Pathname.new(analyticsplatformconfig_folder_path + "AnalyticsPlatformConfig.plist") +FileUtils.cp_r File.expand_path(configplist_file_path), built_app_path + + +### Massage the Info.plist. +# We do this here because the Info.plist that's actually in the project file isn't directly used by Xcode, but +# rather Xcode uses it as the basis for the end Info.plist, but also inserts a bunch of other things +# in there during the build process. What we need to do is come in after the fact an modify the generated +# Info.plist. + +# Get the git version hash that we're building from, so we can insert it into the Info.plist. +gitver = `git rev-parse --short HEAD`.strip + +info_plist_file_path = Pathname.new(built_app_path + "Info.plist") +info_plist = CFPropertyList::List.new(:file => info_plist_file_path) + +#plist_additions_file_path = Pathname.new(ENV['SRCROOT'] + "/BuildResources/Common/InfoPlistAdditions.plist") +#plist_additions = CFPropertyList::List.new(:file => plist_additions_file_path.to_s) +#plist_additions_native = CFPropertyList.native_types(plist_additions.value) + +#plist_additions_native.each do | key, value | +# info_plist.value.value[key] = CFPropertyList.guess(value) +#end + +info_plist.value.value['HESourceVersion'] = CFPropertyList::CFString.new(gitver) + +info_plist.save(info_plist_file_path, CFPropertyList::List::FORMAT_BINARY) diff --git a/Example/HEAnalyticsExample/FirstViewController.swift b/Example/HEAnalyticsExample/FirstViewController.swift new file mode 100644 index 0000000..cf2f9f8 --- /dev/null +++ b/Example/HEAnalyticsExample/FirstViewController.swift @@ -0,0 +1,25 @@ +// +// FirstViewController.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit + +class FirstViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/Example/HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h b/Example/HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h new file mode 100644 index 0000000..96cb600 --- /dev/null +++ b/Example/HEAnalyticsExample/HEAnalyticsExample-Bridging-Header.h @@ -0,0 +1,13 @@ +// +// HEAnalyticsExample-Bridging-Header.h +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +#import +#import +#import +#import +#import diff --git a/Example/HEAnalyticsExample/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/HEAnalyticsExample/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..118c98f --- /dev/null +++ b/Example/HEAnalyticsExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/Images.xcassets/first.imageset/Contents.json b/Example/HEAnalyticsExample/Images.xcassets/first.imageset/Contents.json new file mode 100644 index 0000000..33a7451 --- /dev/null +++ b/Example/HEAnalyticsExample/Images.xcassets/first.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "first.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/Images.xcassets/first.imageset/first.pdf b/Example/HEAnalyticsExample/Images.xcassets/first.imageset/first.pdf new file mode 100644 index 0000000..47d911d Binary files /dev/null and b/Example/HEAnalyticsExample/Images.xcassets/first.imageset/first.pdf differ diff --git a/Example/HEAnalyticsExample/Images.xcassets/second.imageset/Contents.json b/Example/HEAnalyticsExample/Images.xcassets/second.imageset/Contents.json new file mode 100644 index 0000000..03bd9c9 --- /dev/null +++ b/Example/HEAnalyticsExample/Images.xcassets/second.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "second.pdf" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/HEAnalyticsExample/Images.xcassets/second.imageset/second.pdf b/Example/HEAnalyticsExample/Images.xcassets/second.imageset/second.pdf new file mode 100644 index 0000000..401614e Binary files /dev/null and b/Example/HEAnalyticsExample/Images.xcassets/second.imageset/second.pdf differ diff --git a/Example/HEAnalyticsExample/Info.plist b/Example/HEAnalyticsExample/Info.plist new file mode 100644 index 0000000..2341261 --- /dev/null +++ b/Example/HEAnalyticsExample/Info.plist @@ -0,0 +1,50 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.hsoienterprises.heanalyticssample.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/HEAnalyticsExample/SampleAnalytics.swift b/Example/HEAnalyticsExample/SampleAnalytics.swift new file mode 100644 index 0000000..2684bb0 --- /dev/null +++ b/Example/HEAnalyticsExample/SampleAnalytics.swift @@ -0,0 +1,29 @@ +// +// SampleAnalytics.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/8/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import Foundation + +/** SampleAnalytics Class + +*/ +class SampleAnalytics : HEAnalytics { + + static let sharedInstance = SampleAnalytics() + + + func selectedTab1() { + let data = HEAnalyticsData(category: .View, event: "Selected Tab 1") + self.trackData(data) + } + + func selectedTab2() { + let data = HEAnalyticsData(category: .View, event: "Selected Tab 2") + self.trackData(data) + } + +} diff --git a/Example/HEAnalyticsExample/SecondViewController.swift b/Example/HEAnalyticsExample/SecondViewController.swift new file mode 100644 index 0000000..197ce87 --- /dev/null +++ b/Example/HEAnalyticsExample/SecondViewController.swift @@ -0,0 +1,25 @@ +// +// SecondViewController.swift +// HEAnalyticsExample +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit + +class SecondViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/Example/HEAnalyticsExampleTests/HEAnalyticsExampleTests.swift b/Example/HEAnalyticsExampleTests/HEAnalyticsExampleTests.swift new file mode 100644 index 0000000..fdd0cd9 --- /dev/null +++ b/Example/HEAnalyticsExampleTests/HEAnalyticsExampleTests.swift @@ -0,0 +1,36 @@ +// +// HEAnalyticsExampleTests.swift +// HEAnalyticsExampleTests +// +// Created by hsoi on 5/7/15. +// Copyright (c) 2015 Hsoi Enterprises LLC. All rights reserved. +// + +import UIKit +import XCTest + +class HEAnalyticsExampleTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Example/HEAnalyticsExampleTests/Info.plist b/Example/HEAnalyticsExampleTests/Info.plist new file mode 100644 index 0000000..4ddcc23 --- /dev/null +++ b/Example/HEAnalyticsExampleTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.hsoienterprises.heanalyticssample.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Example/Podfile b/Example/Podfile new file mode 100644 index 0000000..2db0767 --- /dev/null +++ b/Example/Podfile @@ -0,0 +1,8 @@ +platform :ios, '8.0' +source 'https://github.com/CocoaPods/Specs.git' + +inhibit_all_warnings! + +pod 'GoogleAnalytics-iOS-SDK' +pod 'Mixpanel' +pod 'FlurrySDK' diff --git a/Example/Podfile.lock b/Example/Podfile.lock new file mode 100644 index 0000000..77c0f54 --- /dev/null +++ b/Example/Podfile.lock @@ -0,0 +1,24 @@ +PODS: + - FlurrySDK (6.2.0): + - FlurrySDK/FlurrySDK (= 6.2.0) + - FlurrySDK/FlurrySDK (6.2.0) + - GoogleAnalytics-iOS-SDK (3.11): + - GoogleAnalytics-iOS-SDK/Core (= 3.11) + - GoogleAnalytics-iOS-SDK/Core (3.11) + - Mixpanel (2.8.0): + - Mixpanel/Mixpanel (= 2.8.0) + - Mixpanel/Mixpanel (2.8.0): + - Mixpanel/MPCategoryHelpers + - Mixpanel/MPCategoryHelpers (2.8.0) + +DEPENDENCIES: + - FlurrySDK + - GoogleAnalytics-iOS-SDK + - Mixpanel + +SPEC CHECKSUMS: + FlurrySDK: 6d8cc2f898589214ed72e481cf59cffa55b88fe0 + GoogleAnalytics-iOS-SDK: fb15cc7e3d01d06d531653f37443fda90274d53d + Mixpanel: 933b51dd0c7914c80866b3753ef407dce353ebc9 + +COCOAPODS: 0.36.4 diff --git a/HEAnalytics/HEAnalytics.swift b/HEAnalytics/HEAnalytics.swift index f1f10ca..9304f3d 100644 --- a/HEAnalytics/HEAnalytics.swift +++ b/HEAnalytics/HEAnalytics.swift @@ -39,15 +39,6 @@ HEAnalytics provides a base API for logging analytics. */ public class HEAnalytics: NSObject { - /* - class var sharedInstance: HEAnalytics { - struct Static { - static let instance: HEAnalytics = HEAnalytics() - } - return Static.instance - } - */ - override init() { super.init() diff --git a/HEAnalytics/HEAnalyticsPlatform.swift b/HEAnalytics/HEAnalyticsPlatform.swift index 4cadf77..c2c2ebc 100644 --- a/HEAnalytics/HEAnalyticsPlatform.swift +++ b/HEAnalytics/HEAnalyticsPlatform.swift @@ -33,6 +33,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import Foundation +import UIKit /** HEAnalyticsPlatform provides the base class and structure for implementing an analytics platform's specific API and integrating it into the HEAnalytics framework. diff --git a/HEAnalytics/HEAnalyticsPlatformFlurry.swift b/HEAnalytics/HEAnalyticsPlatformFlurry.swift index ebbf77f..bb30624 100644 --- a/HEAnalytics/HEAnalyticsPlatformFlurry.swift +++ b/HEAnalytics/HEAnalyticsPlatformFlurry.swift @@ -64,7 +64,7 @@ class HEAnalyticsPlatformFlurry: HEAnalyticsPlatform { Flurry.setAppVersion(self.appVersion()) - let apiKey = platformData["apiKey"] as String + let apiKey = platformData["apiKey"] as! String Flurry.startSession(apiKey) super.initializePlatform(platformData) @@ -79,8 +79,8 @@ class HEAnalyticsPlatformFlurry: HEAnalyticsPlatform { // // If you'd like a different approach, subclass and override. let infoDict = NSBundle.mainBundle().infoDictionary! - let shortVersion = infoDict["CFBundleShortVersionString"] as String - let bundleVersion = infoDict["CFBundleVersion"] as String + let shortVersion = infoDict["CFBundleShortVersionString"] as! String + let bundleVersion = infoDict["CFBundleVersion"] as! String let flurryVersion = shortVersion + "." + bundleVersion return flurryVersion } diff --git a/HEAnalytics/HEAnalyticsPlatformGAI.swift b/HEAnalytics/HEAnalyticsPlatformGAI.swift index f34b301..7e1b9c9 100644 --- a/HEAnalytics/HEAnalyticsPlatformGAI.swift +++ b/HEAnalytics/HEAnalyticsPlatformGAI.swift @@ -47,6 +47,9 @@ class HEAnalyticsPlatformGAI: HEAnalyticsPlatform { override func initializePlatform(platformData: [NSObject:AnyObject]) { + let trackingID = platformData["trackingID"] as! String + GAI.sharedInstance().trackerWithTrackingId(trackingID) + if let dispatchInterval = platformData["dispatchInterval"] as? NSTimeInterval { GAI.sharedInstance().dispatchInterval = dispatchInterval } @@ -65,10 +68,6 @@ class HEAnalyticsPlatformGAI: HEAnalyticsPlatform { #endif } - if let trackingID = platformData["trackingID"] as? String { - GAI.sharedInstance().trackerWithTrackingId(trackingID) - } - if let dryRun = platformData["dryRun"] as? Bool { GAI.sharedInstance().dryRun = dryRun } diff --git a/HEAnalytics/HEAnalyticsPlatformMixpanel.swift b/HEAnalytics/HEAnalyticsPlatformMixpanel.swift index 5bd5020..45af135 100644 --- a/HEAnalytics/HEAnalyticsPlatformMixpanel.swift +++ b/HEAnalytics/HEAnalyticsPlatformMixpanel.swift @@ -57,9 +57,8 @@ class HEAnalyticsPlatformMixpanel: HEAnalyticsPlatform { defaultFlushInterval = flushInterval } - if let token = platformData["token"] as? String { - self.mixpanel = Mixpanel(token: token, launchOptions: nil, andFlushInterval: defaultFlushInterval) - } + let token = platformData["token"] as! String + self.mixpanel = Mixpanel(token: token, launchOptions: nil, andFlushInterval: defaultFlushInterval) if let flushOnBackground = platformData["flushOnBackground"] as? Bool { self.mixpanel.flushOnBackground = flushOnBackground diff --git a/HEAnalytics/HEJSONHelper.swift b/HEAnalytics/HEJSONHelper.swift index c3d75ce..cc85cf5 100644 --- a/HEAnalytics/HEJSONHelper.swift +++ b/HEAnalytics/HEJSONHelper.swift @@ -165,8 +165,8 @@ public class HEJSONHelper: NSObject { var keys = sorted(dictionary.keys) { (obj1, obj2) in - // NOTE: These forced casts should not fail, but if they do, we'll need to find - // another solution. + // Forcing casts because they SHOULD be strings. If they are not, then there's programmer error somewhere + // and we should crash to become aware of whatever the problem is. let s1 = obj1 as! String let s2 = obj2 as! String return s1 < s2 diff --git a/HEAnalytics/UIViewController+HEAnalytics.swift b/HEAnalytics/UIViewController+HEAnalytics.swift index 2e8ef56..b4893dc 100644 --- a/HEAnalytics/UIViewController+HEAnalytics.swift +++ b/HEAnalytics/UIViewController+HEAnalytics.swift @@ -32,7 +32,7 @@ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -import Foundation +import UIKit /** HEAnalytic's extension to UIViewController. diff --git a/README.md b/README.md index 9e3e89f..ddf8198 100644 --- a/README.md +++ b/README.md @@ -35,14 +35,12 @@ It enables logic for converting the data-to-track into something the analytics A Developed with -- Xcode 6.2 -- Swift 1.1 +- Xcode 6.4 beta 2 (should work with Xcode 6.3.1) +- Swift 1.2 - iOS 8 It should work with iOS 7, but has not been extensively tested. -Swift 1.2 support is planned. - No effort has been made to make this work on Mac OS X, and there are presently no plans to do so. @@ -98,12 +96,7 @@ Second, `HEAnalytics` aims to provide a unified abstraction layer for analytics Code would look something like this: class MyAppAnalytics: HEAnalytics { - class var sharedInstance: MyAppAnalytics { - struct Static { - static let instance: MyAppAnalytics = MyAppAnalytics() - } - return Static.instance - } + static let sharedInstance = MyAppAnalytics() func trackSliderValue(value: Float) { let parameters = ["value": value]