diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ef1d4d..9c04f26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +## 4.3.0 + +**Note:** This version does not include Carthage support. We are revisiting our Carthage approach and will reintroduce it in an upcoming version. + +#### Breaking +- Updated to [Braze tvOS SDK 4.3.x](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#430). +- A `track` call with event name `Completed Order` will now be treated as a purchase event for backwards compatibility with Segment eCommerce v1 API. + +## 4.2.0 + +**Note:** This version does not include Carthage support. We are revisiting our Carthage approach and will reintroduce it in an upcoming version. + +#### Breaking +- Updated to [Braze iOS SDK 4.3.x](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#430). + +## 4.1.0 + +**Note:** This version does not include Carthage support. We are revisiting our Carthage approach and will reintroduce it in an upcoming version. + +#### Breaking +- Updated to [Braze iOS SDK 4.1.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#410). + +#### Added +- Adds support for tvOS when using CocoaPods. For tvOS, add the following lines to your Podfile target: +``` + pod 'Segment-Appboy/tvOS' + pod 'Analytics' +``` +And add the functionality to your `AppDelegate.m`: +``` + SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@""]; + [config use:[SEGAppboyIntegrationFactory instance]]; + [[SEGAppboyIntegrationFactory instance] saveLaunchOptions:launchOptions]; + [SEGAnalytics setupWithConfiguration:config]; +``` + ## 4.0.0 #### Breaking diff --git a/CarthageExample/CarthageExample/AppDelegate.m b/CarthageExample/CarthageExample/AppDelegate.m index d4e5f85..146acd1 100644 --- a/CarthageExample/CarthageExample/AppDelegate.m +++ b/CarthageExample/CarthageExample/AppDelegate.m @@ -10,7 +10,7 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"xNAmGpyITen4FEZg9C2ES6r2iYm8Ommk"]; + SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR-WRITE-KEY-HERE"]; [config use:[SEGAppboyIntegrationFactory instance]]; [[SEGAppboyIntegrationFactory instance] saveLaunchOptions:launchOptions]; diff --git a/CocoaPodsTVOSExample/Podfile b/CocoaPodsTVOSExample/Podfile new file mode 100644 index 0000000..b35e956 --- /dev/null +++ b/CocoaPodsTVOSExample/Podfile @@ -0,0 +1,10 @@ +install! 'cocoapods', + :share_schemes_for_development_pods => true + +source 'https://cdn.cocoapods.org/' + +target 'Segment-Appboy_Example' do + platform :tvos, '11.0' + pod "Segment-Appboy/tvOS", :path => "../" + pod 'Analytics' +end diff --git a/CocoaPodsTVOSExample/Podfile.lock b/CocoaPodsTVOSExample/Podfile.lock new file mode 100644 index 0000000..e7c7ed4 --- /dev/null +++ b/CocoaPodsTVOSExample/Podfile.lock @@ -0,0 +1,28 @@ +PODS: + - Analytics (4.1.3) + - Appboy-tvOS-SDK (3.27.0) + - Segment-Appboy/tvOS (4.2.0): + - Analytics + - Appboy-tvOS-SDK (~> 3.27.0) + +DEPENDENCIES: + - Analytics + - Segment-Appboy/tvOS (from `../`) + +SPEC REPOS: + trunk: + - Analytics + - Appboy-tvOS-SDK + +EXTERNAL SOURCES: + Segment-Appboy: + :path: "../" + +SPEC CHECKSUMS: + Analytics: 4c01e3e19d4be86705bad6581a1c2aa5a15a9d22 + Appboy-tvOS-SDK: 22993e5e47387695fe1ecec5177c16a55d427b12 + Segment-Appboy: 5688916eb8fb104b638116ba251cee5d4d8bd266 + +PODFILE CHECKSUM: 230825da8fa8732fc38070eef05987c5967046f4 + +COCOAPODS: 1.10.1 diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example.xcodeproj/project.pbxproj b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ef45337 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcodeproj/project.pbxproj @@ -0,0 +1,421 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + 35C142FB277051674658B309 /* libPods-Segment-Appboy_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EAA62634F643AF5267499188 /* libPods-Segment-Appboy_Example.a */; }; + 5D23953225D6CFA600DA929D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D23953125D6CFA600DA929D /* AppDelegate.m */; }; + 5D23953525D6CFA600DA929D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D23953425D6CFA600DA929D /* ViewController.m */; }; + 5D23953825D6CFA600DA929D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D23953625D6CFA600DA929D /* Main.storyboard */; }; + 5D23953A25D6CFAB00DA929D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5D23953925D6CFAB00DA929D /* Assets.xcassets */; }; + 5D23953D25D6CFAB00DA929D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D23953B25D6CFAB00DA929D /* LaunchScreen.storyboard */; }; + 5D23954025D6CFAB00DA929D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D23953F25D6CFAB00DA929D /* main.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 5D23952D25D6CFA600DA929D /* Segment-Appboy_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Segment-Appboy_Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 5D23953025D6CFA600DA929D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 5D23953125D6CFA600DA929D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 5D23953325D6CFA600DA929D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 5D23953425D6CFA600DA929D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 5D23953725D6CFA600DA929D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 5D23953925D6CFAB00DA929D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 5D23953C25D6CFAB00DA929D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 5D23953E25D6CFAB00DA929D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 5D23953F25D6CFAB00DA929D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + A4DD16D62D97ED29D6077DE5 /* Pods-Segment-Appboy_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Segment-Appboy_Example.release.xcconfig"; path = "Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example.release.xcconfig"; sourceTree = ""; }; + E1B569F23E59A56EE361E93D /* Pods-Segment-Appboy_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Segment-Appboy_Example.debug.xcconfig"; path = "Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example.debug.xcconfig"; sourceTree = ""; }; + EAA62634F643AF5267499188 /* libPods-Segment-Appboy_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Segment-Appboy_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 5D23952A25D6CFA600DA929D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 35C142FB277051674658B309 /* libPods-Segment-Appboy_Example.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5D23952425D6CFA600DA929D = { + isa = PBXGroup; + children = ( + 5D23952F25D6CFA600DA929D /* Segment-Appboy_Example */, + 5D23952E25D6CFA600DA929D /* Products */, + E8F93401ADD46D0AEE3F414F /* Pods */, + A0F9256B8A1EE9C85F010D22 /* Frameworks */, + ); + sourceTree = ""; + }; + 5D23952E25D6CFA600DA929D /* Products */ = { + isa = PBXGroup; + children = ( + 5D23952D25D6CFA600DA929D /* Segment-Appboy_Example.app */, + ); + name = Products; + sourceTree = ""; + }; + 5D23952F25D6CFA600DA929D /* Segment-Appboy_Example */ = { + isa = PBXGroup; + children = ( + 5D23953025D6CFA600DA929D /* AppDelegate.h */, + 5D23953125D6CFA600DA929D /* AppDelegate.m */, + 5D23953325D6CFA600DA929D /* ViewController.h */, + 5D23953425D6CFA600DA929D /* ViewController.m */, + 5D23953625D6CFA600DA929D /* Main.storyboard */, + 5D23953925D6CFAB00DA929D /* Assets.xcassets */, + 5D23953B25D6CFAB00DA929D /* LaunchScreen.storyboard */, + 5D23953E25D6CFAB00DA929D /* Info.plist */, + 5D23953F25D6CFAB00DA929D /* main.m */, + ); + path = "Segment-Appboy_Example"; + sourceTree = ""; + }; + A0F9256B8A1EE9C85F010D22 /* Frameworks */ = { + isa = PBXGroup; + children = ( + EAA62634F643AF5267499188 /* libPods-Segment-Appboy_Example.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + E8F93401ADD46D0AEE3F414F /* Pods */ = { + isa = PBXGroup; + children = ( + E1B569F23E59A56EE361E93D /* Pods-Segment-Appboy_Example.debug.xcconfig */, + A4DD16D62D97ED29D6077DE5 /* Pods-Segment-Appboy_Example.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 5D23952C25D6CFA600DA929D /* Segment-Appboy_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 5D23954325D6CFAB00DA929D /* Build configuration list for PBXNativeTarget "Segment-Appboy_Example" */; + buildPhases = ( + 421BEBD9B92C480F01C325B6 /* [CP] Check Pods Manifest.lock */, + 5D23952925D6CFA600DA929D /* Sources */, + 5D23952A25D6CFA600DA929D /* Frameworks */, + 5D23952B25D6CFA600DA929D /* Resources */, + E216F34182FCF57E564371BC /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Segment-Appboy_Example"; + productName = "Segment-Appboy_Example"; + productReference = 5D23952D25D6CFA600DA929D /* Segment-Appboy_Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 5D23952525D6CFA600DA929D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1240; + TargetAttributes = { + 5D23952C25D6CFA600DA929D = { + CreatedOnToolsVersion = 12.4; + }; + }; + }; + buildConfigurationList = 5D23952825D6CFA600DA929D /* Build configuration list for PBXProject "Segment-Appboy_Example" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 5D23952425D6CFA600DA929D; + productRefGroup = 5D23952E25D6CFA600DA929D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 5D23952C25D6CFA600DA929D /* Segment-Appboy_Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 5D23952B25D6CFA600DA929D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D23953D25D6CFAB00DA929D /* LaunchScreen.storyboard in Resources */, + 5D23953A25D6CFAB00DA929D /* Assets.xcassets in Resources */, + 5D23953825D6CFA600DA929D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 421BEBD9B92C480F01C325B6 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Segment-Appboy_Example-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + E216F34182FCF57E564371BC /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 5D23952925D6CFA600DA929D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D23953525D6CFA600DA929D /* ViewController.m in Sources */, + 5D23954025D6CFAB00DA929D /* main.m in Sources */, + 5D23953225D6CFA600DA929D /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 5D23953625D6CFA600DA929D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5D23953725D6CFA600DA929D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 5D23953B25D6CFAB00DA929D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 5D23953C25D6CFAB00DA929D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 5D23954125D6CFAB00DA929D /* 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; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 14.3; + }; + name = Debug; + }; + 5D23954225D6CFAB00DA929D /* 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; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 14.3; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 5D23954425D6CFAB00DA929D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E1B569F23E59A56EE361E93D /* Pods-Segment-Appboy_Example.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9JGP78W4NA; + INFOPLIST_FILE = "Segment-Appboy_Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Appboy-tvOS-SDK\"/**", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.askkaz.Segment-Appboy-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = 3; + }; + name = Debug; + }; + 5D23954525D6CFAB00DA929D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A4DD16D62D97ED29D6077DE5 /* Pods-Segment-Appboy_Example.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 9JGP78W4NA; + INFOPLIST_FILE = "Segment-Appboy_Example/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Appboy-tvOS-SDK\"/**", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.askkaz.Segment-Appboy-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = 3; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 5D23952825D6CFA600DA929D /* Build configuration list for PBXProject "Segment-Appboy_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5D23954125D6CFAB00DA929D /* Debug */, + 5D23954225D6CFAB00DA929D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 5D23954325D6CFAB00DA929D /* Build configuration list for PBXNativeTarget "Segment-Appboy_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 5D23954425D6CFAB00DA929D /* Debug */, + 5D23954525D6CFAB00DA929D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 5D23952525D6CFA600DA929D /* Project object */; +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example.xcworkspace/contents.xcworkspacedata b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..bba13c0 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/AppDelegate.h b/CocoaPodsTVOSExample/Segment-Appboy_Example/AppDelegate.h new file mode 100644 index 0000000..a5a8b38 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/AppDelegate.h @@ -0,0 +1,7 @@ +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/AppDelegate.m b/CocoaPodsTVOSExample/Segment-Appboy_Example/AppDelegate.m new file mode 100644 index 0000000..f29d181 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/AppDelegate.m @@ -0,0 +1,19 @@ +#import "AppDelegate.h" +#import "SEGAppboyIntegrationFactory.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR-WRITE-KEY-HERE"]; + [config use:[SEGAppboyIntegrationFactory instance]]; + [[SEGAppboyIntegrationFactory instance] saveLaunchOptions:launchOptions]; + [SEGAnalytics setupWithConfiguration:config]; + [SEGAnalytics debug:YES]; + return YES; +} + +@end diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/AccentColor.colorset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json new file mode 100644 index 0000000..f47ba43 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "filename" : "App Icon - App Store.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "1280x768" + }, + { + "filename" : "App Icon.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "400x240" + }, + { + "filename" : "Top Shelf Image Wide.imageset", + "idiom" : "tv", + "role" : "top-shelf-image-wide", + "size" : "2320x720" + }, + { + "filename" : "Top Shelf Image.imageset", + "idiom" : "tv", + "role" : "top-shelf-image", + "size" : "1920x720" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 0000000..b65f0cd --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + }, + { + "idiom" : "tv-marketing", + "scale" : "1x" + }, + { + "idiom" : "tv-marketing", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 0000000..b65f0cd --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + }, + { + "idiom" : "tv-marketing", + "scale" : "1x" + }, + { + "idiom" : "tv-marketing", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/Contents.json b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Base.lproj/LaunchScreen.storyboard b/CocoaPodsTVOSExample/Segment-Appboy_Example/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..da9d467 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Base.lproj/Main.storyboard b/CocoaPodsTVOSExample/Segment-Appboy_Example/Base.lproj/Main.storyboard new file mode 100644 index 0000000..5c9f996 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Base.lproj/Main.storyboard @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/Info.plist b/CocoaPodsTVOSExample/Segment-Appboy_Example/Info.plist new file mode 100644 index 0000000..7a05232 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/Info.plist @@ -0,0 +1,39 @@ + + + + + Braze + + LogLevel + 0 + + 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 + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + arm64 + + UIUserInterfaceStyle + Automatic + + diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/ViewController.h b/CocoaPodsTVOSExample/Segment-Appboy_Example/ViewController.h new file mode 100644 index 0000000..8967094 --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/ViewController.h @@ -0,0 +1,5 @@ +#import + +@interface ViewController : UIViewController + +@end diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/ViewController.m b/CocoaPodsTVOSExample/Segment-Appboy_Example/ViewController.m new file mode 100644 index 0000000..2bad20d --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/ViewController.m @@ -0,0 +1,23 @@ +#import "ViewController.h" +#import "SEGAnalytics.h" +#import + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + NSString *customEvent = @"appboySegmentTrackEvent"; + + NSString *propertyKey = @"eventPropertyKey"; + + NSString *propertyValue = @"eventPropertyValue"; + + [[SEGAnalytics sharedAnalytics] track:customEvent + properties:@{ propertyKey: propertyValue}]; +} + +@end diff --git a/CocoaPodsTVOSExample/Segment-Appboy_Example/main.m b/CocoaPodsTVOSExample/Segment-Appboy_Example/main.m new file mode 100644 index 0000000..dba295e --- /dev/null +++ b/CocoaPodsTVOSExample/Segment-Appboy_Example/main.m @@ -0,0 +1,11 @@ +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/CocoapodsExample/Podfile b/CocoapodsExample/Podfile index 47048fb..be54cbf 100644 --- a/CocoapodsExample/Podfile +++ b/CocoapodsExample/Podfile @@ -1,18 +1,15 @@ -install! 'cocoapods', - :share_schemes_for_development_pods => true - source 'https://github.com/CocoaPods/Specs.git' use_frameworks! target 'Segment-Appboy_Example' do - platform :ios, '11.0' + platform :ios, '9.0' pod "Segment-Appboy", :path => "../" pod 'Analytics' end target 'Segment-Appboy_Tests' do - platform :ios, '11.0' + platform :ios, '9.0' pod "Segment-Appboy", :path => "../" pod 'Analytics' pod 'Specta' diff --git a/CocoapodsExample/Segment-Appboy.xcodeproj/project.pbxproj b/CocoapodsExample/Segment-Appboy.xcodeproj/project.pbxproj index 773b418..7746e14 100644 --- a/CocoapodsExample/Segment-Appboy.xcodeproj/project.pbxproj +++ b/CocoapodsExample/Segment-Appboy.xcodeproj/project.pbxproj @@ -270,43 +270,8 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, - de, - he, - ar, - "zh-Hans", - ja, - "zh-TW", - "zh-HK", - nb, - es, - da, - "es-419", - et, - it, - ms, - sv, - km, - ko, - fil, - "zh-Hant", - my, - pl, - vi, - lo, - "es-MX", - ru, - fr, - fi, - id, - nl, - th, - pt, - "pt-PT", - hi, - zh, ); mainGroup = 6003F581195388D10070C39A; productRefGroup = 6003F58B195388D20070C39A /* Products */; @@ -367,7 +332,7 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Segment-Appboy_Tests/Pods-Segment-Appboy_Tests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Analytics/Segment.framework", + "${BUILT_PRODUCTS_DIR}/Analytics/Analytics.framework", "${BUILT_PRODUCTS_DIR}/Appboy-iOS-SDK/Appboy_iOS_SDK.framework", "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", "${BUILT_PRODUCTS_DIR}/Segment-Appboy/Segment_Appboy.framework", @@ -377,7 +342,7 @@ ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Segment.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Analytics.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Appboy_iOS_SDK.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Segment_Appboy.framework", @@ -397,14 +362,14 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Analytics/Segment.framework", + "${BUILT_PRODUCTS_DIR}/Analytics/Analytics.framework", "${BUILT_PRODUCTS_DIR}/Appboy-iOS-SDK/Appboy_iOS_SDK.framework", "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", "${BUILT_PRODUCTS_DIR}/Segment-Appboy/Segment_Appboy.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Segment.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Analytics.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Appboy_iOS_SDK.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Segment_Appboy.framework", @@ -518,7 +483,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; PROVISIONING_PROFILE = "$(sigh_com.appboy.SegmentSample_development)"; PROVISIONING_PROFILE_SPECIFIER = "match Development com.appboy.SegmentSample"; @@ -555,7 +520,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; PROVISIONING_PROFILE = "$(sigh_com.appboy.SegmentSample_development)"; PROVISIONING_PROFILE_SPECIFIER = "match Development com.appboy.SegmentSample"; SDKROOT = iphoneos; diff --git a/CocoapodsExample/Segment-Appboy/SEGAppDelegate.m b/CocoapodsExample/Segment-Appboy/SEGAppDelegate.m index 79f1500..93d5dd0 100644 --- a/CocoapodsExample/Segment-Appboy/SEGAppDelegate.m +++ b/CocoapodsExample/Segment-Appboy/SEGAppDelegate.m @@ -6,7 +6,7 @@ @implementation SEGAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"xNAmGpyITen4FEZg9C2ES6r2iYm8Ommk"]; + SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR-WRITE-KEY-HERE"]; [config use:[SEGAppboyIntegrationFactory instance]]; // Example of setting appboyOptions diff --git a/CocoapodsExample/Segment-Appboy/SEGViewController.m b/CocoapodsExample/Segment-Appboy/SEGViewController.m index 2c37f82..de1ccc2 100644 --- a/CocoapodsExample/Segment-Appboy/SEGViewController.m +++ b/CocoapodsExample/Segment-Appboy/SEGViewController.m @@ -49,10 +49,10 @@ - (IBAction)identifyButtonPress:(id)sender { @"integerAttribute" : @(integerAttribute), @"floatAttribute" : @(floatAttribute), @"shortAttribute" : @(shortAttribute), - //@"dateAttribute" : dateAttribute, + @"dateAttribute" : dateAttribute, @"arrayAttribute" : @[@"one", @"two", @"three"], @"gender" : @"female", - //@"birthday" : [NSDate dateWithTimeIntervalSince1970:564559200], + @"birthday" : [NSDate dateWithTimeIntervalSince1970:564559200], @"firstName" : @"Appboy", @"lastName" : @"Appboy", @"phone" : @"1234567890", diff --git a/CocoapodsExample/Segment-Appboy/Segment-Appboy-Info.plist b/CocoapodsExample/Segment-Appboy/Segment-Appboy-Info.plist index 4b3eae4..1ede1c7 100644 --- a/CocoapodsExample/Segment-Appboy/Segment-Appboy-Info.plist +++ b/CocoapodsExample/Segment-Appboy/Segment-Appboy-Info.plist @@ -2,7 +2,7 @@ - Appboy + Braze LogLevel 0 diff --git a/CocoapodsExample/Tests/SEGAppboyIntegrationFactoryTest.m b/CocoapodsExample/Tests/SEGAppboyIntegrationFactoryTest.m index 6a88406..2c270c3 100644 --- a/CocoapodsExample/Tests/SEGAppboyIntegrationFactoryTest.m +++ b/CocoapodsExample/Tests/SEGAppboyIntegrationFactoryTest.m @@ -2,7 +2,7 @@ #import "SEGAppboyIntegration.h" #import "AppboyKit.h" #import -#import +#import #import "SEGAnalyticsUtils.h" SpecBegin(SEGAppboyIntegrationFactory) diff --git a/CocoapodsExample/Tests/SEGAppboyIntegrationTest.m b/CocoapodsExample/Tests/SEGAppboyIntegrationTest.m index 732ebb2..475758a 100644 --- a/CocoapodsExample/Tests/SEGAppboyIntegrationTest.m +++ b/CocoapodsExample/Tests/SEGAppboyIntegrationTest.m @@ -1,7 +1,7 @@ #import "SEGAppboyIntegration.h" #import "AppboyKit.h" #import -#import +#import #import "SEGAnalyticsUtils.h" SpecBegin(InitialSpecs) @@ -123,6 +123,30 @@ [appboyIntegration track:trackPayload]; OCMVerifyAllWithDelay(appboyMock, 2); }); + + it(@"calls purchase for Completed Order", ^{ + NSDictionary *settings = @{@"apiKey":@"foo"}; + id appboyMock = OCMClassMock([Appboy class]); + OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); + OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); + OCMExpect([appboyMock logPurchase:@"Completed Order" inCurrency:@"USD" atPrice:[NSDecimalNumber decimalNumberWithString:@"55.5"] + withQuantity:1 andProperties:@{@"extraProperty" : @"extraValue"}]); + + SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; + + NSDictionary *properties = @{ + @"revenue" : @"55.5", + @"currency" : @"USD", + @"extraProperty" : @"extraValue" + }; + + SEGTrackPayload *trackPayload = [[SEGTrackPayload alloc] initWithEvent:@"Completed Order" + properties:properties + context:nil + integrations:nil]; + [appboyIntegration track:trackPayload]; + OCMVerifyAllWithDelay(appboyMock, 2); + }); it(@"calls logPurchase for each product in the products array", ^{ NSDictionary *settings = @{@"apiKey":@"foo"}; @@ -178,12 +202,12 @@ }); describe(@"flush", ^{ - it(@"calls [[Appboy sharedInstance] flushDataAndProcessRequestQueue]", ^{ + it(@"calls [[Appboy sharedInstance] requestImmediateDataFlush]", ^{ NSDictionary *settings = @{@"apiKey":@"foo"}; id appboyMock = OCMClassMock([Appboy class]); OCMStub([appboyMock sharedInstance]).andReturn(appboyMock); OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]); - OCMExpect([appboyMock flushDataAndProcessRequestQueue]); + OCMExpect([appboyMock requestImmediateDataFlush]); SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings]; [appboyIntegration flush]; OCMVerifyAllWithDelay(appboyMock, 2); diff --git a/Example/Segment-Appboy/SEGViewController.m b/Example/Segment-Appboy/SEGViewController.m new file mode 100644 index 0000000..13ae16b --- /dev/null +++ b/Example/Segment-Appboy/SEGViewController.m @@ -0,0 +1,103 @@ +#import "SEGViewController.h" +#import "SEGAnalytics.h" +#import "AppboyKit.h" +#import "ABKModalFeedbackViewController.h" +#import "ABKNewsFeedViewController.h" + +@interface SEGViewController () + +@end + +@implementation SEGViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; +} + +- (IBAction)identifyButtonPress:(id)sender { + NSInteger integerAttribute = 200; + float floatAttribute = 12.3f; + int intAttribute = 18; + short shortAttribute = (short)2; + NSDate *dateAttribute = [NSDate date]; + + NSString *userID = @"appboySegmentTestUseriOS"; + if (self.userIDTextField.text.length > 0) { + userID = self.userIDTextField.text; + } + [[SEGAnalytics sharedAnalytics] identify:userID + traits:@{ @"email": @"hello@appboy.com", + @"bool" : @(YES), + @"double" : @(3.14159), + @"intAttribute": @(intAttribute), + @"integerAttribute" : @(integerAttribute), + @"floatAttribute" : @(floatAttribute), + @"shortAttribute" : @(shortAttribute), + @"dateAttribute" : dateAttribute, + @"arrayAttribute" : @[@"one", @"two", @"three"], + @"gender" : @"female", + @"birthday" : [NSDate dateWithTimeIntervalSince1970:564559200], + @"firstName" : @"Appboy", + @"lastName" : @"Appboy", + @"phone" : @"1234567890", + @"address" : @{@"city" : @"New York", + @"country" : @"US"}}]; +} + +- (IBAction)flushButtonPress:(id)sender { + [[SEGAnalytics sharedAnalytics] flush]; +} + +- (IBAction)trackButtonPress:(id)sender { + NSString *customEvent = @"appboySegmentTrackEvent"; + if (self.customEventTextField.text.length > 0) { + customEvent = self.customEventTextField.text; + } + NSString *propertyKey = @"eventPropertyKey"; + if (self.propertyKeyTextField.text.length > 0) { + propertyKey = self.propertyKeyTextField.text; + } + NSString *propertyValue = @"eventPropertyValue"; + if (self.propertyValueTextField.text.length > 0) { + propertyValue = self.propertyValueTextField.text; + } + + [[SEGAnalytics sharedAnalytics] track:customEvent + properties:@{ propertyKey: propertyValue}]; + NSNumber *numberRevenue = @(45); + NSString *stringRevenue = @"60"; + [[SEGAnalytics sharedAnalytics] track:@"Candy" + properties:@{ @"currency": @"CNY", @"revenue" : numberRevenue, @"property" : @"milky white rabbit"}]; + [[SEGAnalytics sharedAnalytics] track:@"Purchase" + properties:@{ @"currency": @"CNY", @"revenue" : stringRevenue, @"property" : @"myProperty"}]; + [[SEGAnalytics sharedAnalytics] track:@"Install Attributed" + properties: @{@"provider" : @"Tune/Kochava/Branch", + @"campaign" : @{@"source" : @"Network/FB/AdWords/MoPub/Source", + @"name" : @"Campaign Name", + @"content" : @"Organic Content Title", + @"ad_creative" : @"Red Hello World Ad", + @"ad_group" : @"Red Ones"}}]; +} + +- (IBAction)feedbackButtonPress:(id)sender { + // gate Appboy functionality based on [Appboy sharedInstance]. + if ([Appboy sharedInstance] != nil) { + ABKModalFeedbackViewController *feedbackViewController = [[ABKModalFeedbackViewController alloc] init]; + [self presentViewController:feedbackViewController animated:YES completion:nil]; + } +} + +- (IBAction)feedButtonPress:(id)sender { + if ([Appboy sharedInstance] != nil) { + // gate Appboy functionality based on [Appboy sharedInstance]. + ABKNewsFeedViewController *newsFeed = [[ABKNewsFeedViewController alloc] init]; + [self.navigationController presentViewController:newsFeed animated:YES completion:nil]; + } +} +@end diff --git a/Example/Tests/SEGAppboyIntegrationFactoryTest.m b/Example/Tests/SEGAppboyIntegrationFactoryTest.m new file mode 100644 index 0000000..6a88406 --- /dev/null +++ b/Example/Tests/SEGAppboyIntegrationFactoryTest.m @@ -0,0 +1,27 @@ +#import "SEGAppboyIntegrationFactory.h" +#import "SEGAppboyIntegration.h" +#import "AppboyKit.h" +#import +#import +#import "SEGAnalyticsUtils.h" + +SpecBegin(SEGAppboyIntegrationFactory) + +describe(@"SEGAppboyIntegrationFactory", ^{ + describe(@"appboyOptionsPassedByFactory", ^{ + it(@"initializes appboy with options", ^{ + NSDictionary *settings = @{@"apiKey": @"foo"}; + NSDictionary *options = @{ABKMinimumTriggerTimeIntervalKey: @42, + ABKSDKFlavorKey: @(SEGMENT) + }; + id appboyMock = OCMClassMock([Appboy class]); + OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:options]); + [SEGAppboyIntegrationFactory instance].appboyOptions = options; + + [[SEGAppboyIntegrationFactory instance] createWithSettings:settings forAnalytics:[SEGAnalytics sharedAnalytics]]; + OCMVerifyAllWithDelay(appboyMock, 2); + }); + }); +}); + +SpecEnd diff --git a/Package.swift b/Package.swift index 2aa51ee..3ed1cea 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], dependencies: [ .package(name: "Segment", url: "https://github.com/segmentio/analytics-ios.git", from: "4.1.1"), - .package(name: "Appboy_iOS_SDK", url: "https://github.com/Appboy/appboy-ios-sdk.git", from: "4.0.1"), + .package(name: "Appboy_iOS_SDK", url: "https://github.com/Appboy/appboy-ios-sdk.git", from: "4.3.0"), ], targets: [ .target( diff --git a/Pod/Classes/SEGAppboyHelper.h b/Pod/Classes/SEGAppboyHelper.h index 6b3db4e..6ebec73 100644 --- a/Pod/Classes/SEGAppboyHelper.h +++ b/Pod/Classes/SEGAppboyHelper.h @@ -4,9 +4,11 @@ @interface SEGAppboyHelper : NSObject - (void)applicationDidFinishLaunching; +#if !TARGET_OS_TV - (void)saveUserNotificationCenter:(UNUserNotificationCenter *)center notificationResponse:(UNNotificationResponse *)response NS_AVAILABLE_IOS(10_0); - (void)userNotificationCenter:(UNUserNotificationCenter *)center receivedNotificationResponse:(UNNotificationResponse *)response NS_AVAILABLE_IOS(10_0); +#endif @end diff --git a/Pod/Classes/SEGAppboyHelper.m b/Pod/Classes/SEGAppboyHelper.m index 9f96676..e19ff6c 100644 --- a/Pod/Classes/SEGAppboyHelper.m +++ b/Pod/Classes/SEGAppboyHelper.m @@ -4,23 +4,30 @@ #import #elif SWIFT_PACKAGE #import "AppboyKit.h" +#elif defined(__has_include) && __has_include() +#import #else #import "Appboy-iOS-SDK/AppboyKit.h" #endif @interface SEGAppboyHelper () +#if !TARGET_OS_TV @property UNUserNotificationCenter *center NS_AVAILABLE_IOS(10_0); @property UNNotificationResponse *response NS_AVAILABLE_IOS(10_0); +#endif @end @implementation SEGAppboyHelper - (void)applicationDidFinishLaunching NS_AVAILABLE_IOS(10_0) { +#if !TARGET_OS_TV [self logUNPushIfComesInBeforeAppboyInitialized]; +#endif } +#if !TARGET_OS_TV - (void)saveUserNotificationCenter:(UNUserNotificationCenter *)center notificationResponse:(UNNotificationResponse *)response { self.center = center; @@ -52,5 +59,6 @@ - (BOOL)logUNPushIfComesInBeforeAppboyInitialized NS_AVAILABLE_IOS(10_0) { } return NO; } +#endif @end diff --git a/Pod/Classes/SEGAppboyIntegration.m b/Pod/Classes/SEGAppboyIntegration.m index 29a5356..3b45fbb 100644 --- a/Pod/Classes/SEGAppboyIntegration.m +++ b/Pod/Classes/SEGAppboyIntegration.m @@ -7,6 +7,10 @@ #import "AppboyKit.h" #import "ABKUser.h" #import "ABKAttributionData.h" +#elif defined(__has_include) && __has_include() +#import +#import +#import #else #import "Appboy-iOS-SDK/AppboyKit.h" #import "Appboy-iOS-SDK/ABKUser.h" @@ -52,16 +56,14 @@ - (id)initWithSettings:(NSDictionary *)settings appboyOptions:(NSDictionary *)ap if (appboyOptions) { mergedAppboyOptions = [appboyOptions mutableCopy]; mergedAppboyOptions[ABKSDKFlavorKey] = @(SEGMENT); - mergedAppboyOptions[ABKEndpointKey] = @"sdk.iad-01.braze.com"; } else { - mergedAppboyOptions = [@{ABKSDKFlavorKey : @(SEGMENT), - ABKEndpointKey: @"sdk.iad-01.braze.com"} mutableCopy]; + mergedAppboyOptions = [@{ABKSDKFlavorKey : @(SEGMENT)} mutableCopy]; } NSString *customEndpoint = self.settings[@"customEndpoint"]; if (customEndpoint && [customEndpoint length] != 0) { mergedAppboyOptions[ABKEndpointKey] = customEndpoint; } - + if ([NSThread isMainThread]) { [Appboy startWithApiKey:appboyAPIKey inApplication:[UIApplication sharedApplication] @@ -100,7 +102,7 @@ - (void)identify:(SEGIdentifyPayload *)payload [[Appboy sharedInstance] changeUser:payload.userId]; SEGLog(@"[[Appboy sharedInstance] changeUser:%@]", payload.userId); } - + if ([payload.traits[@"birthday"] isKindOfClass:[NSString class]]) { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; NSLocale *enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]; @@ -207,7 +209,8 @@ - (void)track:(SEGTrackPayload *)payload } NSDecimalNumber *revenue = [SEGAppboyIntegration extractRevenue:payload.properties withKey:@"revenue"]; - if (revenue || [payload.event isEqualToString:@"Order Completed"]) { + if (revenue || [payload.event isEqualToString:@"Order Completed"] + || [payload.event isEqualToString:@"Completed Order"]) { NSString *currency = @"USD"; // Make USD as the default currency. if ([payload.properties[@"currency"] isKindOfClass:[NSString class]] && [(NSString *)payload.properties[@"currency"] length] == 3) { // Currency should be an ISO 4217 currency code. @@ -265,10 +268,11 @@ + (NSDecimalNumber *)extractRevenue:(NSDictionary *)dictionary withKey:(NSString - (void)flush { - [[Appboy sharedInstance] flushDataAndProcessRequestQueue]; - SEGLog(@"[[Appboy sharedInstance] flushDataAndProcessRequestQueue]"); + [[Appboy sharedInstance] requestImmediateDataFlush]; + SEGLog(@"[[Appboy sharedInstance] requestImmediateDataFlush]"); } +#if !TARGET_OS_TV // Invoked when the device is registered with a push token. // Appboy uses this to send push messages to the device, so forward it to Appboy. - (void)registeredForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken @@ -289,10 +293,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification { - (void)receivedRemoteNotification:(NSDictionary *)userInfo { if (![self logPushIfComesInBeforeAppboyInitializedWithIdentifier:nil]) { dispatch_async(dispatch_get_main_queue(), ^{ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" [[Appboy sharedInstance] registerApplication:[UIApplication sharedApplication] didReceiveRemoteNotification:userInfo]; -#pragma clang diagnostic pop }); } SEGLog(@"[[Appboy sharedInstance] registerApplication: didReceiveRemoteNotification:]"); @@ -300,15 +301,13 @@ - (void)receivedRemoteNotification:(NSDictionary *)userInfo { - (void)handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo { if (![self logPushIfComesInBeforeAppboyInitializedWithIdentifier:identifier]) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" dispatch_async(dispatch_get_main_queue(), ^{ [[Appboy sharedInstance] getActionWithIdentifier:identifier forRemoteNotification:userInfo completionHandler:nil]; }); -#pragma clang diagnostic pop } SEGLog(@"[[Appboy sharedInstance] getActionWithIdentifier: forRemoteNotification: completionHandler:]"); } +#endif - (BOOL)logPushIfComesInBeforeAppboyInitializedWithIdentifier:(NSString *)identifier { NSDictionary *pushDictionary = [[SEGAppboyIntegrationFactory instance] getPushPayload]; diff --git a/Pod/Classes/SEGAppboyIntegrationFactory.m b/Pod/Classes/SEGAppboyIntegrationFactory.m index 86fed53..ed39891 100644 --- a/Pod/Classes/SEGAppboyIntegrationFactory.m +++ b/Pod/Classes/SEGAppboyIntegrationFactory.m @@ -3,6 +3,8 @@ #import #elif SWIFT_PACKAGE #import "AppboyKit.h" +#elif defined(__has_include) && __has_include() +#import #else #import "Appboy-iOS-SDK/AppboyKit.h" #endif @@ -41,10 +43,12 @@ - (NSString *)key { } - (void)saveLaunchOptions:(NSDictionary *)launchOptions { +#if !TARGET_OS_TV NSDictionary *pushPayLoad = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]; if (pushPayLoad != nil && pushPayLoad.count > 0) { self.savedPushPayload = [pushPayLoad copy]; } +#endif } - (void)saveRemoteNotification:(NSDictionary *)userInfo { diff --git a/README.md b/README.md index b190896..9f442ba 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Follow the standard procedure to add the frameworks built/retrieved by Carthage To install the Braze integration through Swift Package Manager, follow these steps: - Select `File > Swift Packages > Add Package Dependency`. -- In the search bar, enter https://github.com/Appboy/segment-ios. Select either `Full-SDK` or `Core`, depending on your use case. +- In the search bar, enter https://github.com/Appboy/appboy-segment-ios. Select either `Full-SDK` or `Core`, depending on your use case. - In your app's target, under `Build Settings > Other Linker Flags`, add the `-ObjC` linker flag. - In the Xcode menu, click `Product > Scheme > Edit Scheme...` - Click the expand ▶️ next to `Build` and select `Post-actions`. Press `+` and select `New Run Script Action`. @@ -62,13 +62,16 @@ bash "$BUILT_PRODUCTS_DIR/Appboy_iOS_SDK_AppboyKit.bundle/Appboy.bundle/appboy-s After adding the dependency, you must register the integration with our SDK. To do this, import the Braze integration in your AppDelegate: - ``` #import "SEGAppboyIntegrationFactory.h" ``` +**Note:** When using Swift Package Manager, you will need to import the SDK using `import Full_SDK` or `import Core` depending on which package you are using. + And add the following lines: +#### Objective-C + ``` NSString *const SEGMENT_WRITE_KEY = @" ... "; SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY]; @@ -78,6 +81,17 @@ SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWith [SEGAnalytics setupWithConfiguration:config]; ``` +#### Swift + +``` +let SEGMENT_WRITE_KEY = " ... " +let config = SEGAnalyticsConfiguration(writeKey: SEGMENT_WRITE_KEY) + +config.use(SEGAppboyIntegrationFactory.instance()) + +SEGAnalytics.setup(with: config) +``` + Please see [our documentation](https://segment.com/docs/integrations/appboy/#ios) for more information. ## License diff --git a/Segment-Appboy.podspec b/Segment-Appboy.podspec index 29c0c9e..2edcb5b 100644 --- a/Segment-Appboy.podspec +++ b/Segment-Appboy.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Segment-Appboy" - s.version = "4.0.0" + s.version = "4.3.0" s.summary = "Braze Integration for Segment's analytics-ios library." s.description = <<-DESC @@ -15,34 +15,41 @@ Pod::Spec.new do |s| s.author = { "Appboy" => "hello@braze.com" } s.source = { :git => "https://github.com/appboy/appboy-segment-ios.git", :tag => s.version.to_s } - s.platform = :ios, '11.0' + s.platform = :ios, '11.0' s.requires_arc = true s.dependency 'Analytics' s.default_subspec = 'Full-SDK' s.subspec 'Full-SDK' do |default| - default.dependency 'Appboy-iOS-SDK', '~>4.0.1' + default.platform = :ios + default.dependency 'Appboy-iOS-SDK', '~>4.3.0' default.source_files = 'Pod/Classes/**/*' end + s.subspec 'tvOS' do |tv| + tv.platform = :tvos, '11.0' + tv.dependency 'Appboy-tvOS-SDK', '~>4.3.0' + tv.source_files = 'Pod/Classes/**/*' + end + s.subspec 'Core' do |core| - core.dependency 'Appboy-iOS-SDK/Core', '~>4.0.1' + core.dependency 'Appboy-iOS-SDK/Core', '~>4.3.0' core.source_files = 'Pod/Classes/**/*' end s.subspec 'InAppMessage' do |iam| - iam.dependency 'Appboy-iOS-SDK/InAppMessage', '~>4.0.1' + iam.dependency 'Appboy-iOS-SDK/InAppMessage', '~>4.3.0' iam.source_files = 'Pod/Classes/**/*' end s.subspec 'NewsFeed' do |nf| - nf.dependency 'Appboy-iOS-SDK/NewsFeed', '~>4.0.1' + nf.dependency 'Appboy-iOS-SDK/NewsFeed', '~>4.3.0' nf.source_files = 'Pod/Classes/**/*' end s.subspec 'ContentCards' do |cc| - cc.dependency 'Appboy-iOS-SDK/ContentCards', '~>4.0.1' + cc.dependency 'Appboy-iOS-SDK/ContentCards', '~>4.3.0' cc.source_files = 'Pod/Classes/**/*' end diff --git a/Segment_Appboy.json b/Segment_Appboy.json index 7f31abc..3342741 100644 --- a/Segment_Appboy.json +++ b/Segment_Appboy.json @@ -1 +1 @@ -{ "4.0.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.0.0/Segment_Appboy.framework.zip", "3.6.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.1/Segment_Appboy.framework.zip", "3.6.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.0/Segment_Appboy.framework.zip", "3.5.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.5.0/Segment_Appboy.framework.zip", "3.4.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.1/Segment_Appboy.framework.zip", "3.4.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.0/Segment_Appboy.framework.zip", "3.3.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.3.0/Segment_Appboy.framework.zip", "3.2.0" : "https://github.com/Appboy/appboy-segment-ios/releases/download/3.2.0/Segment_Appboy.framework.zip"} +{ "4.3.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.3.0/Segment_Appboy.framework.zip", "4.2.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.2.0/Segment_Appboy.framework.zip", "4.0.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.0.0/Segment_Appboy.framework.zip", "3.6.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.1/Segment_Appboy.framework.zip", "3.6.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.0/Segment_Appboy.framework.zip", "3.5.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.5.0/Segment_Appboy.framework.zip", "3.4.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.1/Segment_Appboy.framework.zip", "3.4.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.0/Segment_Appboy.framework.zip", "3.3.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.3.0/Segment_Appboy.framework.zip", "3.2.0" : "https://github.com/Appboy/appboy-segment-ios/releases/download/3.2.0/Segment_Appboy.framework.zip"}