From dc6920f56cfb3d1764e007eabd22df87c027a082 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Thu, 27 May 2021 16:31:01 -0700 Subject: [PATCH 1/4] Beginnings of Adjust destination and dest examples --- .../project.pbxproj | 403 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../DestinationsExample/AppDelegate.swift | 46 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../Base.lproj/Main.storyboard | 24 ++ .../DestinationsExample/Info.plist | 66 +++ .../DestinationsExample/SceneDelegate.swift | 52 +++ .../DestinationsExample/ViewController.swift | 21 + .../AdjustDestination.swift | 210 +++++++++ Sources/Segment/Settings.swift | 5 + Sources/Segment/Utilities/Atomic.swift | 8 +- 17 files changed, 1004 insertions(+), 4 deletions(-) create mode 100644 Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj create mode 100644 Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/contents.xcworkspacedata create mode 100644 Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/Contents.json create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/LaunchScreen.storyboard create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/Info.plist create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/SceneDelegate.swift create mode 100644 Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift create mode 100644 Examples/destination_plugins/AdjustDestination.swift diff --git a/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj new file mode 100644 index 00000000..99b85311 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj @@ -0,0 +1,403 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 52; + objects = { + +/* Begin PBXBuildFile section */ + 469F7B08266011690038E773 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B07266011690038E773 /* AppDelegate.swift */; }; + 469F7B0A266011690038E773 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B09266011690038E773 /* SceneDelegate.swift */; }; + 469F7B0C266011690038E773 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B0B266011690038E773 /* ViewController.swift */; }; + 469F7B0F266011690038E773 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 469F7B0D266011690038E773 /* Main.storyboard */; }; + 469F7B112660116A0038E773 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 469F7B102660116A0038E773 /* Assets.xcassets */; }; + 469F7B142660116A0038E773 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 469F7B122660116A0038E773 /* LaunchScreen.storyboard */; }; + 469F7B1D266011D70038E773 /* Segment in Frameworks */ = {isa = PBXBuildFile; productRef = 469F7B1C266011D70038E773 /* Segment */; }; + 469F7B20266012CB0038E773 /* FlurryDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B1F266012CB0038E773 /* FlurryDestination.swift */; }; + 469F7B23266013100038E773 /* Adjust in Frameworks */ = {isa = PBXBuildFile; productRef = 469F7B22266013100038E773 /* Adjust */; }; + 469F7B25266013320038E773 /* AdjustDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B24266013320038E773 /* AdjustDestination.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 469F7B04266011690038E773 /* DestinationsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DestinationsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 469F7B07266011690038E773 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 469F7B09266011690038E773 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 469F7B0B266011690038E773 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 469F7B0E266011690038E773 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 469F7B102660116A0038E773 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 469F7B132660116A0038E773 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 469F7B152660116A0038E773 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 469F7B1F266012CB0038E773 /* FlurryDestination.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlurryDestination.swift; sourceTree = ""; }; + 469F7B24266013320038E773 /* AdjustDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdjustDestination.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 469F7B01266011690038E773 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 469F7B1D266011D70038E773 /* Segment in Frameworks */, + 469F7B23266013100038E773 /* Adjust in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 469F7AFB266011690038E773 = { + isa = PBXGroup; + children = ( + 469F7B06266011690038E773 /* DestinationsExample */, + 469F7B05266011690038E773 /* Products */, + 469F7B1B266011D70038E773 /* Frameworks */, + ); + sourceTree = ""; + }; + 469F7B05266011690038E773 /* Products */ = { + isa = PBXGroup; + children = ( + 469F7B04266011690038E773 /* DestinationsExample.app */, + ); + name = Products; + sourceTree = ""; + }; + 469F7B06266011690038E773 /* DestinationsExample */ = { + isa = PBXGroup; + children = ( + 469F7B1E266012CB0038E773 /* destination_plugins */, + 469F7B07266011690038E773 /* AppDelegate.swift */, + 469F7B09266011690038E773 /* SceneDelegate.swift */, + 469F7B0B266011690038E773 /* ViewController.swift */, + 469F7B0D266011690038E773 /* Main.storyboard */, + 469F7B102660116A0038E773 /* Assets.xcassets */, + 469F7B122660116A0038E773 /* LaunchScreen.storyboard */, + 469F7B152660116A0038E773 /* Info.plist */, + ); + path = DestinationsExample; + sourceTree = ""; + }; + 469F7B1B266011D70038E773 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; + 469F7B1E266012CB0038E773 /* destination_plugins */ = { + isa = PBXGroup; + children = ( + 469F7B1F266012CB0038E773 /* FlurryDestination.swift */, + 469F7B24266013320038E773 /* AdjustDestination.swift */, + ); + name = destination_plugins; + path = ../../../destination_plugins; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 469F7B03266011690038E773 /* DestinationsExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 469F7B182660116A0038E773 /* Build configuration list for PBXNativeTarget "DestinationsExample" */; + buildPhases = ( + 469F7B00266011690038E773 /* Sources */, + 469F7B01266011690038E773 /* Frameworks */, + 469F7B02266011690038E773 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DestinationsExample; + packageProductDependencies = ( + 469F7B1C266011D70038E773 /* Segment */, + 469F7B22266013100038E773 /* Adjust */, + ); + productName = DestinationsExample; + productReference = 469F7B04266011690038E773 /* DestinationsExample.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 469F7AFC266011690038E773 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1250; + LastUpgradeCheck = 1250; + TargetAttributes = { + 469F7B03266011690038E773 = { + CreatedOnToolsVersion = 12.5; + }; + }; + }; + buildConfigurationList = 469F7AFF266011690038E773 /* Build configuration list for PBXProject "DestinationsExample" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 469F7AFB266011690038E773; + packageReferences = ( + 469F7B21266013100038E773 /* XCRemoteSwiftPackageReference "ios_sdk" */, + ); + productRefGroup = 469F7B05266011690038E773 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 469F7B03266011690038E773 /* DestinationsExample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 469F7B02266011690038E773 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 469F7B142660116A0038E773 /* LaunchScreen.storyboard in Resources */, + 469F7B112660116A0038E773 /* Assets.xcassets in Resources */, + 469F7B0F266011690038E773 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 469F7B00266011690038E773 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 469F7B20266012CB0038E773 /* FlurryDestination.swift in Sources */, + 469F7B0C266011690038E773 /* ViewController.swift in Sources */, + 469F7B08266011690038E773 /* AppDelegate.swift in Sources */, + 469F7B25266013320038E773 /* AdjustDestination.swift in Sources */, + 469F7B0A266011690038E773 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 469F7B0D266011690038E773 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 469F7B0E266011690038E773 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 469F7B122660116A0038E773 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 469F7B132660116A0038E773 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 469F7B162660116A0038E773 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + 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 = 14.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 469F7B172660116A0038E773 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 14.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 469F7B192660116A0038E773 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = DestinationsExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.segment.DestinationsExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 469F7B1A2660116A0038E773 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = DestinationsExample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.segment.DestinationsExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 469F7AFF266011690038E773 /* Build configuration list for PBXProject "DestinationsExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 469F7B162660116A0038E773 /* Debug */, + 469F7B172660116A0038E773 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 469F7B182660116A0038E773 /* Build configuration list for PBXNativeTarget "DestinationsExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 469F7B192660116A0038E773 /* Debug */, + 469F7B1A2660116A0038E773 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 469F7B21266013100038E773 /* XCRemoteSwiftPackageReference "ios_sdk" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/adjust/ios_sdk.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 4.29.2; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 469F7B1C266011D70038E773 /* Segment */ = { + isa = XCSwiftPackageProductDependency; + productName = Segment; + }; + 469F7B22266013100038E773 /* Adjust */ = { + isa = XCSwiftPackageProductDependency; + package = 469F7B21266013100038E773 /* XCRemoteSwiftPackageReference "ios_sdk" */; + productName = Adjust; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 469F7AFC266011690038E773 /* Project object */; +} diff --git a/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/contents.xcworkspacedata b/Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..38c7d4f8 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift b/Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift new file mode 100644 index 00000000..a1703d27 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// DestinationsExample +// +// Created by Brandon Sneed on 5/27/21. +// + +import UIKit +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. + 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) { + // 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. + } + + +} + +extension UIApplicationDelegate { + var analytics: Analytics? { + if let appDelegate = self as? AppDelegate { + return appDelegate.analytics + } + return nil + } +} + diff --git a/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AccentColor.colorset/Contents.json b/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/Contents.json b/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/LaunchScreen.storyboard b/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard b/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard new file mode 100644 index 00000000..25a76385 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample/Info.plist b/Examples/apps/DestinationsExample/DestinationsExample/Info.plist new file mode 100644 index 00000000..5b531f7b --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample/SceneDelegate.swift b/Examples/apps/DestinationsExample/DestinationsExample/SceneDelegate.swift new file mode 100644 index 00000000..465cbefe --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// DestinationsExample +// +// Created by Brandon Sneed on 5/27/21. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift b/Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift new file mode 100644 index 00000000..15580482 --- /dev/null +++ b/Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift @@ -0,0 +1,21 @@ +// +// ViewController.swift +// DestinationsExample +// +// Created by Brandon Sneed on 5/27/21. +// + +import UIKit +import Segment + +class ViewController: UIViewController { + var analytics = UIApplication.shared.delegate?.analytics + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + } + + +} + diff --git a/Examples/destination_plugins/AdjustDestination.swift b/Examples/destination_plugins/AdjustDestination.swift new file mode 100644 index 00000000..633ea550 --- /dev/null +++ b/Examples/destination_plugins/AdjustDestination.swift @@ -0,0 +1,210 @@ +// +// AdjustDestination.swift +// DestinationsExample +// +// Created by Brandon Sneed on 5/27/21. +// + +// NOTE: You can see this plugin in use in the DestinationsExample application. +// +// This plugin is NOT SUPPORTED by Segment. It is here merely as an example, +// and for your convenience should you find it useful. Please contact Adjust +// about providing full support and publishing if desired. +// +// Adjust SPM package can be found here: https://github.com/adjust/ios_sdk + +// MIT License +// +// Copyright (c) 2021 Segment +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +import Foundation +import Segment +import Adjust + +internal struct AdjustSettings: Codable { + let appToken: String + let setEnvironmentProduction: Bool? + let setEventBufferingEnabled: Bool? + let trackAttributionData: Bool? + let setDelay: Bool? + let customEvents: JSON? + let delayTime: Double? +} + +@objc +public class AdjustDestination: NSObject, DestinationPlugin { + public let timeline: Timeline = Timeline() + public let type: PluginType = .destination + public let name: String + public var analytics: Analytics? = nil + + internal var settings: AdjustSettings? = nil + + @Atomic var started = false + + required public init(name: String) { + self.name = name + } + + public func update(settings: Settings) { + guard let settings: AdjustSettings = settings.integrationSettings(name: "Adjust") else { return } + self.settings = settings + + var environment = ADJEnvironmentSandbox + if let _ = settings.setEnvironmentProduction { + environment = ADJEnvironmentProduction + } + + let adjustConfig = ADJConfig(appToken: settings.appToken, environment: environment) + + if let bufferingEnabled = settings.setEventBufferingEnabled { + adjustConfig?.eventBufferingEnabled = bufferingEnabled + } + + if let _ = settings.trackAttributionData { + adjustConfig?.delegate = self + } + + if let useDelay = settings.setDelay, useDelay == true, let delayTime = settings.delayTime { + adjustConfig?.delayStart = delayTime + } + + Adjust.appDidLaunch(adjustConfig) + + started = true + } + + public func identify(event: IdentifyEvent) -> IdentifyEvent? { + guard started == true else { return event } + + if let userId = event.userId, userId.count > 0 { + Adjust.addSessionPartnerParameter("user_id", value: userId) + } + + if let anonId = event.anonymousId, anonId.count > 0 { + Adjust.addSessionPartnerParameter("anonymous_id", value: anonId) + } + + return event + } + + public func track(event: TrackEvent) -> TrackEvent? { + guard started == true else { return event } + + if let anonId = event.anonymousId, anonId.count > 0 { + Adjust.addSessionPartnerParameter("anonymous_id", value: anonId) + } + + if let token = mappedCustomEventToken(eventName: event.event) { + let adjEvent = ADJEvent(eventToken: token) + + let properties = event.properties?.dictionaryValue + if let properties = properties { + for (key, value) in properties { + adjEvent?.addCallbackParameter(key, value: "\(value)") + } + } + + let revenue: Double? = extract(key: "revenue", from: properties) + let currency: String? = extract(key: "currency", from: properties, withDefault: "USD") + let orderId: String? = extract(key: "orderId", from: properties) + + if let revenue = revenue, let currency = currency { + adjEvent?.setRevenue(revenue, currency: currency) + } + + if let orderId = orderId { + adjEvent?.setTransactionId(orderId) + } + + } + + return event + } + + public func screen(event: ScreenEvent) -> ScreenEvent? { + guard started == true else { return event } + + return event + } +} + +// MARK: - Adjust Delegate conformance +extension AdjustDestination: AdjustDelegate { + public func adjustAttributionChanged(_ attribution: ADJAttribution?) { + let campaign: [String: Any] = [ + "source": attribution?.network ?? NSNull(), + "name": attribution?.campaign ?? NSNull(), + "content": attribution?.clickLabel ?? NSNull(), + "adCreative": attribution?.creative ?? NSNull(), + "adGroup": attribution?.adgroup ?? NSNull() + ] + + let properties: [String: Any] = [ + "provider": "Adjust", + "trackerToken": attribution?.trackerToken ?? NSNull(), + "trackerName": attribution?.trackerName ?? NSNull(), + "campaign": campaign + ] + + analytics?.track(name: "Install Attributed", properties: properties) + } +} +// MARK: - Support methods + +extension AdjustDestination { + internal func mappedCustomEventToken(eventName: String) -> String? { + var result: String? = nil + if let tokens = settings?.customEvents?.dictionaryValue { + result = tokens[eventName] as? String + } + return result + } + + internal func extract(key: String, from properties: [String: Any]?, withDefault value: T? = nil) -> T? { + var result: T? = value + guard let properties = properties else { return result } + for (propKey, propValue) in properties { + // not sure if this comparison is actually necessary, + // but existed in the old destination so ... + if key.lowercased() == propKey.lowercased() { + if let value = propValue as? T { + result = value + break + } + } + } + return result + } +} + +// we are missing support for: +/* + reset() + flush() + receivedRemoteNotification + failedToRegisterForRemoteNotification + registerForRemoteNotifications(deviceToken:) + handleActionWithIdentifier + continueUserActivity + openURL:options: + */ + diff --git a/Sources/Segment/Settings.swift b/Sources/Segment/Settings.swift index 54396fd0..01e95af3 100644 --- a/Sources/Segment/Settings.swift +++ b/Sources/Segment/Settings.swift @@ -45,6 +45,11 @@ public struct Settings: Codable { let result = settings[name] as? [String: Any] return result } + + public func integrationSettings(name: String) -> T? { + return nil + } + } extension Analytics { diff --git a/Sources/Segment/Utilities/Atomic.swift b/Sources/Segment/Utilities/Atomic.swift index 02b58a36..ab4e8c87 100644 --- a/Sources/Segment/Utilities/Atomic.swift +++ b/Sources/Segment/Utilities/Atomic.swift @@ -8,15 +8,15 @@ import Foundation @propertyWrapper -internal struct Atomic { - private var value: T +public struct Atomic { + var value: T private let lock = NSLock() - init(wrappedValue value: T) { + public init(wrappedValue value: T) { self.value = value } - var wrappedValue: T { + public var wrappedValue: T { get { return load() } set { store(newValue: newValue) } } From 9f678ad0d57a39404b77051faf716e5a7a41e2a7 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Tue, 1 Jun 2021 09:26:24 -0700 Subject: [PATCH 2/4] Disabled flurry integration .. again --- .../DestinationsExample.xcodeproj/project.pbxproj | 4 ++++ Examples/destination_plugins/FlurryDestination.swift | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj index 99b85311..514e0c67 100644 --- a/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj +++ b/Examples/apps/DestinationsExample/DestinationsExample.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 469EC8D0266066130068F9E3 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 469EC8CF266066130068F9E3 /* SystemConfiguration.framework */; }; 469F7B08266011690038E773 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B07266011690038E773 /* AppDelegate.swift */; }; 469F7B0A266011690038E773 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B09266011690038E773 /* SceneDelegate.swift */; }; 469F7B0C266011690038E773 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F7B0B266011690038E773 /* ViewController.swift */; }; @@ -20,6 +21,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 469EC8CF266066130068F9E3 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 469F7B04266011690038E773 /* DestinationsExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DestinationsExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 469F7B07266011690038E773 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 469F7B09266011690038E773 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -37,6 +39,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 469EC8D0266066130068F9E3 /* SystemConfiguration.framework in Frameworks */, 469F7B1D266011D70038E773 /* Segment in Frameworks */, 469F7B23266013100038E773 /* Adjust in Frameworks */, ); @@ -80,6 +83,7 @@ 469F7B1B266011D70038E773 /* Frameworks */ = { isa = PBXGroup; children = ( + 469EC8CF266066130068F9E3 /* SystemConfiguration.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/Examples/destination_plugins/FlurryDestination.swift b/Examples/destination_plugins/FlurryDestination.swift index 09be0a20..cb2d748b 100644 --- a/Examples/destination_plugins/FlurryDestination.swift +++ b/Examples/destination_plugins/FlurryDestination.swift @@ -35,18 +35,17 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +/* If flurry ever gets their swift package working, we can re-enable this */ + +/* import Foundation import Segment +import FlurryAnalytics + /** An implmentation of the Flurry Analytics device mode destination as a plugin. - - NOTE: This is currently commented out due to lack of arm64 support in the flurry SDK via swift package manager. - See here: https://github.com/flurry/FlurrySwiftPackage/issues/3 */ -/* -import FlurryAnalytics - class FlurryDestination: DestinationPlugin { let timeline: Timeline = Timeline() let type: PluginType = .destination From b0b152c8340378461ca27c5dcdcdb4c9601dffb8 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Tue, 1 Jun 2021 09:28:38 -0700 Subject: [PATCH 3/4] Added destinations example to ci --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c6f15ce..958a1e18 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,6 +106,11 @@ jobs: command: | cd Examples/apps/BasicExample xcodebuild -workspace "BasicExample.xcworkspace" -scheme "BasicExample" -sdk iphonesimulator + - run: + # build for ios simulator + command: | + cd Examples/apps/DestinationsExample + xcodebuild -workspace "DestinationsExample.xcworkspace" -scheme "DestinationsExample" -sdk iphonesimulator - run: # build for ios simulator command: | From 32bd42a58b49916069874dbafb2a07f754d9f7a9 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Tue, 1 Jun 2021 09:32:36 -0700 Subject: [PATCH 4/4] Added test event button --- .../DestinationsExample/AppDelegate.swift | 9 ++++++ .../Base.lproj/Main.storyboard | 28 +++++++++++++++---- .../DestinationsExample/ViewController.swift | 3 ++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift b/Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift index a1703d27..c10ad311 100644 --- a/Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift +++ b/Examples/apps/DestinationsExample/DestinationsExample/AppDelegate.swift @@ -15,6 +15,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + + let configuration = Configuration(writeKey: "") + .trackApplicationLifecycleEvents(true) + .flushInterval(10) + + analytics = Analytics(configuration: configuration) + + analytics?.add(plugin: AdjustDestination(name: "Adjust")) + return true } diff --git a/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard b/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard index 25a76385..55b776ab 100644 --- a/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard +++ b/Examples/apps/DestinationsExample/DestinationsExample/Base.lproj/Main.storyboard @@ -1,24 +1,42 @@ - + + - + + - + - + - + + + + + + + + + + diff --git a/Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift b/Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift index 15580482..3e3f95c0 100644 --- a/Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift +++ b/Examples/apps/DestinationsExample/DestinationsExample/ViewController.swift @@ -17,5 +17,8 @@ class ViewController: UIViewController { } + @IBAction func trackAction(_ sender: Any) { + analytics?.track(name: "test event", properties: ["testValue": 42]) + } }