diff --git a/.gitignore b/.gitignore index e0d014ff0..a64b42758 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ Pods # Adjust Frameworks + +# Code style +uncrustify.cfg diff --git a/Adjust.podspec b/Adjust.podspec index 083e4b893..7d4e7d516 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "Adjust" - s.version = "4.8.5" + s.version = "4.9.0" s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com." s.homepage = "http://adjust.com" s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } s.author = { "Christian Wellenbrock" => "welle@adjust.com" } - s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.8.5" } + s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.9.0" } s.ios.deployment_target = '6.0' s.tvos.deployment_target = '9.0' s.framework = 'SystemConfiguration' diff --git a/Adjust.xcodeproj/project.pbxproj b/Adjust.xcodeproj/project.pbxproj index c0ee5bc3c..7133f10c8 100644 --- a/Adjust.xcodeproj/project.pbxproj +++ b/Adjust.xcodeproj/project.pbxproj @@ -43,8 +43,6 @@ 96164D731CC8FA73009431AB /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D711CC8FA73009431AB /* ADJSdkClickHandler.m */; }; 96164D841CCA4D10009431AB /* ADJSdkClickHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 96164D701CC8FA73009431AB /* ADJSdkClickHandler.h */; }; 96164D861CCA4D27009431AB /* ADJBackoffStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 965B7F2E1CC78F6600098639 /* ADJBackoffStrategy.h */; }; - 96164D871CCA4D36009431AB /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D711CC8FA73009431AB /* ADJSdkClickHandler.m */; }; - 96164D891CCA4D48009431AB /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 965B7F2F1CC78F6600098639 /* ADJBackoffStrategy.m */; }; 96164D8C1CCA4DEA009431AB /* ADJSystemProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 96164D8A1CCA4DEA009431AB /* ADJSystemProfile.h */; }; 96164D8D1CCA4DEA009431AB /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D8B1CCA4DEA009431AB /* ADJSystemProfile.m */; }; 9620EA451B062D6F009673F1 /* ADJTestActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9620EA441B062D6F009673F1 /* ADJTestActivityPackage.m */; }; @@ -54,7 +52,7 @@ 96325E8A190E892600A97911 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96325E84190E5CD900A97911 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 96325E8B190E8D6200A97911 /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96325E86190E5CE400A97911 /* iAd.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 96325E8C190E8D6B00A97911 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96325E84190E5CD900A97911 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 964E17FF1D50C68E0097770B /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 964E17FE1D50C68E0097770B /* SafariServices.framework */; }; + 964E17FF1D50C68E0097770B /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 964E17FE1D50C68E0097770B /* SafariServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 965307F61A000DA400107FF9 /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 965307F51A000DA400107FF9 /* ADJDeviceInfo.m */; }; 9657BF6F1A3B029000CD6853 /* ADJAttributionHandlerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9657BF6E1A3B029000CD6853 /* ADJAttributionHandlerTests.m */; }; 965B7F301CC78F6600098639 /* ADJBackoffStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 965B7F2E1CC78F6600098639 /* ADJBackoffStrategy.h */; }; @@ -76,6 +74,12 @@ 969952D21A01309200928462 /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 969952D11A01309200928462 /* ADJAttribution.m */; }; 96A2D2261CEE0E6200C39DE0 /* ADJSdkClickHandlerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 96A2D2251CEE0E6200C39DE0 /* ADJSdkClickHandlerTests.m */; }; 96A2D2381CEF3B2D00C39DE0 /* ADJRequestHandlerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 96A2D2371CEF3B2D00C39DE0 /* ADJRequestHandlerTests.m */; }; + 96B671101D788EEC0090A023 /* ADJSessionParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 96B6710E1D788EEC0090A023 /* ADJSessionParameters.h */; }; + 96B671111D788EEC0090A023 /* ADJSessionParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 96B6710F1D788EEC0090A023 /* ADJSessionParameters.m */; }; + 96B671141D788F4A0090A023 /* ADJSessionParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 96B671121D788F4A0090A023 /* ADJSessionParameters.h */; }; + 96B671151D788F4A0090A023 /* ADJSessionParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 96B671131D788F4A0090A023 /* ADJSessionParameters.m */; }; + 96B671181D788F7A0090A023 /* ADJSessionParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 96B671161D788F7A0090A023 /* ADJSessionParameters.h */; }; + 96B671191D788F7A0090A023 /* ADJSessionParameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 96B671171D788F7A0090A023 /* ADJSessionParameters.m */; }; 96BCFBCD1AC99231005A65C5 /* Adjust.h in Headers */ = {isa = PBXBuildFile; fileRef = 96E5E34C18BBB48A008E7B30 /* Adjust.h */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCFBCE1AC99235005A65C5 /* ADJEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9609BC6819EEA55800E02303 /* ADJEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCFBD01AC9923F005A65C5 /* ADJConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 960A8BB71A029A8000F2BB95 /* ADJConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -124,89 +128,148 @@ 96E768AA1CE6281F005D811C /* ADJTrackingDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E768A91CE6281F005D811C /* ADJTrackingDelegate.m */; }; 96ED00391A38A4CD00209110 /* ADJAttributionHandlerMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 96ED00381A38A4CD00209110 /* ADJAttributionHandlerMock.m */; }; 96ED003E1A38A98C00209110 /* ADJAttributionChangedDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 96ED003D1A38A98C00209110 /* ADJAttributionChangedDelegate.m */; }; - 96ED74FB1CD8085000C073B8 /* ADJSystemProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 96ED74F91CD8085000C073B8 /* ADJSystemProfile.h */; }; - 96ED74FC1CD8085000C073B8 /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 96ED74FA1CD8085000C073B8 /* ADJSystemProfile.m */; }; 96ED74FF1CD81B3E00C073B8 /* ADJSdkClickHandlerMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 96ED74FE1CD81B3E00C073B8 /* ADJSdkClickHandlerMock.m */; }; + 96FC6E4F1D256B81004482D8 /* ADJActivityHandlerConstructorState.m in Sources */ = {isa = PBXBuildFile; fileRef = 96FC6E4E1D256B81004482D8 /* ADJActivityHandlerConstructorState.m */; }; + 96FC6E581D258272004482D8 /* ADJEndSessionState.m in Sources */ = {isa = PBXBuildFile; fileRef = 96FC6E571D258272004482D8 /* ADJEndSessionState.m */; }; 96FCC53A1C186426007BBFE1 /* ADJResponseData.h in Headers */ = {isa = PBXBuildFile; fileRef = 96FCC5361C186426007BBFE1 /* ADJResponseData.h */; }; 96FCC53B1C186426007BBFE1 /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 96FCC5371C186426007BBFE1 /* ADJResponseData.m */; }; 96FDD75E1C566C38009C402E /* NSURLSession+NSURLDataWithRequestMocking.m in Sources */ = {isa = PBXBuildFile; fileRef = 96FDD75D1C566C38009C402E /* NSURLSession+NSURLDataWithRequestMocking.m */; }; + 9D0C7D3F1D79B3FE009DDF4E /* ADJInitState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0C7D3E1D79B3FE009DDF4E /* ADJInitState.m */; }; 9D363AC31BDA50FA00B47FE9 /* ADJLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 96E5E37318BBB48A008E7B30 /* ADJLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A691C96D2A200980777 /* ADJActivityHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A331C96D2A200980777 /* ADJActivityHandler.h */; }; - 9DA11A6A1C96D2A200980777 /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A341C96D2A200980777 /* ADJActivityHandler.m */; }; - 9DA11A6B1C96D2A200980777 /* ADJActivityKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A351C96D2A200980777 /* ADJActivityKind.h */; }; - 9DA11A6C1C96D2A200980777 /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A361C96D2A200980777 /* ADJActivityKind.m */; }; - 9DA11A6D1C96D2A200980777 /* ADJActivityPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A371C96D2A200980777 /* ADJActivityPackage.h */; }; - 9DA11A6E1C96D2A200980777 /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A381C96D2A200980777 /* ADJActivityPackage.m */; }; - 9DA11A6F1C96D2A200980777 /* ADJActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A391C96D2A200980777 /* ADJActivityState.h */; }; - 9DA11A701C96D2A200980777 /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A3A1C96D2A200980777 /* ADJActivityState.m */; }; - 9DA11A711C96D2A200980777 /* NSData+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A3C1C96D2A200980777 /* NSData+ADJAdditions.h */; }; - 9DA11A721C96D2A200980777 /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A3D1C96D2A200980777 /* NSData+ADJAdditions.m */; }; - 9DA11A731C96D2A200980777 /* NSString+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A3E1C96D2A200980777 /* NSString+ADJAdditions.h */; }; - 9DA11A741C96D2A200980777 /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A3F1C96D2A200980777 /* NSString+ADJAdditions.m */; }; - 9DA11A751C96D2A200980777 /* UIDevice+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A401C96D2A200980777 /* UIDevice+ADJAdditions.h */; }; - 9DA11A761C96D2A200980777 /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A411C96D2A200980777 /* UIDevice+ADJAdditions.m */; }; - 9DA11A771C96D2A200980777 /* ADJAdjustFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A421C96D2A200980777 /* ADJAdjustFactory.h */; }; - 9DA11A781C96D2A200980777 /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A431C96D2A200980777 /* ADJAdjustFactory.m */; }; - 9DA11A791C96D2A200980777 /* ADJAttribution.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A441C96D2A200980777 /* ADJAttribution.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A7A1C96D2A200980777 /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A451C96D2A200980777 /* ADJAttribution.m */; }; - 9DA11A7B1C96D2A200980777 /* ADJAttributionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A461C96D2A200980777 /* ADJAttributionHandler.h */; }; - 9DA11A7C1C96D2A200980777 /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A471C96D2A200980777 /* ADJAttributionHandler.m */; }; - 9DA11A7D1C96D2A200980777 /* ADJConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A481C96D2A200980777 /* ADJConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A7E1C96D2A200980777 /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A491C96D2A200980777 /* ADJConfig.m */; }; - 9DA11A7F1C96D2A200980777 /* ADJDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A4A1C96D2A200980777 /* ADJDeviceInfo.h */; }; - 9DA11A801C96D2A200980777 /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A4B1C96D2A200980777 /* ADJDeviceInfo.m */; }; - 9DA11A811C96D2A200980777 /* ADJEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A4C1C96D2A200980777 /* ADJEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A821C96D2A200980777 /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A4D1C96D2A200980777 /* ADJEvent.m */; }; - 9DA11A831C96D2A200980777 /* ADJEventFailure.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A4E1C96D2A200980777 /* ADJEventFailure.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A841C96D2A200980777 /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A4F1C96D2A200980777 /* ADJEventFailure.m */; }; - 9DA11A851C96D2A200980777 /* ADJEventSuccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A501C96D2A200980777 /* ADJEventSuccess.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A861C96D2A200980777 /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A511C96D2A200980777 /* ADJEventSuccess.m */; }; - 9DA11A871C96D2A200980777 /* ADJLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A521C96D2A200980777 /* ADJLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A881C96D2A200980777 /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A531C96D2A200980777 /* ADJLogger.m */; }; - 9DA11A891C96D2A200980777 /* ADJPackageBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A541C96D2A200980777 /* ADJPackageBuilder.h */; }; - 9DA11A8A1C96D2A200980777 /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A551C96D2A200980777 /* ADJPackageBuilder.m */; }; - 9DA11A8B1C96D2A200980777 /* ADJPackageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A561C96D2A200980777 /* ADJPackageHandler.h */; }; - 9DA11A8C1C96D2A300980777 /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A571C96D2A200980777 /* ADJPackageHandler.m */; }; - 9DA11A8D1C96D2A300980777 /* ADJRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A581C96D2A200980777 /* ADJRequestHandler.h */; }; - 9DA11A8E1C96D2A300980777 /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A591C96D2A200980777 /* ADJRequestHandler.m */; }; - 9DA11A8F1C96D2A300980777 /* ADJResponseData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A5A1C96D2A200980777 /* ADJResponseData.h */; }; - 9DA11A901C96D2A300980777 /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A5B1C96D2A200980777 /* ADJResponseData.m */; }; - 9DA11A911C96D2A300980777 /* ADJSessionFailure.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A5C1C96D2A200980777 /* ADJSessionFailure.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A921C96D2A300980777 /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A5D1C96D2A200980777 /* ADJSessionFailure.m */; }; - 9DA11A931C96D2A300980777 /* ADJSessionSuccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A5E1C96D2A200980777 /* ADJSessionSuccess.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A941C96D2A300980777 /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A5F1C96D2A200980777 /* ADJSessionSuccess.m */; }; - 9DA11A951C96D2A300980777 /* ADJTimerCycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A601C96D2A200980777 /* ADJTimerCycle.h */; }; - 9DA11A961C96D2A300980777 /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A611C96D2A200980777 /* ADJTimerCycle.m */; }; - 9DA11A971C96D2A300980777 /* ADJTimerOnce.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A621C96D2A200980777 /* ADJTimerOnce.h */; }; - 9DA11A981C96D2A300980777 /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A631C96D2A200980777 /* ADJTimerOnce.m */; }; - 9DA11A991C96D2A300980777 /* Adjust.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A641C96D2A200980777 /* Adjust.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9DA11A9A1C96D2A300980777 /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A651C96D2A200980777 /* Adjust.m */; }; - 9DA11A9B1C96D2A300980777 /* ADJUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DA11A661C96D2A200980777 /* ADJUtil.h */; }; - 9DA11A9C1C96D2A300980777 /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA11A671C96D2A200980777 /* ADJUtil.m */; }; - 9DA11A9D1C96D2A300980777 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DA11A681C96D2A200980777 /* Info.plist */; }; 9DAA089F1D2A7B15001C04E4 /* ADJTrackingPixel.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DAA089D1D2A7B15001C04E4 /* ADJTrackingPixel.h */; }; 9DAA08A01D2A7B15001C04E4 /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA089E1D2A7B15001C04E4 /* ADJTrackingPixel.m */; }; - 9DAA08AD1D2A80B7001C04E4 /* ADJTrackingPixel.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DAA08A91D2A80B7001C04E4 /* ADJTrackingPixel.h */; }; - 9DAA08AE1D2A80B7001C04E4 /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA08AA1D2A80B7001C04E4 /* ADJTrackingPixel.m */; }; + 9DB457B01D743704004D69E8 /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8DF1D6F3CA5008E362F /* ADJBackoffStrategy.m */; }; + 9DB457B11D743704004D69E8 /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8F71D6F3CA5008E362F /* ADJSdkClickHandler.m */; }; 9DE7C8FD1AE688DA001556E5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DE7C8FC1AE688DA001556E5 /* UIKit.framework */; }; + 9DF9C8B31D6ED228008E362F /* ADJKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8B11D6ED228008E362F /* ADJKeychain.h */; }; + 9DF9C8B41D6ED228008E362F /* ADJKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8B21D6ED228008E362F /* ADJKeychain.m */; }; + 9DF9C9091D6F3CA5008E362F /* ADJActivityHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8C91D6F3CA5008E362F /* ADJActivityHandler.h */; }; + 9DF9C90A1D6F3CA5008E362F /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8CA1D6F3CA5008E362F /* ADJActivityHandler.m */; }; + 9DF9C90B1D6F3CA5008E362F /* ADJActivityKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8CB1D6F3CA5008E362F /* ADJActivityKind.h */; }; + 9DF9C90C1D6F3CA5008E362F /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8CC1D6F3CA5008E362F /* ADJActivityKind.m */; }; + 9DF9C90D1D6F3CA5008E362F /* ADJActivityPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8CD1D6F3CA5008E362F /* ADJActivityPackage.h */; }; + 9DF9C90E1D6F3CA5008E362F /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8CE1D6F3CA5008E362F /* ADJActivityPackage.m */; }; + 9DF9C90F1D6F3CA5008E362F /* ADJActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8CF1D6F3CA5008E362F /* ADJActivityState.h */; }; + 9DF9C9101D6F3CA5008E362F /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8D01D6F3CA5008E362F /* ADJActivityState.m */; }; + 9DF9C9111D6F3CA5008E362F /* NSData+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8D21D6F3CA5008E362F /* NSData+ADJAdditions.h */; }; + 9DF9C9121D6F3CA5008E362F /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8D31D6F3CA5008E362F /* NSData+ADJAdditions.m */; }; + 9DF9C9131D6F3CA5008E362F /* NSString+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8D41D6F3CA5008E362F /* NSString+ADJAdditions.h */; }; + 9DF9C9141D6F3CA5008E362F /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8D51D6F3CA5008E362F /* NSString+ADJAdditions.m */; }; + 9DF9C9151D6F3CA5008E362F /* UIDevice+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8D61D6F3CA5008E362F /* UIDevice+ADJAdditions.h */; }; + 9DF9C9161D6F3CA5008E362F /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8D71D6F3CA5008E362F /* UIDevice+ADJAdditions.m */; }; + 9DF9C9171D6F3CA5008E362F /* ADJAdjustFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8D81D6F3CA5008E362F /* ADJAdjustFactory.h */; }; + 9DF9C9181D6F3CA5008E362F /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8D91D6F3CA5008E362F /* ADJAdjustFactory.m */; }; + 9DF9C9191D6F3CA5008E362F /* ADJAttribution.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8DA1D6F3CA5008E362F /* ADJAttribution.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C91A1D6F3CA5008E362F /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8DB1D6F3CA5008E362F /* ADJAttribution.m */; }; + 9DF9C91B1D6F3CA5008E362F /* ADJAttributionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8DC1D6F3CA5008E362F /* ADJAttributionHandler.h */; }; + 9DF9C91C1D6F3CA5008E362F /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8DD1D6F3CA5008E362F /* ADJAttributionHandler.m */; }; + 9DF9C91F1D6F3CA5008E362F /* ADJConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8E01D6F3CA5008E362F /* ADJConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C9201D6F3CA5008E362F /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8E11D6F3CA5008E362F /* ADJConfig.m */; }; + 9DF9C9211D6F3CA5008E362F /* ADJDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8E21D6F3CA5008E362F /* ADJDeviceInfo.h */; }; + 9DF9C9221D6F3CA5008E362F /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8E31D6F3CA5008E362F /* ADJDeviceInfo.m */; }; + 9DF9C9231D6F3CA5008E362F /* ADJEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8E41D6F3CA5008E362F /* ADJEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C9241D6F3CA5008E362F /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8E51D6F3CA5008E362F /* ADJEvent.m */; }; + 9DF9C9251D6F3CA5008E362F /* ADJEventFailure.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8E61D6F3CA5008E362F /* ADJEventFailure.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C9261D6F3CA5008E362F /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8E71D6F3CA5008E362F /* ADJEventFailure.m */; }; + 9DF9C9271D6F3CA5008E362F /* ADJEventSuccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8E81D6F3CA5008E362F /* ADJEventSuccess.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C9281D6F3CA5008E362F /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8E91D6F3CA5008E362F /* ADJEventSuccess.m */; }; + 9DF9C9291D6F3CA5008E362F /* ADJKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8EA1D6F3CA5008E362F /* ADJKeychain.h */; }; + 9DF9C92A1D6F3CA5008E362F /* ADJKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8EB1D6F3CA5008E362F /* ADJKeychain.m */; }; + 9DF9C92B1D6F3CA5008E362F /* ADJLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8EC1D6F3CA5008E362F /* ADJLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C92C1D6F3CA5008E362F /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8ED1D6F3CA5008E362F /* ADJLogger.m */; }; + 9DF9C92D1D6F3CA5008E362F /* ADJPackageBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8EE1D6F3CA5008E362F /* ADJPackageBuilder.h */; }; + 9DF9C92E1D6F3CA5008E362F /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8EF1D6F3CA5008E362F /* ADJPackageBuilder.m */; }; + 9DF9C92F1D6F3CA5008E362F /* ADJPackageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8F01D6F3CA5008E362F /* ADJPackageHandler.h */; }; + 9DF9C9301D6F3CA5008E362F /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8F11D6F3CA5008E362F /* ADJPackageHandler.m */; }; + 9DF9C9311D6F3CA5008E362F /* ADJRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8F21D6F3CA5008E362F /* ADJRequestHandler.h */; }; + 9DF9C9321D6F3CA5008E362F /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8F31D6F3CA5008E362F /* ADJRequestHandler.m */; }; + 9DF9C9331D6F3CA5008E362F /* ADJResponseData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8F41D6F3CA5008E362F /* ADJResponseData.h */; }; + 9DF9C9341D6F3CA5008E362F /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8F51D6F3CA5008E362F /* ADJResponseData.m */; }; + 9DF9C9371D6F3CA5008E362F /* ADJSessionFailure.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8F81D6F3CA5008E362F /* ADJSessionFailure.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C9381D6F3CA5008E362F /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8F91D6F3CA5008E362F /* ADJSessionFailure.m */; }; + 9DF9C9391D6F3CA5008E362F /* ADJSessionSuccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8FA1D6F3CA5008E362F /* ADJSessionSuccess.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C93A1D6F3CA5008E362F /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8FB1D6F3CA5008E362F /* ADJSessionSuccess.m */; }; + 9DF9C93B1D6F3CA5008E362F /* ADJSystemProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8FC1D6F3CA5008E362F /* ADJSystemProfile.h */; }; + 9DF9C93C1D6F3CA5008E362F /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8FD1D6F3CA5008E362F /* ADJSystemProfile.m */; }; + 9DF9C93D1D6F3CA5008E362F /* ADJTimerCycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C8FE1D6F3CA5008E362F /* ADJTimerCycle.h */; }; + 9DF9C93E1D6F3CA5008E362F /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8FF1D6F3CA5008E362F /* ADJTimerCycle.m */; }; + 9DF9C93F1D6F3CA5008E362F /* ADJTimerOnce.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C9001D6F3CA5008E362F /* ADJTimerOnce.h */; }; + 9DF9C9401D6F3CA5008E362F /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C9011D6F3CA5008E362F /* ADJTimerOnce.m */; }; + 9DF9C9411D6F3CA5008E362F /* ADJTrackingPixel.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C9021D6F3CA5008E362F /* ADJTrackingPixel.h */; }; + 9DF9C9421D6F3CA5008E362F /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C9031D6F3CA5008E362F /* ADJTrackingPixel.m */; }; + 9DF9C9431D6F3CA5008E362F /* Adjust.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C9041D6F3CA5008E362F /* Adjust.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DF9C9441D6F3CA5008E362F /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C9051D6F3CA5008E362F /* Adjust.m */; }; + 9DF9C9451D6F3CA5008E362F /* ADJUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF9C9061D6F3CA5008E362F /* ADJUtil.h */; }; + 9DF9C9461D6F3CA5008E362F /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C9071D6F3CA5008E362F /* ADJUtil.m */; }; + 9DF9C9471D6F3CA5008E362F /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DF9C9081D6F3CA5008E362F /* Info.plist */; }; 9DFA37B71C0F21D600782607 /* AdjustSdk.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFA37B51C0F21D600782607 /* AdjustSdk.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB06131D747070006D48FC /* AdjustSdkTv.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06121D747070006D48FC /* AdjustSdkTv.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB065A1D7470C0006D48FC /* ADJActivityHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB061A1D7470C0006D48FC /* ADJActivityHandler.h */; }; + 9DFB065B1D7470C0006D48FC /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB061B1D7470C0006D48FC /* ADJActivityHandler.m */; }; + 9DFB065C1D7470C0006D48FC /* ADJActivityKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB061C1D7470C0006D48FC /* ADJActivityKind.h */; }; + 9DFB065D1D7470C0006D48FC /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB061D1D7470C0006D48FC /* ADJActivityKind.m */; }; + 9DFB065E1D7470C0006D48FC /* ADJActivityPackage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB061E1D7470C0006D48FC /* ADJActivityPackage.h */; }; + 9DFB065F1D7470C0006D48FC /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB061F1D7470C0006D48FC /* ADJActivityPackage.m */; }; + 9DFB06601D7470C0006D48FC /* ADJActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06201D7470C0006D48FC /* ADJActivityState.h */; }; + 9DFB06611D7470C0006D48FC /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06211D7470C0006D48FC /* ADJActivityState.m */; }; + 9DFB06621D7470C0006D48FC /* NSData+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06231D7470C0006D48FC /* NSData+ADJAdditions.h */; }; + 9DFB06631D7470C0006D48FC /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06241D7470C0006D48FC /* NSData+ADJAdditions.m */; }; + 9DFB06641D7470C0006D48FC /* NSString+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06251D7470C0006D48FC /* NSString+ADJAdditions.h */; }; + 9DFB06651D7470C0006D48FC /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06261D7470C0006D48FC /* NSString+ADJAdditions.m */; }; + 9DFB06661D7470C0006D48FC /* UIDevice+ADJAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06271D7470C0006D48FC /* UIDevice+ADJAdditions.h */; }; + 9DFB06671D7470C0006D48FC /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06281D7470C0006D48FC /* UIDevice+ADJAdditions.m */; }; + 9DFB06681D7470C0006D48FC /* ADJAdjustFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06291D7470C0006D48FC /* ADJAdjustFactory.h */; }; + 9DFB06691D7470C0006D48FC /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB062A1D7470C0006D48FC /* ADJAdjustFactory.m */; }; + 9DFB066A1D7470C0006D48FC /* ADJAttribution.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB062B1D7470C0006D48FC /* ADJAttribution.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB066B1D7470C0006D48FC /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB062C1D7470C0006D48FC /* ADJAttribution.m */; }; + 9DFB066C1D7470C0006D48FC /* ADJAttributionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB062D1D7470C0006D48FC /* ADJAttributionHandler.h */; }; + 9DFB066D1D7470C0006D48FC /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB062E1D7470C0006D48FC /* ADJAttributionHandler.m */; }; + 9DFB066E1D7470C0006D48FC /* ADJBackoffStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB062F1D7470C0006D48FC /* ADJBackoffStrategy.h */; }; + 9DFB066F1D7470C0006D48FC /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06301D7470C0006D48FC /* ADJBackoffStrategy.m */; }; + 9DFB06701D7470C0006D48FC /* ADJConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06311D7470C0006D48FC /* ADJConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB06711D7470C0006D48FC /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06321D7470C0006D48FC /* ADJConfig.m */; }; + 9DFB06721D7470C0006D48FC /* ADJDeviceInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06331D7470C0006D48FC /* ADJDeviceInfo.h */; }; + 9DFB06731D7470C0006D48FC /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06341D7470C0006D48FC /* ADJDeviceInfo.m */; }; + 9DFB06741D7470C0006D48FC /* ADJEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06351D7470C0006D48FC /* ADJEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB06751D7470C0006D48FC /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06361D7470C0006D48FC /* ADJEvent.m */; }; + 9DFB06761D7470C0006D48FC /* ADJEventFailure.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06371D7470C0006D48FC /* ADJEventFailure.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB06771D7470C0006D48FC /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06381D7470C0006D48FC /* ADJEventFailure.m */; }; + 9DFB06781D7470C0006D48FC /* ADJEventSuccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06391D7470C0006D48FC /* ADJEventSuccess.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB06791D7470C0006D48FC /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB063A1D7470C0006D48FC /* ADJEventSuccess.m */; }; + 9DFB067A1D7470C0006D48FC /* ADJKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB063B1D7470C0006D48FC /* ADJKeychain.h */; }; + 9DFB067B1D7470C0006D48FC /* ADJKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB063C1D7470C0006D48FC /* ADJKeychain.m */; }; + 9DFB067C1D7470C0006D48FC /* ADJLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB063D1D7470C0006D48FC /* ADJLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB067D1D7470C0006D48FC /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB063E1D7470C0006D48FC /* ADJLogger.m */; }; + 9DFB067E1D7470C0006D48FC /* ADJPackageBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB063F1D7470C0006D48FC /* ADJPackageBuilder.h */; }; + 9DFB067F1D7470C0006D48FC /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06401D7470C0006D48FC /* ADJPackageBuilder.m */; }; + 9DFB06801D7470C0006D48FC /* ADJPackageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06411D7470C0006D48FC /* ADJPackageHandler.h */; }; + 9DFB06811D7470C0006D48FC /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06421D7470C0006D48FC /* ADJPackageHandler.m */; }; + 9DFB06821D7470C0006D48FC /* ADJRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06431D7470C0006D48FC /* ADJRequestHandler.h */; }; + 9DFB06831D7470C0006D48FC /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06441D7470C0006D48FC /* ADJRequestHandler.m */; }; + 9DFB06841D7470C0006D48FC /* ADJResponseData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06451D7470C0006D48FC /* ADJResponseData.h */; }; + 9DFB06851D7470C0006D48FC /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06461D7470C0006D48FC /* ADJResponseData.m */; }; + 9DFB06861D7470C0006D48FC /* ADJSdkClickHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06471D7470C0006D48FC /* ADJSdkClickHandler.h */; }; + 9DFB06871D7470C0006D48FC /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06481D7470C0006D48FC /* ADJSdkClickHandler.m */; }; + 9DFB06881D7470C0006D48FC /* ADJSessionFailure.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06491D7470C0006D48FC /* ADJSessionFailure.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB06891D7470C0006D48FC /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB064A1D7470C0006D48FC /* ADJSessionFailure.m */; }; + 9DFB068A1D7470C0006D48FC /* ADJSessionSuccess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB064B1D7470C0006D48FC /* ADJSessionSuccess.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB068B1D7470C0006D48FC /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB064C1D7470C0006D48FC /* ADJSessionSuccess.m */; }; + 9DFB068C1D7470C0006D48FC /* ADJSystemProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB064D1D7470C0006D48FC /* ADJSystemProfile.h */; }; + 9DFB068D1D7470C0006D48FC /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB064E1D7470C0006D48FC /* ADJSystemProfile.m */; }; + 9DFB068E1D7470C0006D48FC /* ADJTimerCycle.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB064F1D7470C0006D48FC /* ADJTimerCycle.h */; }; + 9DFB068F1D7470C0006D48FC /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06501D7470C0006D48FC /* ADJTimerCycle.m */; }; + 9DFB06901D7470C0006D48FC /* ADJTimerOnce.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06511D7470C0006D48FC /* ADJTimerOnce.h */; }; + 9DFB06911D7470C0006D48FC /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06521D7470C0006D48FC /* ADJTimerOnce.m */; }; + 9DFB06921D7470C0006D48FC /* ADJTrackingPixel.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06531D7470C0006D48FC /* ADJTrackingPixel.h */; }; + 9DFB06931D7470C0006D48FC /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06541D7470C0006D48FC /* ADJTrackingPixel.m */; }; + 9DFB06941D7470C0006D48FC /* Adjust.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06551D7470C0006D48FC /* Adjust.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9DFB06951D7470C0006D48FC /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06561D7470C0006D48FC /* Adjust.m */; }; + 9DFB06961D7470C0006D48FC /* ADJUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DFB06571D7470C0006D48FC /* ADJUtil.h */; }; + 9DFB06971D7470C0006D48FC /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DFB06581D7470C0006D48FC /* ADJUtil.m */; }; + 9DFB06981D7470C0006D48FC /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DFB06591D7470C0006D48FC /* Info.plist */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 963909661BCBFE5300A2E8A4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 963909621BCBFE5200A2E8A4 /* AdjustExample-iOS.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9639093C1BCBFCF300A2E8A4; - remoteInfo = "AdjustExample-iOS"; - }; - 963909CD1BCC0D8400A2E8A4 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 963909C91BCC0D8300A2E8A4 /* AdjustExample-tvOS.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 963909B21BCC0D8300A2E8A4; - remoteInfo = "AdjustExample-tvOS"; - }; 9679922318BBAE2800394606 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9679920518BBAE2800394606 /* Project object */; @@ -214,13 +277,6 @@ remoteGlobalIDString = 9679920C18BBAE2800394606; remoteInfo = Adjust; }; - 9D1082C21CFDAF990050568B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9D1082BE1CFDAF990050568B /* AdjustExample-WebView.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9D1082A41CFDAF8E0050568B; - remoteInfo = "AdjustExample-WebView"; - }; 9DE7C8FF1AE68EF1001556E5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9679920518BBAE2800394606 /* Project object */; @@ -228,34 +284,6 @@ remoteGlobalIDString = 9679920C18BBAE2800394606; remoteInfo = Adjust; }; - 9DF7A9DC1CB4ECBC00D3591F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9DF7A9D71CB4ECBC00D3591F /* AdjustExample-Swift.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9DF7A9C21CB4ECA600D3591F; - remoteInfo = "AdjustExample-Swift"; - }; - 9DF7AC5B1CB4FEE200D3591F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9DF7AC551CB4FEE200D3591F /* AdjustExample-iWatch.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9DF7AC141CB4FEDB00D3591F; - remoteInfo = "AdjustExample-iWatch"; - }; - 9DF7AC5D1CB4FEE200D3591F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9DF7AC551CB4FEE200D3591F /* AdjustExample-iWatch.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9DF7AC2B1CB4FEDB00D3591F; - remoteInfo = "AdjustExample-iWatch WatchKit App"; - }; - 9DF7AC5F1CB4FEE200D3591F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9DF7AC551CB4FEE200D3591F /* AdjustExample-iWatch.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9DF7AC3A1CB4FEDB00D3591F; - remoteInfo = "AdjustExample-iWatch WatchKit Extension"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -308,8 +336,6 @@ 9620EA501B065177009673F1 /* ADJPackageFields.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageFields.m; sourceTree = ""; }; 96325E84190E5CD900A97911 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; 96325E86190E5CE400A97911 /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; - 963909621BCBFE5200A2E8A4 /* AdjustExample-iOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-iOS.xcodeproj"; path = "examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj"; sourceTree = ""; }; - 963909C91BCC0D8300A2E8A4 /* AdjustExample-tvOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-tvOS.xcodeproj"; path = "examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj"; sourceTree = ""; }; 9644B7EA19F148F3008576FC /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; 9648C5E61CD1765E00A3B049 /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = ""; }; 9648C5E71CD1765E00A3B049 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = ""; }; @@ -347,6 +373,12 @@ 969952D11A01309200928462 /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; 96A2D2251CEE0E6200C39DE0 /* ADJSdkClickHandlerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandlerTests.m; sourceTree = ""; }; 96A2D2371CEF3B2D00C39DE0 /* ADJRequestHandlerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandlerTests.m; sourceTree = ""; }; + 96B6710E1D788EEC0090A023 /* ADJSessionParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionParameters.h; sourceTree = ""; }; + 96B6710F1D788EEC0090A023 /* ADJSessionParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionParameters.m; sourceTree = ""; }; + 96B671121D788F4A0090A023 /* ADJSessionParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionParameters.h; sourceTree = ""; }; + 96B671131D788F4A0090A023 /* ADJSessionParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionParameters.m; sourceTree = ""; }; + 96B671161D788F7A0090A023 /* ADJSessionParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionParameters.h; sourceTree = ""; }; + 96B671171D788F7A0090A023 /* ADJSessionParameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionParameters.m; sourceTree = ""; }; 96C93DF31AC47F2E00B53F56 /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; 96C93DF41AC47F2E00B53F56 /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; 96CD2BDC1A13BFC600A40AFB /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; @@ -400,83 +432,158 @@ 96ED00381A38A4CD00209110 /* ADJAttributionHandlerMock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandlerMock.m; sourceTree = ""; }; 96ED003C1A38A98C00209110 /* ADJAttributionChangedDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionChangedDelegate.h; sourceTree = ""; }; 96ED003D1A38A98C00209110 /* ADJAttributionChangedDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionChangedDelegate.m; sourceTree = ""; }; - 96ED74F91CD8085000C073B8 /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; - 96ED74FA1CD8085000C073B8 /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; 96ED74FD1CD81B3E00C073B8 /* ADJSdkClickHandlerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandlerMock.h; sourceTree = ""; }; 96ED74FE1CD81B3E00C073B8 /* ADJSdkClickHandlerMock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandlerMock.m; sourceTree = ""; }; + 96FC6E4D1D256B81004482D8 /* ADJActivityHandlerConstructorState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandlerConstructorState.h; sourceTree = ""; }; + 96FC6E4E1D256B81004482D8 /* ADJActivityHandlerConstructorState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandlerConstructorState.m; sourceTree = ""; }; + 96FC6E561D258272004482D8 /* ADJEndSessionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEndSessionState.h; sourceTree = ""; }; + 96FC6E571D258272004482D8 /* ADJEndSessionState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEndSessionState.m; sourceTree = ""; }; 96FCC5361C186426007BBFE1 /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; 96FCC5371C186426007BBFE1 /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; 96FDD75C1C566C38009C402E /* NSURLSession+NSURLDataWithRequestMocking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURLSession+NSURLDataWithRequestMocking.h"; sourceTree = ""; }; 96FDD75D1C566C38009C402E /* NSURLSession+NSURLDataWithRequestMocking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURLSession+NSURLDataWithRequestMocking.m"; sourceTree = ""; }; - 9D1082BE1CFDAF990050568B /* AdjustExample-WebView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-WebView.xcodeproj"; path = "examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj"; sourceTree = ""; }; + 9D0C7D3D1D79B3FE009DDF4E /* ADJInitState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJInitState.h; sourceTree = ""; }; + 9D0C7D3E1D79B3FE009DDF4E /* ADJInitState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJInitState.m; sourceTree = ""; }; 9D75F1841D07460600E5D222 /* adjust_config.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = adjust_config.js; sourceTree = ""; }; 9D75F1851D07460600E5D222 /* adjust_event.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = adjust_event.js; sourceTree = ""; }; 9D75F1861D07460600E5D222 /* adjust.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = adjust.js; sourceTree = ""; }; - 9DA11A331C96D2A200980777 /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; - 9DA11A341C96D2A200980777 /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; - 9DA11A351C96D2A200980777 /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; - 9DA11A361C96D2A200980777 /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; - 9DA11A371C96D2A200980777 /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; - 9DA11A381C96D2A200980777 /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; - 9DA11A391C96D2A200980777 /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; - 9DA11A3A1C96D2A200980777 /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; - 9DA11A3C1C96D2A200980777 /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; - 9DA11A3D1C96D2A200980777 /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; - 9DA11A3E1C96D2A200980777 /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; - 9DA11A3F1C96D2A200980777 /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; - 9DA11A401C96D2A200980777 /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; - 9DA11A411C96D2A200980777 /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; - 9DA11A421C96D2A200980777 /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; - 9DA11A431C96D2A200980777 /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; - 9DA11A441C96D2A200980777 /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; - 9DA11A451C96D2A200980777 /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; - 9DA11A461C96D2A200980777 /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; - 9DA11A471C96D2A200980777 /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; - 9DA11A481C96D2A200980777 /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; - 9DA11A491C96D2A200980777 /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; - 9DA11A4A1C96D2A200980777 /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; - 9DA11A4B1C96D2A200980777 /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; - 9DA11A4C1C96D2A200980777 /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; - 9DA11A4D1C96D2A200980777 /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; - 9DA11A4E1C96D2A200980777 /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; - 9DA11A4F1C96D2A200980777 /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; - 9DA11A501C96D2A200980777 /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; - 9DA11A511C96D2A200980777 /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; - 9DA11A521C96D2A200980777 /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; - 9DA11A531C96D2A200980777 /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; - 9DA11A541C96D2A200980777 /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; - 9DA11A551C96D2A200980777 /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; - 9DA11A561C96D2A200980777 /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; - 9DA11A571C96D2A200980777 /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; - 9DA11A581C96D2A200980777 /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; - 9DA11A591C96D2A200980777 /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; - 9DA11A5A1C96D2A200980777 /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; - 9DA11A5B1C96D2A200980777 /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; - 9DA11A5C1C96D2A200980777 /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; - 9DA11A5D1C96D2A200980777 /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; - 9DA11A5E1C96D2A200980777 /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; - 9DA11A5F1C96D2A200980777 /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; - 9DA11A601C96D2A200980777 /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; - 9DA11A611C96D2A200980777 /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; - 9DA11A621C96D2A200980777 /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; - 9DA11A631C96D2A200980777 /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; - 9DA11A641C96D2A200980777 /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; - 9DA11A651C96D2A200980777 /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; - 9DA11A661C96D2A200980777 /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; - 9DA11A671C96D2A200980777 /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; - 9DA11A681C96D2A200980777 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9DAA089D1D2A7B15001C04E4 /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; 9DAA089E1D2A7B15001C04E4 /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; - 9DAA08A71D2A80B7001C04E4 /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; - 9DAA08A81D2A80B7001C04E4 /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; - 9DAA08A91D2A80B7001C04E4 /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; - 9DAA08AA1D2A80B7001C04E4 /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; 9DE7C8FC1AE688DA001556E5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 9DF7A9D71CB4ECBC00D3591F /* AdjustExample-Swift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-Swift.xcodeproj"; path = "examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj"; sourceTree = ""; }; - 9DF7AC551CB4FEE200D3591F /* AdjustExample-iWatch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-iWatch.xcodeproj"; path = "examples/AdjustExample-iWatch/AdjustExample-iWatch.xcodeproj"; sourceTree = ""; }; + 9DF9C8B11D6ED228008E362F /* ADJKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJKeychain.h; sourceTree = ""; }; + 9DF9C8B21D6ED228008E362F /* ADJKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJKeychain.m; sourceTree = ""; }; + 9DF9C8C91D6F3CA5008E362F /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; + 9DF9C8CA1D6F3CA5008E362F /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; + 9DF9C8CB1D6F3CA5008E362F /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; + 9DF9C8CC1D6F3CA5008E362F /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; + 9DF9C8CD1D6F3CA5008E362F /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; + 9DF9C8CE1D6F3CA5008E362F /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; + 9DF9C8CF1D6F3CA5008E362F /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; + 9DF9C8D01D6F3CA5008E362F /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; + 9DF9C8D21D6F3CA5008E362F /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; + 9DF9C8D31D6F3CA5008E362F /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; + 9DF9C8D41D6F3CA5008E362F /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; + 9DF9C8D51D6F3CA5008E362F /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; + 9DF9C8D61D6F3CA5008E362F /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; + 9DF9C8D71D6F3CA5008E362F /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; + 9DF9C8D81D6F3CA5008E362F /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; + 9DF9C8D91D6F3CA5008E362F /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; + 9DF9C8DA1D6F3CA5008E362F /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; + 9DF9C8DB1D6F3CA5008E362F /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; + 9DF9C8DC1D6F3CA5008E362F /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; + 9DF9C8DD1D6F3CA5008E362F /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; + 9DF9C8DE1D6F3CA5008E362F /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; + 9DF9C8DF1D6F3CA5008E362F /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; + 9DF9C8E01D6F3CA5008E362F /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; + 9DF9C8E11D6F3CA5008E362F /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; + 9DF9C8E21D6F3CA5008E362F /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; + 9DF9C8E31D6F3CA5008E362F /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; + 9DF9C8E41D6F3CA5008E362F /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; + 9DF9C8E51D6F3CA5008E362F /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; + 9DF9C8E61D6F3CA5008E362F /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; + 9DF9C8E71D6F3CA5008E362F /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; + 9DF9C8E81D6F3CA5008E362F /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; + 9DF9C8E91D6F3CA5008E362F /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; + 9DF9C8EA1D6F3CA5008E362F /* ADJKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJKeychain.h; sourceTree = ""; }; + 9DF9C8EB1D6F3CA5008E362F /* ADJKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJKeychain.m; sourceTree = ""; }; + 9DF9C8EC1D6F3CA5008E362F /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; + 9DF9C8ED1D6F3CA5008E362F /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; + 9DF9C8EE1D6F3CA5008E362F /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; + 9DF9C8EF1D6F3CA5008E362F /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; + 9DF9C8F01D6F3CA5008E362F /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; + 9DF9C8F11D6F3CA5008E362F /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; + 9DF9C8F21D6F3CA5008E362F /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; + 9DF9C8F31D6F3CA5008E362F /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; + 9DF9C8F41D6F3CA5008E362F /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; + 9DF9C8F51D6F3CA5008E362F /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; + 9DF9C8F61D6F3CA5008E362F /* ADJSdkClickHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandler.h; sourceTree = ""; }; + 9DF9C8F71D6F3CA5008E362F /* ADJSdkClickHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandler.m; sourceTree = ""; }; + 9DF9C8F81D6F3CA5008E362F /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; + 9DF9C8F91D6F3CA5008E362F /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; + 9DF9C8FA1D6F3CA5008E362F /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; + 9DF9C8FB1D6F3CA5008E362F /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; + 9DF9C8FC1D6F3CA5008E362F /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; + 9DF9C8FD1D6F3CA5008E362F /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; + 9DF9C8FE1D6F3CA5008E362F /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; + 9DF9C8FF1D6F3CA5008E362F /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; + 9DF9C9001D6F3CA5008E362F /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; + 9DF9C9011D6F3CA5008E362F /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; + 9DF9C9021D6F3CA5008E362F /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; + 9DF9C9031D6F3CA5008E362F /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; + 9DF9C9041D6F3CA5008E362F /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; + 9DF9C9051D6F3CA5008E362F /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; + 9DF9C9061D6F3CA5008E362F /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; + 9DF9C9071D6F3CA5008E362F /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; + 9DF9C9081D6F3CA5008E362F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9DFA37AD1C0F219400782607 /* AdjustSdk.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AdjustSdk.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9DFA37B51C0F21D600782607 /* AdjustSdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustSdk.h; sourceTree = ""; }; 9DFA37B61C0F21D600782607 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9DFB06101D747070006D48FC /* AdjustSdkTv.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AdjustSdkTv.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9DFB06121D747070006D48FC /* AdjustSdkTv.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AdjustSdkTv.h; sourceTree = ""; }; + 9DFB06141D747070006D48FC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9DFB061A1D7470C0006D48FC /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; + 9DFB061B1D7470C0006D48FC /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; + 9DFB061C1D7470C0006D48FC /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; + 9DFB061D1D7470C0006D48FC /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; + 9DFB061E1D7470C0006D48FC /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; + 9DFB061F1D7470C0006D48FC /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; + 9DFB06201D7470C0006D48FC /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; + 9DFB06211D7470C0006D48FC /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; + 9DFB06231D7470C0006D48FC /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; + 9DFB06241D7470C0006D48FC /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; + 9DFB06251D7470C0006D48FC /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; + 9DFB06261D7470C0006D48FC /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; + 9DFB06271D7470C0006D48FC /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; + 9DFB06281D7470C0006D48FC /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; + 9DFB06291D7470C0006D48FC /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; + 9DFB062A1D7470C0006D48FC /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; + 9DFB062B1D7470C0006D48FC /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; + 9DFB062C1D7470C0006D48FC /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; + 9DFB062D1D7470C0006D48FC /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; + 9DFB062E1D7470C0006D48FC /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; + 9DFB062F1D7470C0006D48FC /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; + 9DFB06301D7470C0006D48FC /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; + 9DFB06311D7470C0006D48FC /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; + 9DFB06321D7470C0006D48FC /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; + 9DFB06331D7470C0006D48FC /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; + 9DFB06341D7470C0006D48FC /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; + 9DFB06351D7470C0006D48FC /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; + 9DFB06361D7470C0006D48FC /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; + 9DFB06371D7470C0006D48FC /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; + 9DFB06381D7470C0006D48FC /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; + 9DFB06391D7470C0006D48FC /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; + 9DFB063A1D7470C0006D48FC /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; + 9DFB063B1D7470C0006D48FC /* ADJKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJKeychain.h; sourceTree = ""; }; + 9DFB063C1D7470C0006D48FC /* ADJKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJKeychain.m; sourceTree = ""; }; + 9DFB063D1D7470C0006D48FC /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; + 9DFB063E1D7470C0006D48FC /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; + 9DFB063F1D7470C0006D48FC /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; + 9DFB06401D7470C0006D48FC /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; + 9DFB06411D7470C0006D48FC /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; + 9DFB06421D7470C0006D48FC /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; + 9DFB06431D7470C0006D48FC /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; + 9DFB06441D7470C0006D48FC /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; + 9DFB06451D7470C0006D48FC /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; + 9DFB06461D7470C0006D48FC /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; + 9DFB06471D7470C0006D48FC /* ADJSdkClickHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandler.h; sourceTree = ""; }; + 9DFB06481D7470C0006D48FC /* ADJSdkClickHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandler.m; sourceTree = ""; }; + 9DFB06491D7470C0006D48FC /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; + 9DFB064A1D7470C0006D48FC /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; + 9DFB064B1D7470C0006D48FC /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; + 9DFB064C1D7470C0006D48FC /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; + 9DFB064D1D7470C0006D48FC /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; + 9DFB064E1D7470C0006D48FC /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; + 9DFB064F1D7470C0006D48FC /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; + 9DFB06501D7470C0006D48FC /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; + 9DFB06511D7470C0006D48FC /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; + 9DFB06521D7470C0006D48FC /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; + 9DFB06531D7470C0006D48FC /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; + 9DFB06541D7470C0006D48FC /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; + 9DFB06551D7470C0006D48FC /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; + 9DFB06561D7470C0006D48FC /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; + 9DFB06571D7470C0006D48FC /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; + 9DFB06581D7470C0006D48FC /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; + 9DFB06591D7470C0006D48FC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -484,9 +591,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 961515A21CD2CB4F0022D336 /* WebKit.framework in Frameworks */, - 961515A01CD2CB450022D336 /* UIKit.framework in Frameworks */, 9615159F1CD2CB360022D336 /* libAdjust.a in Frameworks */, + 961515A01CD2CB450022D336 /* UIKit.framework in Frameworks */, + 961515A21CD2CB4F0022D336 /* WebKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -494,11 +601,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 964E17FF1D50C68E0097770B /* SafariServices.framework in Frameworks */, + 96325E89190E892000A97911 /* iAd.framework in Frameworks */, 9DE7C8FD1AE688DA001556E5 /* UIKit.framework in Frameworks */, 96325E8A190E892600A97911 /* AdSupport.framework in Frameworks */, - 96325E89190E892000A97911 /* iAd.framework in Frameworks */, 9679921118BBAE2800394606 /* Foundation.framework in Frameworks */, + 964E17FF1D50C68E0097770B /* SafariServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -522,6 +629,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9DFB060C1D747070006D48FC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -534,22 +648,6 @@ path = AdjustBridge; sourceTree = ""; }; - 963909631BCBFE5200A2E8A4 /* Products */ = { - isa = PBXGroup; - children = ( - 963909671BCBFE5300A2E8A4 /* AdjustExample-iOS.app */, - ); - name = Products; - sourceTree = ""; - }; - 963909CA1BCC0D8300A2E8A4 /* Products */ = { - isa = PBXGroup; - children = ( - 963909CE1BCC0D8400A2E8A4 /* AdjustExample-tvOS.app */, - ); - name = Products; - sourceTree = ""; - }; 9648C5E41CD1765E00A3B049 /* AdjustBridge */ = { isa = PBXGroup; children = ( @@ -583,16 +681,12 @@ 9679920418BBAE2800394606 = { isa = PBXGroup; children = ( - 9D1082BE1CFDAF990050568B /* AdjustExample-WebView.xcodeproj */, - 9DF7AC551CB4FEE200D3591F /* AdjustExample-iWatch.xcodeproj */, - 963909C91BCC0D8300A2E8A4 /* AdjustExample-tvOS.xcodeproj */, - 963909621BCBFE5200A2E8A4 /* AdjustExample-iOS.xcodeproj */, - 9DF7A9D71CB4ECBC00D3591F /* AdjustExample-Swift.xcodeproj */, 96E5E39A18BBB49E008E7B30 /* AdjustTests */, 96E5E34B18BBB48A008E7B30 /* Adjust */, 9648C5E41CD1765E00A3B049 /* AdjustBridge */, 9DFA37AE1C0F219400782607 /* AdjustSdk */, 961515901CD2CB2C0022D336 /* AdjustBridge */, + 9DFB06111D747070006D48FC /* AdjustSdkTv */, 9679920F18BBAE2800394606 /* Frameworks */, 9679920E18BBAE2800394606 /* Products */, ); @@ -605,6 +699,7 @@ 9679921D18BBAE2800394606 /* AdjustTests.xctest */, 9DFA37AD1C0F219400782607 /* AdjustSdk.framework */, 9615158F1CD2CB2C0022D336 /* libAdjustBridge.a */, + 9DFB06101D747070006D48FC /* AdjustSdkTv.framework */, ); name = Products; sourceTree = ""; @@ -612,14 +707,14 @@ 9679920F18BBAE2800394606 /* Frameworks */ = { isa = PBXGroup; children = ( - 964E17FE1D50C68E0097770B /* SafariServices.framework */, - 961515A11CD2CB4F0022D336 /* WebKit.framework */, - 9DE7C8FC1AE688DA001556E5 /* UIKit.framework */, - 9601C1A11A31DE0300A9AE21 /* SystemConfiguration.framework */, - 9601C19C1A31DD7F00A9AE21 /* CoreTelephony.framework */, 96325E86190E5CE400A97911 /* iAd.framework */, + 9DE7C8FC1AE688DA001556E5 /* UIKit.framework */, + 961515A11CD2CB4F0022D336 /* WebKit.framework */, 96325E84190E5CD900A97911 /* AdSupport.framework */, 9679921018BBAE2800394606 /* Foundation.framework */, + 964E17FE1D50C68E0097770B /* SafariServices.framework */, + 9601C19C1A31DD7F00A9AE21 /* CoreTelephony.framework */, + 9601C1A11A31DE0300A9AE21 /* SystemConfiguration.framework */, ); name = Frameworks; sourceTree = ""; @@ -695,6 +790,10 @@ 96164D711CC8FA73009431AB /* ADJSdkClickHandler.m */, 9DAA089D1D2A7B15001C04E4 /* ADJTrackingPixel.h */, 9DAA089E1D2A7B15001C04E4 /* ADJTrackingPixel.m */, + 9DF9C8B11D6ED228008E362F /* ADJKeychain.h */, + 9DF9C8B21D6ED228008E362F /* ADJKeychain.m */, + 96B6710E1D788EEC0090A023 /* ADJSessionParameters.h */, + 96B6710F1D788EEC0090A023 /* ADJSessionParameters.m */, ); path = Adjust; sourceTree = ""; @@ -742,118 +841,194 @@ 96E768A81CE6281F005D811C /* ADJTrackingDelegate.h */, 96E768A91CE6281F005D811C /* ADJTrackingDelegate.m */, 96A2D2251CEE0E6200C39DE0 /* ADJSdkClickHandlerTests.m */, + 96FC6E4D1D256B81004482D8 /* ADJActivityHandlerConstructorState.h */, + 96FC6E4E1D256B81004482D8 /* ADJActivityHandlerConstructorState.m */, + 96FC6E561D258272004482D8 /* ADJEndSessionState.h */, + 96FC6E571D258272004482D8 /* ADJEndSessionState.m */, + 9D0C7D3D1D79B3FE009DDF4E /* ADJInitState.h */, + 9D0C7D3E1D79B3FE009DDF4E /* ADJInitState.m */, ); path = AdjustTests; sourceTree = ""; }; - 9D1082BF1CFDAF990050568B /* Products */ = { - isa = PBXGroup; - children = ( - 9D1082C31CFDAF990050568B /* AdjustExample-WebView.app */, - ); - name = Products; - sourceTree = ""; - }; - 9DA11A321C96D2A200980777 /* Adjust */ = { + 9DF9C8C81D6F3CA5008E362F /* Adjust */ = { isa = PBXGroup; children = ( - 9DAA08A71D2A80B7001C04E4 /* ADJBackoffStrategy.h */, - 9DAA08A81D2A80B7001C04E4 /* ADJBackoffStrategy.m */, - 9DAA08A91D2A80B7001C04E4 /* ADJTrackingPixel.h */, - 9DAA08AA1D2A80B7001C04E4 /* ADJTrackingPixel.m */, - 96ED74F91CD8085000C073B8 /* ADJSystemProfile.h */, - 96ED74FA1CD8085000C073B8 /* ADJSystemProfile.m */, - 9DA11A3B1C96D2A200980777 /* ADJAdditions */, - 9DA11A331C96D2A200980777 /* ADJActivityHandler.h */, - 9DA11A341C96D2A200980777 /* ADJActivityHandler.m */, - 9DA11A351C96D2A200980777 /* ADJActivityKind.h */, - 9DA11A361C96D2A200980777 /* ADJActivityKind.m */, - 9DA11A371C96D2A200980777 /* ADJActivityPackage.h */, - 9DA11A381C96D2A200980777 /* ADJActivityPackage.m */, - 9DA11A391C96D2A200980777 /* ADJActivityState.h */, - 9DA11A3A1C96D2A200980777 /* ADJActivityState.m */, - 9DA11A421C96D2A200980777 /* ADJAdjustFactory.h */, - 9DA11A431C96D2A200980777 /* ADJAdjustFactory.m */, - 9DA11A441C96D2A200980777 /* ADJAttribution.h */, - 9DA11A451C96D2A200980777 /* ADJAttribution.m */, - 9DA11A461C96D2A200980777 /* ADJAttributionHandler.h */, - 9DA11A471C96D2A200980777 /* ADJAttributionHandler.m */, - 9DA11A481C96D2A200980777 /* ADJConfig.h */, - 9DA11A491C96D2A200980777 /* ADJConfig.m */, - 9DA11A4A1C96D2A200980777 /* ADJDeviceInfo.h */, - 9DA11A4B1C96D2A200980777 /* ADJDeviceInfo.m */, - 9DA11A4C1C96D2A200980777 /* ADJEvent.h */, - 9DA11A4D1C96D2A200980777 /* ADJEvent.m */, - 9DA11A4E1C96D2A200980777 /* ADJEventFailure.h */, - 9DA11A4F1C96D2A200980777 /* ADJEventFailure.m */, - 9DA11A501C96D2A200980777 /* ADJEventSuccess.h */, - 9DA11A511C96D2A200980777 /* ADJEventSuccess.m */, - 9DA11A521C96D2A200980777 /* ADJLogger.h */, - 9DA11A531C96D2A200980777 /* ADJLogger.m */, - 9DA11A541C96D2A200980777 /* ADJPackageBuilder.h */, - 9DA11A551C96D2A200980777 /* ADJPackageBuilder.m */, - 9DA11A561C96D2A200980777 /* ADJPackageHandler.h */, - 9DA11A571C96D2A200980777 /* ADJPackageHandler.m */, - 9DA11A581C96D2A200980777 /* ADJRequestHandler.h */, - 9DA11A591C96D2A200980777 /* ADJRequestHandler.m */, - 9DA11A5A1C96D2A200980777 /* ADJResponseData.h */, - 9DA11A5B1C96D2A200980777 /* ADJResponseData.m */, - 9DA11A5C1C96D2A200980777 /* ADJSessionFailure.h */, - 9DA11A5D1C96D2A200980777 /* ADJSessionFailure.m */, - 9DA11A5E1C96D2A200980777 /* ADJSessionSuccess.h */, - 9DA11A5F1C96D2A200980777 /* ADJSessionSuccess.m */, - 9DA11A601C96D2A200980777 /* ADJTimerCycle.h */, - 9DA11A611C96D2A200980777 /* ADJTimerCycle.m */, - 9DA11A621C96D2A200980777 /* ADJTimerOnce.h */, - 9DA11A631C96D2A200980777 /* ADJTimerOnce.m */, - 9DA11A641C96D2A200980777 /* Adjust.h */, - 9DA11A651C96D2A200980777 /* Adjust.m */, - 9DA11A661C96D2A200980777 /* ADJUtil.h */, - 9DA11A671C96D2A200980777 /* ADJUtil.m */, - 9DA11A681C96D2A200980777 /* Info.plist */, + 9DF9C8D11D6F3CA5008E362F /* ADJAdditions */, + 9DF9C8C91D6F3CA5008E362F /* ADJActivityHandler.h */, + 9DF9C8CA1D6F3CA5008E362F /* ADJActivityHandler.m */, + 9DF9C8CB1D6F3CA5008E362F /* ADJActivityKind.h */, + 9DF9C8CC1D6F3CA5008E362F /* ADJActivityKind.m */, + 9DF9C8CD1D6F3CA5008E362F /* ADJActivityPackage.h */, + 9DF9C8CE1D6F3CA5008E362F /* ADJActivityPackage.m */, + 9DF9C8CF1D6F3CA5008E362F /* ADJActivityState.h */, + 9DF9C8D01D6F3CA5008E362F /* ADJActivityState.m */, + 9DF9C8D81D6F3CA5008E362F /* ADJAdjustFactory.h */, + 9DF9C8D91D6F3CA5008E362F /* ADJAdjustFactory.m */, + 9DF9C8DA1D6F3CA5008E362F /* ADJAttribution.h */, + 9DF9C8DB1D6F3CA5008E362F /* ADJAttribution.m */, + 9DF9C8DC1D6F3CA5008E362F /* ADJAttributionHandler.h */, + 9DF9C8DD1D6F3CA5008E362F /* ADJAttributionHandler.m */, + 9DF9C8DE1D6F3CA5008E362F /* ADJBackoffStrategy.h */, + 9DF9C8DF1D6F3CA5008E362F /* ADJBackoffStrategy.m */, + 9DF9C8E01D6F3CA5008E362F /* ADJConfig.h */, + 9DF9C8E11D6F3CA5008E362F /* ADJConfig.m */, + 9DF9C8E21D6F3CA5008E362F /* ADJDeviceInfo.h */, + 9DF9C8E31D6F3CA5008E362F /* ADJDeviceInfo.m */, + 9DF9C8E41D6F3CA5008E362F /* ADJEvent.h */, + 9DF9C8E51D6F3CA5008E362F /* ADJEvent.m */, + 9DF9C8E61D6F3CA5008E362F /* ADJEventFailure.h */, + 9DF9C8E71D6F3CA5008E362F /* ADJEventFailure.m */, + 9DF9C8E81D6F3CA5008E362F /* ADJEventSuccess.h */, + 9DF9C8E91D6F3CA5008E362F /* ADJEventSuccess.m */, + 9DF9C8EA1D6F3CA5008E362F /* ADJKeychain.h */, + 9DF9C8EB1D6F3CA5008E362F /* ADJKeychain.m */, + 9DF9C8EC1D6F3CA5008E362F /* ADJLogger.h */, + 9DF9C8ED1D6F3CA5008E362F /* ADJLogger.m */, + 9DF9C8EE1D6F3CA5008E362F /* ADJPackageBuilder.h */, + 9DF9C8EF1D6F3CA5008E362F /* ADJPackageBuilder.m */, + 9DF9C8F01D6F3CA5008E362F /* ADJPackageHandler.h */, + 9DF9C8F11D6F3CA5008E362F /* ADJPackageHandler.m */, + 9DF9C8F21D6F3CA5008E362F /* ADJRequestHandler.h */, + 9DF9C8F31D6F3CA5008E362F /* ADJRequestHandler.m */, + 9DF9C8F41D6F3CA5008E362F /* ADJResponseData.h */, + 9DF9C8F51D6F3CA5008E362F /* ADJResponseData.m */, + 9DF9C8F61D6F3CA5008E362F /* ADJSdkClickHandler.h */, + 9DF9C8F71D6F3CA5008E362F /* ADJSdkClickHandler.m */, + 9DF9C8F81D6F3CA5008E362F /* ADJSessionFailure.h */, + 9DF9C8F91D6F3CA5008E362F /* ADJSessionFailure.m */, + 9DF9C8FA1D6F3CA5008E362F /* ADJSessionSuccess.h */, + 9DF9C8FB1D6F3CA5008E362F /* ADJSessionSuccess.m */, + 9DF9C8FC1D6F3CA5008E362F /* ADJSystemProfile.h */, + 9DF9C8FD1D6F3CA5008E362F /* ADJSystemProfile.m */, + 9DF9C8FE1D6F3CA5008E362F /* ADJTimerCycle.h */, + 9DF9C8FF1D6F3CA5008E362F /* ADJTimerCycle.m */, + 9DF9C9001D6F3CA5008E362F /* ADJTimerOnce.h */, + 9DF9C9011D6F3CA5008E362F /* ADJTimerOnce.m */, + 9DF9C9021D6F3CA5008E362F /* ADJTrackingPixel.h */, + 9DF9C9031D6F3CA5008E362F /* ADJTrackingPixel.m */, + 9DF9C9041D6F3CA5008E362F /* Adjust.h */, + 9DF9C9051D6F3CA5008E362F /* Adjust.m */, + 9DF9C9061D6F3CA5008E362F /* ADJUtil.h */, + 9DF9C9071D6F3CA5008E362F /* ADJUtil.m */, + 96B671121D788F4A0090A023 /* ADJSessionParameters.h */, + 96B671131D788F4A0090A023 /* ADJSessionParameters.m */, + 9DF9C9081D6F3CA5008E362F /* Info.plist */, ); path = Adjust; sourceTree = SOURCE_ROOT; }; - 9DA11A3B1C96D2A200980777 /* ADJAdditions */ = { + 9DF9C8D11D6F3CA5008E362F /* ADJAdditions */ = { isa = PBXGroup; children = ( - 9DA11A3C1C96D2A200980777 /* NSData+ADJAdditions.h */, - 9DA11A3D1C96D2A200980777 /* NSData+ADJAdditions.m */, - 9DA11A3E1C96D2A200980777 /* NSString+ADJAdditions.h */, - 9DA11A3F1C96D2A200980777 /* NSString+ADJAdditions.m */, - 9DA11A401C96D2A200980777 /* UIDevice+ADJAdditions.h */, - 9DA11A411C96D2A200980777 /* UIDevice+ADJAdditions.m */, + 9DF9C8D21D6F3CA5008E362F /* NSData+ADJAdditions.h */, + 9DF9C8D31D6F3CA5008E362F /* NSData+ADJAdditions.m */, + 9DF9C8D41D6F3CA5008E362F /* NSString+ADJAdditions.h */, + 9DF9C8D51D6F3CA5008E362F /* NSString+ADJAdditions.m */, + 9DF9C8D61D6F3CA5008E362F /* UIDevice+ADJAdditions.h */, + 9DF9C8D71D6F3CA5008E362F /* UIDevice+ADJAdditions.m */, ); path = ADJAdditions; sourceTree = ""; }; - 9DF7A9D81CB4ECBC00D3591F /* Products */ = { + 9DFA37AE1C0F219400782607 /* AdjustSdk */ = { isa = PBXGroup; children = ( - 9DF7A9DD1CB4ECBC00D3591F /* AdjustExample-Swift.app */, + 9DFA37B51C0F21D600782607 /* AdjustSdk.h */, + 9DF9C8C81D6F3CA5008E362F /* Adjust */, + 9DFA37B61C0F21D600782607 /* Info.plist */, ); - name = Products; + path = AdjustSdk; sourceTree = ""; }; - 9DF7AC561CB4FEE200D3591F /* Products */ = { + 9DFB06111D747070006D48FC /* AdjustSdkTv */ = { isa = PBXGroup; children = ( - 9DF7AC5C1CB4FEE200D3591F /* AdjustExample-iWatch.app */, - 9DF7AC5E1CB4FEE200D3591F /* AdjustExample-iWatch WatchKit App.app */, - 9DF7AC601CB4FEE200D3591F /* AdjustExample-iWatch WatchKit Extension.appex */, + 9DFB06121D747070006D48FC /* AdjustSdkTv.h */, + 9DFB06191D7470C0006D48FC /* Adjust */, + 9DFB06141D747070006D48FC /* Info.plist */, ); - name = Products; + path = AdjustSdkTv; sourceTree = ""; }; - 9DFA37AE1C0F219400782607 /* AdjustSdk */ = { + 9DFB06191D7470C0006D48FC /* Adjust */ = { isa = PBXGroup; children = ( - 9DFA37B51C0F21D600782607 /* AdjustSdk.h */, - 9DFA37B61C0F21D600782607 /* Info.plist */, - 9DA11A321C96D2A200980777 /* Adjust */, + 9DFB06221D7470C0006D48FC /* ADJAdditions */, + 9DFB061A1D7470C0006D48FC /* ADJActivityHandler.h */, + 9DFB061B1D7470C0006D48FC /* ADJActivityHandler.m */, + 9DFB061C1D7470C0006D48FC /* ADJActivityKind.h */, + 9DFB061D1D7470C0006D48FC /* ADJActivityKind.m */, + 9DFB061E1D7470C0006D48FC /* ADJActivityPackage.h */, + 9DFB061F1D7470C0006D48FC /* ADJActivityPackage.m */, + 9DFB06201D7470C0006D48FC /* ADJActivityState.h */, + 9DFB06211D7470C0006D48FC /* ADJActivityState.m */, + 9DFB06291D7470C0006D48FC /* ADJAdjustFactory.h */, + 9DFB062A1D7470C0006D48FC /* ADJAdjustFactory.m */, + 9DFB062B1D7470C0006D48FC /* ADJAttribution.h */, + 9DFB062C1D7470C0006D48FC /* ADJAttribution.m */, + 9DFB062D1D7470C0006D48FC /* ADJAttributionHandler.h */, + 9DFB062E1D7470C0006D48FC /* ADJAttributionHandler.m */, + 9DFB062F1D7470C0006D48FC /* ADJBackoffStrategy.h */, + 9DFB06301D7470C0006D48FC /* ADJBackoffStrategy.m */, + 9DFB06311D7470C0006D48FC /* ADJConfig.h */, + 9DFB06321D7470C0006D48FC /* ADJConfig.m */, + 9DFB06331D7470C0006D48FC /* ADJDeviceInfo.h */, + 9DFB06341D7470C0006D48FC /* ADJDeviceInfo.m */, + 9DFB06351D7470C0006D48FC /* ADJEvent.h */, + 9DFB06361D7470C0006D48FC /* ADJEvent.m */, + 9DFB06371D7470C0006D48FC /* ADJEventFailure.h */, + 9DFB06381D7470C0006D48FC /* ADJEventFailure.m */, + 9DFB06391D7470C0006D48FC /* ADJEventSuccess.h */, + 9DFB063A1D7470C0006D48FC /* ADJEventSuccess.m */, + 9DFB063B1D7470C0006D48FC /* ADJKeychain.h */, + 9DFB063C1D7470C0006D48FC /* ADJKeychain.m */, + 9DFB063D1D7470C0006D48FC /* ADJLogger.h */, + 9DFB063E1D7470C0006D48FC /* ADJLogger.m */, + 9DFB063F1D7470C0006D48FC /* ADJPackageBuilder.h */, + 9DFB06401D7470C0006D48FC /* ADJPackageBuilder.m */, + 9DFB06411D7470C0006D48FC /* ADJPackageHandler.h */, + 9DFB06421D7470C0006D48FC /* ADJPackageHandler.m */, + 9DFB06431D7470C0006D48FC /* ADJRequestHandler.h */, + 9DFB06441D7470C0006D48FC /* ADJRequestHandler.m */, + 9DFB06451D7470C0006D48FC /* ADJResponseData.h */, + 9DFB06461D7470C0006D48FC /* ADJResponseData.m */, + 9DFB06471D7470C0006D48FC /* ADJSdkClickHandler.h */, + 9DFB06481D7470C0006D48FC /* ADJSdkClickHandler.m */, + 9DFB06491D7470C0006D48FC /* ADJSessionFailure.h */, + 9DFB064A1D7470C0006D48FC /* ADJSessionFailure.m */, + 9DFB064B1D7470C0006D48FC /* ADJSessionSuccess.h */, + 9DFB064C1D7470C0006D48FC /* ADJSessionSuccess.m */, + 9DFB064D1D7470C0006D48FC /* ADJSystemProfile.h */, + 9DFB064E1D7470C0006D48FC /* ADJSystemProfile.m */, + 9DFB064F1D7470C0006D48FC /* ADJTimerCycle.h */, + 9DFB06501D7470C0006D48FC /* ADJTimerCycle.m */, + 9DFB06511D7470C0006D48FC /* ADJTimerOnce.h */, + 9DFB06521D7470C0006D48FC /* ADJTimerOnce.m */, + 9DFB06531D7470C0006D48FC /* ADJTrackingPixel.h */, + 9DFB06541D7470C0006D48FC /* ADJTrackingPixel.m */, + 9DFB06551D7470C0006D48FC /* Adjust.h */, + 9DFB06561D7470C0006D48FC /* Adjust.m */, + 9DFB06571D7470C0006D48FC /* ADJUtil.h */, + 9DFB06581D7470C0006D48FC /* ADJUtil.m */, + 96B671161D788F7A0090A023 /* ADJSessionParameters.h */, + 96B671171D788F7A0090A023 /* ADJSessionParameters.m */, + 9DFB06591D7470C0006D48FC /* Info.plist */, ); - path = AdjustSdk; + path = Adjust; + sourceTree = SOURCE_ROOT; + }; + 9DFB06221D7470C0006D48FC /* ADJAdditions */ = { + isa = PBXGroup; + children = ( + 9DFB06231D7470C0006D48FC /* NSData+ADJAdditions.h */, + 9DFB06241D7470C0006D48FC /* NSData+ADJAdditions.m */, + 9DFB06251D7470C0006D48FC /* NSString+ADJAdditions.h */, + 9DFB06261D7470C0006D48FC /* NSString+ADJAdditions.m */, + 9DFB06271D7470C0006D48FC /* UIDevice+ADJAdditions.h */, + 9DFB06281D7470C0006D48FC /* UIDevice+ADJAdditions.m */, + ); + path = ADJAdditions; sourceTree = ""; }; /* End PBXGroup section */ @@ -864,35 +1039,37 @@ buildActionMask = 2147483647; files = ( 96BCFBCD1AC99231005A65C5 /* Adjust.h in Headers */, - 96BCFBD21AC99332005A65C5 /* NSString+ADJAdditions.h in Headers */, 96BCFBCE1AC99235005A65C5 /* ADJEvent.h in Headers */, 96BCFBD01AC9923F005A65C5 /* ADJConfig.h in Headers */, 9D363AC31BDA50FA00B47FE9 /* ADJLogger.h in Headers */, 96BCFBD11AC99246005A65C5 /* ADJAttribution.h in Headers */, 9601CAE81C74BAAE00670879 /* ADJEventFailure.h in Headers */, 9601CAE41C74B70600670879 /* ADJEventSuccess.h in Headers */, + 96BCFBD41AC99338005A65C5 /* NSData+ADJAdditions.h in Headers */, 968173871C3C2D36002AE1DE /* ADJSessionFailure.h in Headers */, 968173831C3C2D07002AE1DE /* ADJSessionSuccess.h in Headers */, - 96BCFBD91AC9934E005A65C5 /* ADJAdjustFactory.h in Headers */, - 96BCFBD81AC9934B005A65C5 /* ADJActivityState.h in Headers */, - 965B7F301CC78F6600098639 /* ADJBackoffStrategy.h in Headers */, + 96BCFBD21AC99332005A65C5 /* NSString+ADJAdditions.h in Headers */, + 96BCFBD31AC99336005A65C5 /* UIDevice+ADJAdditions.h in Headers */, + 96BCFBD51AC9933E005A65C5 /* ADJActivityHandler.h in Headers */, 96BCFBD61AC99345005A65C5 /* ADJActivityKind.h in Headers */, 96BCFBD71AC99348005A65C5 /* ADJActivityPackage.h in Headers */, - 96BCFBD51AC9933E005A65C5 /* ADJActivityHandler.h in Headers */, - 96854A5F1B1F278C002B2874 /* ADJTimerCycle.h in Headers */, - 96854A591B1F2779002B2874 /* ADJTimerOnce.h in Headers */, - 96BCFBDF1AC99368005A65C5 /* ADJDeviceInfo.h in Headers */, - 96BCFBDB1AC99355005A65C5 /* ADJPackageHandler.h in Headers */, - 96164D8C1CCA4DEA009431AB /* ADJSystemProfile.h in Headers */, + 96BCFBD81AC9934B005A65C5 /* ADJActivityState.h in Headers */, + 96BCFBD91AC9934E005A65C5 /* ADJAdjustFactory.h in Headers */, 96BCFBDA1AC99353005A65C5 /* ADJPackageBuilder.h in Headers */, + 96BCFBDB1AC99355005A65C5 /* ADJPackageHandler.h in Headers */, + 96BCFBDC1AC99360005A65C5 /* ADJRequestHandler.h in Headers */, + 96BCFBDE1AC99365005A65C5 /* ADJUtil.h in Headers */, + 96BCFBDF1AC99368005A65C5 /* ADJDeviceInfo.h in Headers */, 96BCFBE01AC9936C005A65C5 /* ADJAttributionHandler.h in Headers */, - 96BCFBD31AC99336005A65C5 /* UIDevice+ADJAdditions.h in Headers */, - 96BCFBD41AC99338005A65C5 /* NSData+ADJAdditions.h in Headers */, + 96854A591B1F2779002B2874 /* ADJTimerOnce.h in Headers */, + 96854A5F1B1F278C002B2874 /* ADJTimerCycle.h in Headers */, + 96FCC53A1C186426007BBFE1 /* ADJResponseData.h in Headers */, + 96164D8C1CCA4DEA009431AB /* ADJSystemProfile.h in Headers */, + 965B7F301CC78F6600098639 /* ADJBackoffStrategy.h in Headers */, 96164D721CC8FA73009431AB /* ADJSdkClickHandler.h in Headers */, 9DAA089F1D2A7B15001C04E4 /* ADJTrackingPixel.h in Headers */, - 96BCFBDE1AC99365005A65C5 /* ADJUtil.h in Headers */, - 96BCFBDC1AC99360005A65C5 /* ADJRequestHandler.h in Headers */, - 96FCC53A1C186426007BBFE1 /* ADJResponseData.h in Headers */, + 9DF9C8B31D6ED228008E362F /* ADJKeychain.h in Headers */, + 96B671101D788EEC0090A023 /* ADJSessionParameters.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -901,36 +1078,78 @@ buildActionMask = 2147483647; files = ( 9DFA37B71C0F21D600782607 /* AdjustSdk.h in Headers */, - 9DA11A991C96D2A300980777 /* Adjust.h in Headers */, - 9DA11A811C96D2A200980777 /* ADJEvent.h in Headers */, - 9DA11A7D1C96D2A200980777 /* ADJConfig.h in Headers */, - 9DA11A871C96D2A200980777 /* ADJLogger.h in Headers */, - 9DA11A791C96D2A200980777 /* ADJAttribution.h in Headers */, - 9DA11A831C96D2A200980777 /* ADJEventFailure.h in Headers */, - 96ED74FB1CD8085000C073B8 /* ADJSystemProfile.h in Headers */, - 9DA11A851C96D2A200980777 /* ADJEventSuccess.h in Headers */, - 9DA11A911C96D2A300980777 /* ADJSessionFailure.h in Headers */, - 9DA11A931C96D2A300980777 /* ADJSessionSuccess.h in Headers */, - 9DAA08AD1D2A80B7001C04E4 /* ADJTrackingPixel.h in Headers */, + 9DF9C9431D6F3CA5008E362F /* Adjust.h in Headers */, + 9DF9C9231D6F3CA5008E362F /* ADJEvent.h in Headers */, + 9DF9C91F1D6F3CA5008E362F /* ADJConfig.h in Headers */, + 9DF9C92B1D6F3CA5008E362F /* ADJLogger.h in Headers */, + 9DF9C9191D6F3CA5008E362F /* ADJAttribution.h in Headers */, + 9DF9C9251D6F3CA5008E362F /* ADJEventFailure.h in Headers */, + 9DF9C9271D6F3CA5008E362F /* ADJEventSuccess.h in Headers */, + 9DF9C9371D6F3CA5008E362F /* ADJSessionFailure.h in Headers */, + 9DF9C9391D6F3CA5008E362F /* ADJSessionSuccess.h in Headers */, + 9DF9C9111D6F3CA5008E362F /* NSData+ADJAdditions.h in Headers */, + 9DF9C9131D6F3CA5008E362F /* NSString+ADJAdditions.h in Headers */, + 9DF9C9151D6F3CA5008E362F /* UIDevice+ADJAdditions.h in Headers */, + 9DF9C9091D6F3CA5008E362F /* ADJActivityHandler.h in Headers */, + 9DF9C90B1D6F3CA5008E362F /* ADJActivityKind.h in Headers */, + 9DF9C90D1D6F3CA5008E362F /* ADJActivityPackage.h in Headers */, + 9DF9C90F1D6F3CA5008E362F /* ADJActivityState.h in Headers */, + 9DF9C9171D6F3CA5008E362F /* ADJAdjustFactory.h in Headers */, + 9DF9C92D1D6F3CA5008E362F /* ADJPackageBuilder.h in Headers */, + 9DF9C92F1D6F3CA5008E362F /* ADJPackageHandler.h in Headers */, + 9DF9C9311D6F3CA5008E362F /* ADJRequestHandler.h in Headers */, + 9DF9C9451D6F3CA5008E362F /* ADJUtil.h in Headers */, + 9DF9C9211D6F3CA5008E362F /* ADJDeviceInfo.h in Headers */, + 9DF9C91B1D6F3CA5008E362F /* ADJAttributionHandler.h in Headers */, + 9DF9C93F1D6F3CA5008E362F /* ADJTimerOnce.h in Headers */, + 9DF9C93D1D6F3CA5008E362F /* ADJTimerCycle.h in Headers */, + 9DF9C9331D6F3CA5008E362F /* ADJResponseData.h in Headers */, + 9DF9C93B1D6F3CA5008E362F /* ADJSystemProfile.h in Headers */, 96164D861CCA4D27009431AB /* ADJBackoffStrategy.h in Headers */, 96164D841CCA4D10009431AB /* ADJSdkClickHandler.h in Headers */, - 9DA11A7F1C96D2A200980777 /* ADJDeviceInfo.h in Headers */, - 9DA11A6F1C96D2A200980777 /* ADJActivityState.h in Headers */, - 9DA11A771C96D2A200980777 /* ADJAdjustFactory.h in Headers */, - 9DA11A9B1C96D2A300980777 /* ADJUtil.h in Headers */, - 9DA11A891C96D2A200980777 /* ADJPackageBuilder.h in Headers */, - 9DA11A8D1C96D2A300980777 /* ADJRequestHandler.h in Headers */, - 9DA11A711C96D2A200980777 /* NSData+ADJAdditions.h in Headers */, - 9DA11A691C96D2A200980777 /* ADJActivityHandler.h in Headers */, - 9DA11A731C96D2A200980777 /* NSString+ADJAdditions.h in Headers */, - 9DA11A751C96D2A200980777 /* UIDevice+ADJAdditions.h in Headers */, - 9DA11A6B1C96D2A200980777 /* ADJActivityKind.h in Headers */, - 9DA11A8F1C96D2A300980777 /* ADJResponseData.h in Headers */, - 9DA11A971C96D2A300980777 /* ADJTimerOnce.h in Headers */, - 9DA11A6D1C96D2A200980777 /* ADJActivityPackage.h in Headers */, - 9DA11A8B1C96D2A200980777 /* ADJPackageHandler.h in Headers */, - 9DA11A951C96D2A300980777 /* ADJTimerCycle.h in Headers */, - 9DA11A7B1C96D2A200980777 /* ADJAttributionHandler.h in Headers */, + 9DF9C9411D6F3CA5008E362F /* ADJTrackingPixel.h in Headers */, + 9DF9C9291D6F3CA5008E362F /* ADJKeychain.h in Headers */, + 96B671141D788F4A0090A023 /* ADJSessionParameters.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9DFB060D1D747070006D48FC /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DFB06131D747070006D48FC /* AdjustSdkTv.h in Headers */, + 9DFB06941D7470C0006D48FC /* Adjust.h in Headers */, + 9DFB06741D7470C0006D48FC /* ADJEvent.h in Headers */, + 9DFB06701D7470C0006D48FC /* ADJConfig.h in Headers */, + 9DFB067C1D7470C0006D48FC /* ADJLogger.h in Headers */, + 9DFB066A1D7470C0006D48FC /* ADJAttribution.h in Headers */, + 9DFB06761D7470C0006D48FC /* ADJEventFailure.h in Headers */, + 9DFB06781D7470C0006D48FC /* ADJEventSuccess.h in Headers */, + 9DFB06881D7470C0006D48FC /* ADJSessionFailure.h in Headers */, + 9DFB068A1D7470C0006D48FC /* ADJSessionSuccess.h in Headers */, + 9DFB06621D7470C0006D48FC /* NSData+ADJAdditions.h in Headers */, + 9DFB06641D7470C0006D48FC /* NSString+ADJAdditions.h in Headers */, + 9DFB06661D7470C0006D48FC /* UIDevice+ADJAdditions.h in Headers */, + 9DFB065A1D7470C0006D48FC /* ADJActivityHandler.h in Headers */, + 9DFB065C1D7470C0006D48FC /* ADJActivityKind.h in Headers */, + 9DFB065E1D7470C0006D48FC /* ADJActivityPackage.h in Headers */, + 9DFB06601D7470C0006D48FC /* ADJActivityState.h in Headers */, + 9DFB06681D7470C0006D48FC /* ADJAdjustFactory.h in Headers */, + 9DFB067E1D7470C0006D48FC /* ADJPackageBuilder.h in Headers */, + 9DFB06801D7470C0006D48FC /* ADJPackageHandler.h in Headers */, + 9DFB06821D7470C0006D48FC /* ADJRequestHandler.h in Headers */, + 9DFB06961D7470C0006D48FC /* ADJUtil.h in Headers */, + 9DFB06721D7470C0006D48FC /* ADJDeviceInfo.h in Headers */, + 9DFB066C1D7470C0006D48FC /* ADJAttributionHandler.h in Headers */, + 9DFB06901D7470C0006D48FC /* ADJTimerOnce.h in Headers */, + 9DFB068E1D7470C0006D48FC /* ADJTimerCycle.h in Headers */, + 9DFB06841D7470C0006D48FC /* ADJResponseData.h in Headers */, + 9DFB068C1D7470C0006D48FC /* ADJSystemProfile.h in Headers */, + 9DFB066E1D7470C0006D48FC /* ADJBackoffStrategy.h in Headers */, + 9DFB06861D7470C0006D48FC /* ADJSdkClickHandler.h in Headers */, + 9DFB06921D7470C0006D48FC /* ADJTrackingPixel.h in Headers */, + 9DFB067A1D7470C0006D48FC /* ADJKeychain.h in Headers */, + 96B671181D788F7A0090A023 /* ADJSessionParameters.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1010,13 +1229,32 @@ productReference = 9DFA37AD1C0F219400782607 /* AdjustSdk.framework */; productType = "com.apple.product-type.framework"; }; + 9DFB060F1D747070006D48FC /* AdjustSdkTv */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9DFB06151D747070006D48FC /* Build configuration list for PBXNativeTarget "AdjustSdkTv" */; + buildPhases = ( + 9DFB060B1D747070006D48FC /* Sources */, + 9DFB060C1D747070006D48FC /* Frameworks */, + 9DFB060D1D747070006D48FC /* Headers */, + 9DFB060E1D747070006D48FC /* Resources */, + 9DFB06991D747BBE006D48FC /* Copy tvOS Framework */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AdjustSdkTv; + productName = AdjustSdkTv; + productReference = 9DFB06101D747070006D48FC /* AdjustSdkTv.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 9679920518BBAE2800394606 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "adjust GmbH"; TargetAttributes = { 9615158E1CD2CB2C0022D336 = { @@ -1028,6 +1266,9 @@ 9DFA37AC1C0F219400782607 = { CreatedOnToolsVersion = 7.1.1; }; + 9DFB060F1D747070006D48FC = { + CreatedOnToolsVersion = 7.3.1; + }; }; }; buildConfigurationList = 9679920818BBAE2800394606 /* Build configuration list for PBXProject "Adjust" */; @@ -1040,91 +1281,18 @@ mainGroup = 9679920418BBAE2800394606; productRefGroup = 9679920E18BBAE2800394606 /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 963909631BCBFE5200A2E8A4 /* Products */; - ProjectRef = 963909621BCBFE5200A2E8A4 /* AdjustExample-iOS.xcodeproj */; - }, - { - ProductGroup = 9DF7AC561CB4FEE200D3591F /* Products */; - ProjectRef = 9DF7AC551CB4FEE200D3591F /* AdjustExample-iWatch.xcodeproj */; - }, - { - ProductGroup = 9DF7A9D81CB4ECBC00D3591F /* Products */; - ProjectRef = 9DF7A9D71CB4ECBC00D3591F /* AdjustExample-Swift.xcodeproj */; - }, - { - ProductGroup = 963909CA1BCC0D8300A2E8A4 /* Products */; - ProjectRef = 963909C91BCC0D8300A2E8A4 /* AdjustExample-tvOS.xcodeproj */; - }, - { - ProductGroup = 9D1082BF1CFDAF990050568B /* Products */; - ProjectRef = 9D1082BE1CFDAF990050568B /* AdjustExample-WebView.xcodeproj */; - }, - ); projectRoot = ""; targets = ( 9679920C18BBAE2800394606 /* Adjust */, - 9679921C18BBAE2800394606 /* AdjustTests */, - 96BCFBE71AC99FBD005A65C5 /* AdjustStatic */, 9DFA37AC1C0F219400782607 /* AdjustSdk */, + 9DFB060F1D747070006D48FC /* AdjustSdkTv */, + 96BCFBE71AC99FBD005A65C5 /* AdjustStatic */, 9615158E1CD2CB2C0022D336 /* AdjustBridge */, + 9679921C18BBAE2800394606 /* AdjustTests */, ); }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 963909671BCBFE5300A2E8A4 /* AdjustExample-iOS.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = "AdjustExample-iOS.app"; - remoteRef = 963909661BCBFE5300A2E8A4 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 963909CE1BCC0D8400A2E8A4 /* AdjustExample-tvOS.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = "AdjustExample-tvOS.app"; - remoteRef = 963909CD1BCC0D8400A2E8A4 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 9D1082C31CFDAF990050568B /* AdjustExample-WebView.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = "AdjustExample-WebView.app"; - remoteRef = 9D1082C21CFDAF990050568B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 9DF7A9DD1CB4ECBC00D3591F /* AdjustExample-Swift.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = "AdjustExample-Swift.app"; - remoteRef = 9DF7A9DC1CB4ECBC00D3591F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 9DF7AC5C1CB4FEE200D3591F /* AdjustExample-iWatch.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = "AdjustExample-iWatch.app"; - remoteRef = 9DF7AC5B1CB4FEE200D3591F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 9DF7AC5E1CB4FEE200D3591F /* AdjustExample-iWatch WatchKit App.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = "AdjustExample-iWatch WatchKit App.app"; - remoteRef = 9DF7AC5D1CB4FEE200D3591F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 9DF7AC601CB4FEE200D3591F /* AdjustExample-iWatch WatchKit Extension.appex */ = { - isa = PBXReferenceProxy; - fileType = "wrapper.app-extension"; - path = "AdjustExample-iWatch WatchKit Extension.appex"; - remoteRef = 9DF7AC5F1CB4FEE200D3591F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ 9679921B18BBAE2800394606 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -1138,7 +1306,15 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9DA11A9D1C96D2A300980777 /* Info.plist in Resources */, + 9DF9C9471D6F3CA5008E362F /* Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9DFB060E1D747070006D48FC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DFB06981D7470C0006D48FC /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1187,6 +1363,20 @@ shellPath = /bin/sh; shellScript = "set -e\n\n# If we're already inside this script then die\nif [ -n \"$RW_MULTIPLATFORM_BUILD_IN_PROGRESS\" ]; then\nexit 0\nfi\nexport RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1\n\nRW_FRAMEWORK_NAME=${PROJECT_NAME}\nRW_INPUT_STATIC_LIB=\"lib${PROJECT_NAME}.a\"\nRW_FRAMEWORK_LOCATION=\"${BUILT_PRODUCTS_DIR}/Static/${RW_FRAMEWORK_NAME}Sdk.framework\"\n\nfunction build_static_library {\n echo \"1\"\n echo \"${BUILD_DIR}\"\n # Will rebuild the static library as specified\n # build_static_library sdk\n xcrun xcodebuild -project \"${PROJECT_FILE_PATH}\" \\\n -target \"${TARGET_NAME}\" \\\n -configuration \"${CONFIGURATION}\" \\\n -sdk \"${1}\" \\\n ONLY_ACTIVE_ARCH=NO \\\n BUILD_DIR=\"${BUILD_DIR}\" \\\n OBJROOT=\"${OBJROOT}\" \\\n BUILD_ROOT=\"${BUILD_ROOT}\" \\\n SYMROOT=\"${SYMROOT}\" $ACTION\n}\n\nfunction make_fat_library {\n # Will smash 2 static libs together\n # make_fat_library in1 in2 out\n xcrun lipo -create \"${1}\" \"${2}\" -output \"${3}\"\n}\n\n# 1 - Extract the platform (iphoneos/iphonesimulator) from the SDK name\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]; then\nRW_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\necho \"Could not find platform name from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 2 - Extract the version from the SDK\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]; then\nRW_SDK_VERSION=${BASH_REMATCH[1]}\nelse\necho \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\n# 3 - Determine the other platform\nif [ \"$RW_SDK_PLATFORM\" == \"iphoneos\" ]; then\nRW_OTHER_PLATFORM=iphonesimulator\nelse\nRW_OTHER_PLATFORM=iphoneos\nfi\n\n# 4 - Find the build directory\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$RW_SDK_PLATFORM$ ]]; then\nRW_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${RW_OTHER_PLATFORM}\"\nelse\necho \"Could not find other platform build directory.\"\nexit 1\nfi\n\n# Build the other platform.\nbuild_static_library \"${RW_OTHER_PLATFORM}${RW_SDK_VERSION}\"\n\n# If we're currently building for iphonesimulator, then need to rebuild\n# to ensure that we get both i386 and x86_64\nif [ \"$RW_SDK_PLATFORM\" == \"iphonesimulator\" ]; then\nbuild_static_library \"${SDK_NAME}\"\nfi\n\n# Join the 2 static libs into 1 and push into the .framework\nmake_fat_library \"${BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/${RW_INPUT_STATIC_LIB}\" \\\n\"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}Sdk\"\n\n# Ensure that the framework is present in both platform's build directories\ncp -a \"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}Sdk\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/Static/${RW_FRAMEWORK_NAME}Sdk.framework/Versions/A/${RW_FRAMEWORK_NAME}Sdk\"\n\n# Copy the framework to the project directory\nditto \"${RW_FRAMEWORK_LOCATION}\" \"${SRCROOT}/Frameworks/Static/${RW_FRAMEWORK_NAME}Sdk.framework\""; }; + 9DFB06991D747BBE006D48FC /* Copy tvOS Framework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy tvOS Framework"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\n# If we're already inside this script then die\nif [ -n \"$RW_MULTIPLATFORM_BUILD_IN_PROGRESS\" ]; then\nexit 0\nfi\nexport RW_MULTIPLATFORM_BUILD_IN_PROGRESS=1\n\nRW_FRAMEWORK_NAME=${PROJECT_NAME}\nRW_FRAMEWORK_LOCATION=\"${BUILT_PRODUCTS_DIR}/${RW_FRAMEWORK_NAME}SdkTv.framework\"\n\n# Copy the framework to the tvOS framework directory\n# ditto \"${RW_FRAMEWORK_LOCATION}\" \"${SRCROOT}/Frameworks/tvOS/${RW_FRAMEWORK_NAME}SdkTv.framework\""; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1196,10 +1386,10 @@ files = ( 961515A71CD2CBB00022D336 /* AdjustBridge.m in Sources */, 968595EE1D0B25970011CA2B /* AdjustBridgeRegister.m in Sources */, - 961515A61CD2CBAC0022D336 /* WKWebViewJavascriptBridge.m in Sources */, - 961515A51CD2CBA80022D336 /* WebViewJavascriptBridgeBase.m in Sources */, 961515A31CD2CB9D0022D336 /* WebViewJavascriptBridge.m in Sources */, 961515A41CD2CBA20022D336 /* WebViewJavascriptBridge_JS.m in Sources */, + 961515A61CD2CBAC0022D336 /* WKWebViewJavascriptBridge.m in Sources */, + 961515A51CD2CBA80022D336 /* WebViewJavascriptBridgeBase.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1207,36 +1397,38 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 96164D731CC8FA73009431AB /* ADJSdkClickHandler.m in Sources */, - 96854A601B1F278C002B2874 /* ADJTimerCycle.m in Sources */, + 96C93DF51AC47F2E00B53F56 /* NSData+ADJAdditions.m in Sources */, 96C0EFE01A3EF47A00B39F31 /* NSString+ADJAdditions.m in Sources */, - 96164D8D1CCA4DEA009431AB /* ADJSystemProfile.m in Sources */, 96C0EFE11A3EF47A00B39F31 /* UIDevice+ADJAdditions.m in Sources */, 96E5E38118BBB48A008E7B30 /* Adjust.m in Sources */, 96E5E38B18BBB48A008E7B30 /* ADJActivityHandler.m in Sources */, - 96E5E39618BBB48A008E7B30 /* ADJRequestHandler.m in Sources */, - 96FCC53B1C186426007BBFE1 /* ADJResponseData.m in Sources */, - 96E5E39918BBB48A008E7B30 /* ADJUtil.m in Sources */, 96E5E38C18BBB48A008E7B30 /* ADJActivityKind.m in Sources */, - 965B7F311CC78F6600098639 /* ADJBackoffStrategy.m in Sources */, - 96C93DF51AC47F2E00B53F56 /* NSData+ADJAdditions.m in Sources */, 96E5E38D18BBB48A008E7B30 /* ADJActivityPackage.m in Sources */, - 968173881C3C2D36002AE1DE /* ADJSessionFailure.m in Sources */, - 965307F61A000DA400107FF9 /* ADJDeviceInfo.m in Sources */, - 969952D21A01309200928462 /* ADJAttribution.m in Sources */, - 969952CF1A012F5300928462 /* ADJAttributionHandler.m in Sources */, - 9601CAE51C74B70600670879 /* ADJEventSuccess.m in Sources */, 96E5E38E18BBB48A008E7B30 /* ADJActivityState.m in Sources */, - 9609BC6A19EEA55800E02303 /* ADJEvent.m in Sources */, - 9DAA08A01D2A7B15001C04E4 /* ADJTrackingPixel.m in Sources */, - 96E5E39518BBB48A008E7B30 /* ADJPackageHandler.m in Sources */, - 96854A5A1B1F2779002B2874 /* ADJTimerOnce.m in Sources */, - 968173841C3C2D07002AE1DE /* ADJSessionSuccess.m in Sources */, + 96E5E39218BBB48A008E7B30 /* ADJAdjustFactory.m in Sources */, 96E5E39318BBB48A008E7B30 /* ADJLogger.m in Sources */, + 96E5E39518BBB48A008E7B30 /* ADJPackageHandler.m in Sources */, 96E5E39418BBB48A008E7B30 /* ADJPackageBuilder.m in Sources */, + 96E5E39618BBB48A008E7B30 /* ADJRequestHandler.m in Sources */, + 96E5E39918BBB48A008E7B30 /* ADJUtil.m in Sources */, + 9609BC6A19EEA55800E02303 /* ADJEvent.m in Sources */, + 965307F61A000DA400107FF9 /* ADJDeviceInfo.m in Sources */, + 969952CF1A012F5300928462 /* ADJAttributionHandler.m in Sources */, + 969952D21A01309200928462 /* ADJAttribution.m in Sources */, 960A8BB91A029A8000F2BB95 /* ADJConfig.m in Sources */, - 96E5E39218BBB48A008E7B30 /* ADJAdjustFactory.m in Sources */, + 96854A5A1B1F2779002B2874 /* ADJTimerOnce.m in Sources */, + 96854A601B1F278C002B2874 /* ADJTimerCycle.m in Sources */, + 96FCC53B1C186426007BBFE1 /* ADJResponseData.m in Sources */, + 968173841C3C2D07002AE1DE /* ADJSessionSuccess.m in Sources */, + 968173881C3C2D36002AE1DE /* ADJSessionFailure.m in Sources */, + 9601CAE51C74B70600670879 /* ADJEventSuccess.m in Sources */, 9601CAE91C74BAAE00670879 /* ADJEventFailure.m in Sources */, + 96164D8D1CCA4DEA009431AB /* ADJSystemProfile.m in Sources */, + 965B7F311CC78F6600098639 /* ADJBackoffStrategy.m in Sources */, + 96164D731CC8FA73009431AB /* ADJSdkClickHandler.m in Sources */, + 9DAA08A01D2A7B15001C04E4 /* ADJTrackingPixel.m in Sources */, + 9DF9C8B41D6ED228008E362F /* ADJKeychain.m in Sources */, + 96B671111D788EEC0090A023 /* ADJSessionParameters.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1247,14 +1439,17 @@ 9657BF6F1A3B029000CD6853 /* ADJAttributionHandlerTests.m in Sources */, 96E5E3B118BBB49E008E7B30 /* ADJLoggerMock.m in Sources */, 96E5E3AF18BBB49E008E7B30 /* ADJActivityHandlerMock.m in Sources */, + 96FC6E4F1D256B81004482D8 /* ADJActivityHandlerConstructorState.m in Sources */, 96E5E3B318BBB49E008E7B30 /* ADJPackageHandlerTests.m in Sources */, 9620EA451B062D6F009673F1 /* ADJTestActivityPackage.m in Sources */, 96E768A11CE6267D005D811C /* ADJDeeplinkDelegate.m in Sources */, 96E5E3B618BBB49E008E7B30 /* ADJTestsUtil.m in Sources */, 96CD2BE11A13BFC600A40AFB /* UIDevice+ADJAdditions.m in Sources */, 96FDD75E1C566C38009C402E /* NSURLSession+NSURLDataWithRequestMocking.m in Sources */, + 9D0C7D3F1D79B3FE009DDF4E /* ADJInitState.m in Sources */, 9620EA511B065177009673F1 /* ADJPackageFields.m in Sources */, 967D069A1CE2272500ECFCE3 /* ADJSessionState.m in Sources */, + 96FC6E581D258272004482D8 /* ADJEndSessionState.m in Sources */, 9620EA4E1B06401B009673F1 /* ADJTest.m in Sources */, 96A2D2381CEF3B2D00C39DE0 /* ADJRequestHandlerTests.m in Sources */, 96E5E3B018BBB49E008E7B30 /* ADJActivityHandlerTests.m in Sources */, @@ -1275,36 +1470,77 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 96164D891CCA4D48009431AB /* ADJBackoffStrategy.m in Sources */, - 96164D871CCA4D36009431AB /* ADJSdkClickHandler.m in Sources */, - 9DA11A7E1C96D2A200980777 /* ADJConfig.m in Sources */, - 96ED74FC1CD8085000C073B8 /* ADJSystemProfile.m in Sources */, - 9DA11A9C1C96D2A300980777 /* ADJUtil.m in Sources */, - 9DA11A7C1C96D2A200980777 /* ADJAttributionHandler.m in Sources */, - 9DA11A961C96D2A300980777 /* ADJTimerCycle.m in Sources */, - 9DA11A921C96D2A300980777 /* ADJSessionFailure.m in Sources */, - 9DA11A6C1C96D2A200980777 /* ADJActivityKind.m in Sources */, - 9DA11A8E1C96D2A300980777 /* ADJRequestHandler.m in Sources */, - 9DA11A6E1C96D2A200980777 /* ADJActivityPackage.m in Sources */, - 9DA11A8A1C96D2A200980777 /* ADJPackageBuilder.m in Sources */, - 9DA11A7A1C96D2A200980777 /* ADJAttribution.m in Sources */, - 9DA11A881C96D2A200980777 /* ADJLogger.m in Sources */, - 9DA11A861C96D2A200980777 /* ADJEventSuccess.m in Sources */, - 9DA11A701C96D2A200980777 /* ADJActivityState.m in Sources */, - 9DA11A761C96D2A200980777 /* UIDevice+ADJAdditions.m in Sources */, - 9DA11A741C96D2A200980777 /* NSString+ADJAdditions.m in Sources */, - 9DA11A8C1C96D2A300980777 /* ADJPackageHandler.m in Sources */, - 9DA11A941C96D2A300980777 /* ADJSessionSuccess.m in Sources */, - 9DA11A821C96D2A200980777 /* ADJEvent.m in Sources */, - 9DA11A841C96D2A200980777 /* ADJEventFailure.m in Sources */, - 9DA11A721C96D2A200980777 /* NSData+ADJAdditions.m in Sources */, - 9DA11A9A1C96D2A300980777 /* Adjust.m in Sources */, - 9DAA08AE1D2A80B7001C04E4 /* ADJTrackingPixel.m in Sources */, - 9DA11A901C96D2A300980777 /* ADJResponseData.m in Sources */, - 9DA11A801C96D2A200980777 /* ADJDeviceInfo.m in Sources */, - 9DA11A6A1C96D2A200980777 /* ADJActivityHandler.m in Sources */, - 9DA11A981C96D2A300980777 /* ADJTimerOnce.m in Sources */, - 9DA11A781C96D2A200980777 /* ADJAdjustFactory.m in Sources */, + 9DF9C9121D6F3CA5008E362F /* NSData+ADJAdditions.m in Sources */, + 9DF9C9141D6F3CA5008E362F /* NSString+ADJAdditions.m in Sources */, + 9DF9C9161D6F3CA5008E362F /* UIDevice+ADJAdditions.m in Sources */, + 9DF9C9441D6F3CA5008E362F /* Adjust.m in Sources */, + 9DF9C90A1D6F3CA5008E362F /* ADJActivityHandler.m in Sources */, + 9DF9C90C1D6F3CA5008E362F /* ADJActivityKind.m in Sources */, + 9DF9C90E1D6F3CA5008E362F /* ADJActivityPackage.m in Sources */, + 9DF9C9101D6F3CA5008E362F /* ADJActivityState.m in Sources */, + 9DF9C9181D6F3CA5008E362F /* ADJAdjustFactory.m in Sources */, + 9DF9C92C1D6F3CA5008E362F /* ADJLogger.m in Sources */, + 9DF9C92E1D6F3CA5008E362F /* ADJPackageBuilder.m in Sources */, + 9DF9C9301D6F3CA5008E362F /* ADJPackageHandler.m in Sources */, + 9DF9C9321D6F3CA5008E362F /* ADJRequestHandler.m in Sources */, + 9DF9C9461D6F3CA5008E362F /* ADJUtil.m in Sources */, + 9DF9C9241D6F3CA5008E362F /* ADJEvent.m in Sources */, + 9DF9C9221D6F3CA5008E362F /* ADJDeviceInfo.m in Sources */, + 9DF9C91C1D6F3CA5008E362F /* ADJAttributionHandler.m in Sources */, + 9DF9C91A1D6F3CA5008E362F /* ADJAttribution.m in Sources */, + 9DF9C9201D6F3CA5008E362F /* ADJConfig.m in Sources */, + 9DF9C9401D6F3CA5008E362F /* ADJTimerOnce.m in Sources */, + 9DF9C93E1D6F3CA5008E362F /* ADJTimerCycle.m in Sources */, + 9DF9C9341D6F3CA5008E362F /* ADJResponseData.m in Sources */, + 9DF9C93A1D6F3CA5008E362F /* ADJSessionSuccess.m in Sources */, + 9DF9C9381D6F3CA5008E362F /* ADJSessionFailure.m in Sources */, + 9DF9C9281D6F3CA5008E362F /* ADJEventSuccess.m in Sources */, + 9DF9C9261D6F3CA5008E362F /* ADJEventFailure.m in Sources */, + 9DF9C93C1D6F3CA5008E362F /* ADJSystemProfile.m in Sources */, + 9DB457B01D743704004D69E8 /* ADJBackoffStrategy.m in Sources */, + 9DB457B11D743704004D69E8 /* ADJSdkClickHandler.m in Sources */, + 9DF9C9421D6F3CA5008E362F /* ADJTrackingPixel.m in Sources */, + 9DF9C92A1D6F3CA5008E362F /* ADJKeychain.m in Sources */, + 96B671151D788F4A0090A023 /* ADJSessionParameters.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9DFB060B1D747070006D48FC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9DFB06631D7470C0006D48FC /* NSData+ADJAdditions.m in Sources */, + 9DFB06651D7470C0006D48FC /* NSString+ADJAdditions.m in Sources */, + 9DFB06671D7470C0006D48FC /* UIDevice+ADJAdditions.m in Sources */, + 9DFB06951D7470C0006D48FC /* Adjust.m in Sources */, + 9DFB065B1D7470C0006D48FC /* ADJActivityHandler.m in Sources */, + 9DFB065D1D7470C0006D48FC /* ADJActivityKind.m in Sources */, + 9DFB065F1D7470C0006D48FC /* ADJActivityPackage.m in Sources */, + 9DFB06611D7470C0006D48FC /* ADJActivityState.m in Sources */, + 9DFB06691D7470C0006D48FC /* ADJAdjustFactory.m in Sources */, + 9DFB067D1D7470C0006D48FC /* ADJLogger.m in Sources */, + 9DFB067F1D7470C0006D48FC /* ADJPackageBuilder.m in Sources */, + 9DFB06811D7470C0006D48FC /* ADJPackageHandler.m in Sources */, + 9DFB06831D7470C0006D48FC /* ADJRequestHandler.m in Sources */, + 9DFB06971D7470C0006D48FC /* ADJUtil.m in Sources */, + 9DFB06751D7470C0006D48FC /* ADJEvent.m in Sources */, + 9DFB06731D7470C0006D48FC /* ADJDeviceInfo.m in Sources */, + 9DFB066D1D7470C0006D48FC /* ADJAttributionHandler.m in Sources */, + 9DFB066B1D7470C0006D48FC /* ADJAttribution.m in Sources */, + 9DFB06711D7470C0006D48FC /* ADJConfig.m in Sources */, + 9DFB06911D7470C0006D48FC /* ADJTimerOnce.m in Sources */, + 9DFB068F1D7470C0006D48FC /* ADJTimerCycle.m in Sources */, + 9DFB06851D7470C0006D48FC /* ADJResponseData.m in Sources */, + 9DFB068B1D7470C0006D48FC /* ADJSessionSuccess.m in Sources */, + 9DFB06891D7470C0006D48FC /* ADJSessionFailure.m in Sources */, + 9DFB06791D7470C0006D48FC /* ADJEventSuccess.m in Sources */, + 9DFB06771D7470C0006D48FC /* ADJEventFailure.m in Sources */, + 9DFB068D1D7470C0006D48FC /* ADJSystemProfile.m in Sources */, + 9DFB066F1D7470C0006D48FC /* ADJBackoffStrategy.m in Sources */, + 9DFB06871D7470C0006D48FC /* ADJSdkClickHandler.m in Sources */, + 9DFB06931D7470C0006D48FC /* ADJTrackingPixel.m in Sources */, + 9DFB067B1D7470C0006D48FC /* ADJKeychain.m in Sources */, + 96B671191D788F7A0090A023 /* ADJSessionParameters.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1347,6 +1583,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1456,6 +1693,7 @@ ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AdjustTests/Adjust-Prefix.pch"; + ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; @@ -1499,6 +1737,7 @@ "$(inherited)", ); INFOPLIST_FILE = "AdjustTests/AdjustTests-Info.plist"; + ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "adjust.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1526,7 +1765,7 @@ 96BCFBE91AC99FBD005A65C5 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -1558,7 +1797,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.adjust.AdjustSdk; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -1597,6 +1836,68 @@ }; name = Release; }; + 9DFB06161D747070006D48FC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = AdjustSdkTv/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.AdjustSdkTv; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.2; + VALID_ARCHS = "arm64 x86_64"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 9DFB06171D747070006D48FC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = AdjustSdkTv/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.AdjustSdkTv; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.2; + VALID_ARCHS = "arm64 x86_64"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1654,6 +1955,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 9DFB06151D747070006D48FC /* Build configuration list for PBXNativeTarget "AdjustSdkTv" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9DFB06161D747070006D48FC /* Debug */, + 9DFB06171D747070006D48FC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 9679920518BBAE2800394606 /* Project object */; diff --git a/Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme b/Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme index 62b0091a0..7e21cddd1 100644 --- a/Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme +++ b/Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme @@ -1,6 +1,6 @@ -- (id)initWithConfig:(ADJConfig *)adjustConfig; +- (id)initWithConfig:(ADJConfig *)adjustConfig +sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray; - (void)applicationDidBecomeActive; - (void)applicationWillResignActive; @@ -48,20 +53,46 @@ - (void)setAttribution:(ADJAttribution*)attribution; - (void)setAskingAttribution:(BOOL)askingAttribution; -- (BOOL)updateAttribution:(ADJAttribution *)attribution; +- (BOOL)updateAttributionI:(id)selfI attribution:(ADJAttribution *)attribution; - (void)setIadDate:(NSDate*)iAdImpressionDate withPurchaseDate:(NSDate*)appPurchaseDate; - (void)setIadDetails:(NSDictionary *)attributionDetails error:(NSError *)error retriesLeft:(int)retriesLeft; -- (void) setOfflineMode:(BOOL)offline; +- (void)setOfflineMode:(BOOL)offline; - (ADJInternalState*) internalState; - +- (void)sendFirstPackages; + +- (void)addSessionCallbackParameter:(NSString *)key + value:(NSString *)value; +- (void)addSessionPartnerParameter:(NSString *)key + value:(NSString *)value; +- (void)removeSessionCallbackParameter:(NSString *)key; +- (void)removeSessionPartnerParameter:(NSString *)key; +- (void)resetSessionCallbackParameters; +- (void)resetSessionPartnerParameters; + +- (void)teardown:(BOOL)deleteState; @end @interface ADJActivityHandler : NSObject -+ (id)handlerWithConfig:(ADJConfig *)adjustConfig; ++ (id)handlerWithConfig:(ADJConfig *)adjustConfig + sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray; - (ADJAttribution*) attribution; +- (void)addSessionCallbackParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key + value:(NSString *)value; + +- (void)addSessionPartnerParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key + value:(NSString *)value; +- (void)removeSessionCallbackParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key; +- (void)removeSessionPartnerParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key; +- (void)resetSessionCallbackParametersI:(ADJActivityHandler *)selfI; +- (void)resetSessionPartnerParametersI:(ADJActivityHandler *)selfI; + @end diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index 35c7182a6..06d6a96e9 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -20,13 +20,19 @@ #import "ADJAttributionHandler.h" #import "NSString+ADJAdditions.h" #import "ADJSdkClickHandler.h" +#import "ADJSessionParameters.h" + +typedef void (^activityHandlerBlockI)(ADJActivityHandler * activityHandler); static NSString * const kActivityStateFilename = @"AdjustIoActivityState"; static NSString * const kAttributionFilename = @"AdjustIoAttribution"; +static NSString * const kSessionCallbackParametersFilename = @"AdjustSessionCallbackParameters"; +static NSString * const kSessionPartnerParametersFilename = @"AdjustSessionPartnerParameters"; static NSString * const kAdjustPrefix = @"adjust_"; static const char * const kInternalQueueName = "io.adjust.ActivityQueue"; static NSString * const kForegroundTimerName = @"Foreground timer"; static NSString * const kBackgroundTimerName = @"Background timer"; +static NSString * const kDelayStartTimerName = @"Delay Start timer"; static NSTimeInterval kForegroundTimerInterval; static NSTimeInterval kForegroundTimerStart; @@ -53,25 +59,32 @@ - (BOOL)isOffline { return self.offline; } - (BOOL)isOnline { return !self.offline; } - (BOOL)isBackground { return self.background; } - (BOOL)isForeground { return !self.background; } +- (BOOL)isDelayStart { return self.delayStart; } +- (BOOL)isToStartNow { return !self.delayStart; } +- (BOOL)isToUpdatePackages { return self.updatePackages; } @end #pragma mark - @interface ADJActivityHandler() -@property (nonatomic) dispatch_queue_t internalQueue; -@property (nonatomic, retain) id packageHandler; -@property (nonatomic, retain) id attributionHandler; -@property (nonatomic, retain) id sdkClickHandler; -@property (nonatomic, retain) ADJActivityState *activityState; -@property (nonatomic, retain) ADJTimerCycle *foregroundTimer; -@property (nonatomic, retain) ADJTimerOnce *backgroundTimer; -@property (nonatomic, retain) id logger; +@property (nonatomic, strong) dispatch_queue_t internalQueue; +@property (nonatomic, strong) id packageHandler; +@property (nonatomic, strong) id attributionHandler; +@property (nonatomic, strong) id sdkClickHandler; +@property (nonatomic, strong) ADJActivityState *activityState; +@property (nonatomic, strong) ADJTimerCycle *foregroundTimer; +@property (nonatomic, strong) ADJTimerOnce *backgroundTimer; +@property (nonatomic, strong) ADJInternalState *internalState; +@property (nonatomic, strong) ADJDeviceInfo *deviceInfo; +@property (nonatomic, strong) ADJTimerOnce *delayStartTimer; +@property (nonatomic, strong) ADJSessionParameters *sessionParameters; +// weak for object that Activity Handler does not "own" +@property (nonatomic, weak) id logger; @property (nonatomic, weak) NSObject *adjustDelegate; +// copy for objects shared with the user @property (nonatomic, copy) ADJAttribution *attribution; @property (nonatomic, copy) ADJConfig *adjustConfig; -@property (nonatomic, retain) ADJInternalState *internalState; -@property (nonatomic, copy) ADJDeviceInfo* deviceInfo; @end @@ -84,11 +97,16 @@ typedef NS_ENUM(NSInteger, AdjADClientError) { #pragma mark - @implementation ADJActivityHandler -+ (id)handlerWithConfig:(ADJConfig *)adjustConfig { - return [[ADJActivityHandler alloc] initWithConfig:adjustConfig]; ++ (id)handlerWithConfig:(ADJConfig *)adjustConfig + sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray +{ + return [[ADJActivityHandler alloc] initWithConfig:adjustConfig + sessionParametersActionsArray:sessionParametersActionsArray]; } -- (id)initWithConfig:(ADJConfig *)adjustConfig { +- (id)initWithConfig:(ADJConfig *)adjustConfig +sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray +{ self = [super init]; if (self == nil) return nil; @@ -107,11 +125,8 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig { // init logger to be available everywhere self.logger = ADJAdjustFactory.logger; - if ([self.adjustConfig.environment isEqualToString:ADJEnvironmentProduction]) { - [self.logger setLogLevel:ADJLogLevelAssert]; - } else { - [self.logger setLogLevel:self.adjustConfig.logLevel]; - } + + [self.logger lockLogLevel]; // read files to have sync values available [self readAttribution]; @@ -130,11 +145,22 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig { self.internalState.offline = NO; // in the background by default self.internalState.background = YES; + // delay start not configured by default + self.internalState.delayStart = NO; + // does not need to update packages by default + if (self.activityState == nil) { + self.internalState.updatePackages = NO; + } else { + self.internalState.updatePackages = self.activityState.updatePackages; + } self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); - dispatch_async(self.internalQueue, ^{ - [self initInternal]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI initI:selfI + sessionParametersActionsArray:sessionParametersActionsArray]; + }]; [self addNotificationObserver]; @@ -144,35 +170,47 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig { - (void)applicationDidBecomeActive { self.internalState.background = NO; - dispatch_async(self.internalQueue, ^{ - [self stopBackgroundTimer]; + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI delayStartI:selfI]; + + [selfI stopBackgroundTimerI:selfI]; - [self startForegroundTimer]; + [selfI startForegroundTimerI:selfI]; - [self.logger verbose:@"Subsession start"]; + [selfI.logger verbose:@"Subsession start"]; - [self startInternal]; - }); + [selfI startI:selfI]; + }]; } - (void)applicationWillResignActive { self.internalState.background = YES; - dispatch_async(self.internalQueue, ^{ - [self stopForegroundTimer]; + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI stopForegroundTimerI:selfI]; - [self startBackgroundTimer]; + [selfI startBackgroundTimerI:selfI]; - [self.logger verbose:@"Subsession end"]; + [selfI.logger verbose:@"Subsession end"]; - [self endInternal]; - }); + [selfI endI:selfI]; + }]; } - (void)trackEvent:(ADJEvent *)event { - dispatch_async(self.internalQueue, ^{ - [self eventInternal:event]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + // track event called before app started + if (selfI.activityState == nil) { + [selfI startI:selfI]; + } + [selfI eventI:selfI event:event]; + }]; } - (void)finishedTracking:(ADJResponseData *)responseData { @@ -190,21 +228,27 @@ - (void)finishedTracking:(ADJResponseData *)responseData { } - (void)launchEventResponseTasks:(ADJEventResponseData *)eventResponseData { - dispatch_async(self.internalQueue, ^{ - [self launchEventResponseTasksInternal:eventResponseData]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI launchEventResponseTasksI:selfI eventResponseData:eventResponseData]; + }]; } - (void)launchSessionResponseTasks:(ADJSessionResponseData *)sessionResponseData { - dispatch_async(self.internalQueue, ^{ - [self launchSessionResponseTasksInternal:sessionResponseData]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI launchSessionResponseTasksI:selfI sessionResponseData:sessionResponseData]; + }]; } - (void)launchAttributionResponseTasks:(ADJAttributionResponseData *)attributionResponseData { - dispatch_async(self.internalQueue, ^{ - [self launchAttributionResponseTasksInternal:attributionResponseData]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI launchAttributionResponseTasksI:selfI attributionResponseData:attributionResponseData]; + }]; } - (void)setEnabled:(BOOL)enabled { @@ -222,20 +266,21 @@ - (void)setEnabled:(BOOL)enabled { if (self.activityState == nil) { [self updateState:!enabled - pausingMessage:@"Package handler and attribution handler will start as paused due to the SDK being disabled" - remainsPausedMessage:@"Package and attribution handler will still start as paused due to the SDK being offline" - unPausingMessage:@"Package handler and attribution handler will start as active due to the SDK being enabled"]; + pausingMessage:@"Handlers will start as paused due to the SDK being disabled" + remainsPausedMessage:@"Handlers will still start as paused" + unPausingMessage:@"Handlers will start as active due to the SDK being enabled"]; return; } // save new enabled state in activity state - self.activityState.enabled = enabled; - [self writeActivityState]; + [self writeActivityStateS:self changesInStateBlock:^{ + self.activityState.enabled = enabled; + }]; [self updateState:!enabled - pausingMessage:@"Pausing package handler and attribution handler due to SDK being disabled" - remainsPausedMessage:@"Package and attribution handler remain paused due to SDK being offline" - unPausingMessage:@"Resuming package handler and attribution handler due to SDK being enabled"]; + pausingMessage:@"Pausing handlers due to SDK being disabled" + remainsPausedMessage:@"Handlers remain paused" + unPausingMessage:@"Resuming handlers due to SDK being enabled"]; } - (void)setOfflineMode:(BOOL)offline { @@ -253,24 +298,20 @@ - (void)setOfflineMode:(BOOL)offline { if (self.activityState == nil) { [self updateState:offline - pausingMessage:@"Package handler and attribution handler will start paused due to SDK being offline" - remainsPausedMessage:@"Package and attribution handler will still start as paused due to SDK being disabled" - unPausingMessage:@"Package handler and attribution handler will start as active due to SDK being online"]; + pausingMessage:@"Handlers will start paused due to SDK being offline" + remainsPausedMessage:@"Handlers will still start as paused" + unPausingMessage:@"Handlers will start as active due to SDK being online"]; return; } [self updateState:offline - pausingMessage:@"Pausing package and attribution handler to put SDK offline mode" - remainsPausedMessage:@"Package and attribution handler remain paused due to SDK being disabled" - unPausingMessage:@"Resuming package handler and attribution handler to put SDK in online mode"]; + pausingMessage:@"Pausing handlers to put SDK offline mode" + remainsPausedMessage:@"Handlers remain paused" + unPausingMessage:@"Resuming handlers to put SDK in online mode"]; } - (BOOL)isEnabled { - if (self.activityState != nil) { - return self.activityState.enabled; - } else { - return [self.internalState isEnabled]; - } + return [self isEnabledI:self]; } - (BOOL)hasChangedState:(BOOL)previousState @@ -299,31 +340,38 @@ - (void)updateState:(BOOL)pausingState // it is changing from an active state to a pause state if (pausingState) { [self.logger info:pausingMessage]; - [self updateHandlersStatusAndSend]; - return; } - - // it is remaining in a pause state - if ([self paused]) { - [self.logger info:remainsPausedMessage]; - return; + // check if it's remaining in a pause state + else if ([self pausedI:self sdkClickHandlerOnly:NO]) { + // including the sdk click handler + if ([self pausedI:self sdkClickHandlerOnly:YES]) { + [self.logger info:remainsPausedMessage]; + } else { + // or except it + [self.logger info:[remainsPausedMessage stringByAppendingString:@", except the Sdk Click Handler"]]; + } + } else { + // it is changing from a pause state to an active state + [self.logger info:unPausingMessage]; } - // it is changing from a pause state to an active state - [self.logger info:unPausingMessage]; [self updateHandlersStatusAndSend]; } - (void)appWillOpenUrl:(NSURL*)url { - dispatch_async(self.internalQueue, ^{ - [self appWillOpenUrlInternal:url]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI appWillOpenUrlI:selfI url:url]; + }]; } - (void)setDeviceToken:(NSData *)deviceToken { - dispatch_async(self.internalQueue, ^{ - [self setDeviceTokenInternal:deviceToken]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI setDeviceTokenI:selfI deviceToken:deviceToken]; + }]; } - (void)setIadDate:(NSDate *)iAdImpressionDate withPurchaseDate:(NSDate *)appPurchaseDate { @@ -387,31 +435,139 @@ - (void)setIadDetails:(NSDictionary *)attributionDetails [self.sdkClickHandler sendSdkClick:clickPackage]; } + - (void)setAskingAttribution:(BOOL)askingAttribution { - self.activityState.askingAttribution = askingAttribution; - [self writeActivityState]; + [self writeActivityStateS:self changesInStateBlock:^{ + self.activityState.askingAttribution = askingAttribution; + }]; } - (void)updateHandlersStatusAndSend { - dispatch_async(self.internalQueue, ^{ - [self updateHandlersStatusAndSendInternal]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI updateHandlersStatusAndSendI:selfI]; + }]; } - (void)foregroundTimerFired { - dispatch_async(self.internalQueue, ^{ - [self foregroundTimerFiredInternal]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI foregroundTimerFiredI:selfI]; + }]; } - (void)backgroundTimerFired { - dispatch_async(self.internalQueue, ^{ - [self backgroundTimerFiredInternal]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI backgroundTimerFiredI:selfI]; + }]; +} + +- (void)sendFirstPackages { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI sendFirstPackagesI:selfI]; + }]; +} + +- (void)addSessionCallbackParameter:(NSString *)key + value:(NSString *)value { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI addSessionCallbackParameterI:selfI key:key value:value]; + }]; +} + +- (void)addSessionPartnerParameter:(NSString *)key + value:(NSString *)value { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI addSessionPartnerParameterI:selfI key:key value:value]; + }]; +} + +- (void)removeSessionCallbackParameter:(NSString *)key { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI removeSessionCallbackParameterI:selfI key:key]; + }]; +} + +- (void)removeSessionPartnerParameter:(NSString *)key { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI removeSessionPartnerParameterI:selfI key:key]; + }]; +} + +- (void)resetSessionCallbackParameters { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI resetSessionCallbackParametersI:selfI]; + }]; +} + +- (void)resetSessionPartnerParameters { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI resetSessionPartnerParametersI:selfI]; + }]; +} + +- (void)teardown:(BOOL)deleteState +{ + [ADJAdjustFactory.logger verbose:@"ADJActivityHandler teardown"]; + [self removeNotificationObserver]; + if (self.backgroundTimer != nil) { + [self.backgroundTimer cancel]; + } + if (self.foregroundTimer != nil) { + [self.foregroundTimer cancel]; + } + if (self.delayStartTimer != nil) { + [self.delayStartTimer cancel]; + } + if (self.attributionHandler != nil) { + [self.attributionHandler teardown]; + } + if (self.packageHandler != nil) { + [self.packageHandler teardown:deleteState]; + } + if (self.sdkClickHandler != nil) { + [self.sdkClickHandler teardown]; + } + [self teardownActivityStateS:deleteState]; + [self teardownAttributionS:deleteState]; + [self teardownAllSessionParametersS:deleteState]; + + self.internalQueue = nil; + self.packageHandler = nil; + self.attributionHandler = nil; + self.sdkClickHandler = nil; + self.foregroundTimer = nil; + self.backgroundTimer = nil; + self.adjustDelegate = nil; + self.adjustConfig = nil; + self.internalState = nil; + self.deviceInfo = nil; + self.delayStartTimer = nil; + self.logger = nil; } #pragma mark - internal -- (void)initInternal { +- (void)initI:(ADJActivityHandler *)selfI +sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray +{ // get session values kSessionInterval = ADJAdjustFactory.sessionInterval; kSubSessionInterval = ADJAdjustFactory.subsessionInterval; @@ -420,303 +576,346 @@ - (void)initInternal { kForegroundTimerInterval = ADJAdjustFactory.timerInterval; kBackgroundTimerInterval = ADJAdjustFactory.timerInterval; - self.deviceInfo = [ADJDeviceInfo deviceInfoWithSdkPrefix:self.adjustConfig.sdkPrefix]; + selfI.deviceInfo = [ADJDeviceInfo deviceInfoWithSdkPrefix:selfI.adjustConfig.sdkPrefix]; + + // read files that are accessed only in Internal sections + selfI.sessionParameters = [[ADJSessionParameters alloc] init]; + [selfI readSessionCallbackParametersI:selfI]; + [selfI readSessionPartnerParametersI:selfI]; - if (self.adjustConfig.eventBufferingEnabled) { - [self.logger info:@"Event buffering is enabled"]; + if (selfI.adjustConfig.eventBufferingEnabled) { + [selfI.logger info:@"Event buffering is enabled"]; } - if (self.adjustConfig.defaultTracker != nil) { - [self.logger info:@"Default tracker: '%@'", self.adjustConfig.defaultTracker]; + if (selfI.adjustConfig.defaultTracker != nil) { + [selfI.logger info:@"Default tracker: '%@'", selfI.adjustConfig.defaultTracker]; } - self.foregroundTimer = [ADJTimerCycle timerWithBlock:^{ [self foregroundTimerFired]; } - queue:self.internalQueue - startTime:kForegroundTimerStart - intervalTime:kForegroundTimerInterval - name:kForegroundTimerName]; + selfI.foregroundTimer = [ADJTimerCycle timerWithBlock:^{ + [selfI foregroundTimerFired]; + } + queue:selfI.internalQueue + startTime:kForegroundTimerStart + intervalTime:kForegroundTimerInterval + name:kForegroundTimerName + ]; + + if (selfI.adjustConfig.sendInBackground) { + [selfI.logger info:@"Send in background configured"]; + selfI.backgroundTimer = [ADJTimerOnce timerWithBlock:^{ [selfI backgroundTimerFired]; } + queue:selfI.internalQueue + name:kBackgroundTimerName]; + } + + if (selfI.activityState == nil && + selfI.adjustConfig.delayStart > 0) + { + [selfI.logger info:@"Delay start configured"]; + selfI.internalState.delayStart = YES; + selfI.delayStartTimer = [ADJTimerOnce timerWithBlock:^{ [selfI sendFirstPackages]; } + queue:selfI.internalQueue + name:kDelayStartTimerName]; + } - self.backgroundTimer = [ADJTimerOnce timerWithBlock:^{ [self backgroundTimerFired]; } - queue:self.internalQueue - name:kBackgroundTimerName]; + [ADJUtil updateUrlSessionConfiguration:selfI.adjustConfig]; - BOOL toSend = [self toSend]; - self.packageHandler = [ADJAdjustFactory packageHandlerForActivityHandler:self - startsSending:toSend]; + selfI.packageHandler = [ADJAdjustFactory packageHandlerForActivityHandler:selfI + startsSending:[selfI toSendI:selfI + sdkClickHandlerOnly:NO]]; + + // update session parameters in package queue + if ([selfI isToUpdatePackagesI:selfI]) { + [selfI updatePackagesI:selfI]; + } double now = [NSDate.date timeIntervalSince1970]; ADJPackageBuilder *attributionBuilder = [[ADJPackageBuilder alloc] - initWithDeviceInfo:self.deviceInfo - activityState:self.activityState - config:self.adjustConfig + initWithDeviceInfo:selfI.deviceInfo + activityState:selfI.activityState + config:selfI.adjustConfig createdAt:now]; ADJActivityPackage *attributionPackage = [attributionBuilder buildAttributionPackage]; - self.attributionHandler = [ADJAdjustFactory attributionHandlerForActivityHandler:self + selfI.attributionHandler = [ADJAdjustFactory attributionHandlerForActivityHandler:selfI withAttributionPackage:attributionPackage - startsSending:toSend - hasAttributionChangedDelegate:self.adjustConfig.hasAttributionChangedDelegate]; + startsSending:[selfI toSendI:selfI + sdkClickHandlerOnly:NO] + hasAttributionChangedDelegate:selfI.adjustConfig.hasAttributionChangedDelegate]; + + selfI.sdkClickHandler = [ADJAdjustFactory sdkClickHandlerWithStartsPaused:[selfI toSendI:selfI + sdkClickHandlerOnly:YES]]; - self.sdkClickHandler = [ADJAdjustFactory sdkClickHandlerWithStartsPaused:toSend]; + [[UIDevice currentDevice] adjSetIad:selfI triesV3Left:kTryIadV3]; - [[UIDevice currentDevice] adjSetIad:self triesV3Left:kTryIadV3]; + [selfI sessionParametersActionsI:selfI sessionParametersActionsArray:sessionParametersActionsArray]; - [self startInternal]; + [selfI startI:selfI]; } -- (void)startInternal { +- (void)startI:(ADJActivityHandler *)selfI { // it shouldn't start if it was disabled after a first session - if (self.activityState != nil - && !self.activityState.enabled) { + if (selfI.activityState != nil + && !selfI.activityState.enabled) { return; } - [self updateHandlersStatusAndSendInternal]; + [selfI updateHandlersStatusAndSendI:selfI]; - [self processSession]; + [selfI processSessionI:selfI]; - [self checkAttributionState]; + [selfI checkAttributionStateI:selfI]; } -- (void)processSession { +- (void)processSessionI:(ADJActivityHandler *)selfI { double now = [NSDate.date timeIntervalSince1970]; // very first session - if (self.activityState == nil) { - self.activityState = [[ADJActivityState alloc] init]; - self.activityState.sessionCount = 1; // this is the first session - - [self transferSessionPackage:now]; - [self.activityState resetSessionAttributes:now]; - self.activityState.enabled = [self.internalState isEnabled]; - [self writeActivityState]; + if (selfI.activityState == nil) { + selfI.activityState = [[ADJActivityState alloc] init]; + selfI.activityState.sessionCount = 1; // this is the first session + + [selfI transferSessionPackageI:selfI now:now]; + [selfI.activityState resetSessionAttributes:now]; + selfI.activityState.enabled = [selfI.internalState isEnabled]; + selfI.activityState.updatePackages = [selfI.internalState isToUpdatePackages]; + [selfI writeActivityStateI:selfI]; return; } - double lastInterval = now - self.activityState.lastActivity; + double lastInterval = now - selfI.activityState.lastActivity; if (lastInterval < 0) { - [self.logger error:@"Time travel!"]; - self.activityState.lastActivity = now; - [self writeActivityState]; + [selfI.logger error:@"Time travel!"]; + selfI.activityState.lastActivity = now; + [selfI writeActivityStateI:selfI]; return; } // new session if (lastInterval > kSessionInterval) { - self.activityState.sessionCount++; - self.activityState.lastInterval = lastInterval; + selfI.activityState.sessionCount++; + selfI.activityState.lastInterval = lastInterval; - [self transferSessionPackage:now]; - [self.activityState resetSessionAttributes:now]; - [self writeActivityState]; + [selfI transferSessionPackageI:selfI now:now]; + [selfI.activityState resetSessionAttributes:now]; + [selfI writeActivityStateI:selfI]; return; } // new subsession if (lastInterval > kSubSessionInterval) { - self.activityState.subsessionCount++; - self.activityState.sessionLength += lastInterval; - self.activityState.lastActivity = now; - [self.logger verbose:@"Started subsession %d of session %d", - self.activityState.subsessionCount, - self.activityState.sessionCount]; - [self writeActivityState]; + selfI.activityState.subsessionCount++; + selfI.activityState.sessionLength += lastInterval; + selfI.activityState.lastActivity = now; + [selfI.logger verbose:@"Started subsession %d of session %d", + selfI.activityState.subsessionCount, + selfI.activityState.sessionCount]; + [selfI writeActivityStateI:selfI]; return; } - [self.logger verbose:@"Time span since last activity too short for a new subsession"]; + [selfI.logger verbose:@"Time span since last activity too short for a new subsession"]; +} + +- (void)transferSessionPackageI:(ADJActivityHandler *)selfI + now:(double)now { + ADJPackageBuilder *sessionBuilder = [[ADJPackageBuilder alloc] + initWithDeviceInfo:selfI.deviceInfo + activityState:selfI.activityState + config:selfI.adjustConfig + createdAt:now]; + ADJActivityPackage *sessionPackage = [sessionBuilder buildSessionPackage:selfI.sessionParameters isInDelay:[selfI.internalState isDelayStart]]; + [selfI.packageHandler addPackage:sessionPackage]; + [selfI.packageHandler sendFirstPackage]; } -- (void)checkAttributionState { - if (![self checkActivityState]) return; +- (void)checkAttributionStateI:(ADJActivityHandler *)selfI { + if (![selfI checkActivityStateI:selfI]) return; // if it' a new session - if (self.activityState.subsessionCount <= 1) { + if (selfI.activityState.subsessionCount <= 1) { return; } // if there is already an attribution saved and there was no attribution being asked - if (self.attribution != nil && !self.activityState.askingAttribution) { + if (selfI.attribution != nil && !selfI.activityState.askingAttribution) { return; } - [self.attributionHandler getAttribution]; + [selfI.attributionHandler getAttribution]; } -- (void)endInternal { +- (void)endI:(ADJActivityHandler *)selfI { // pause sending if it's not allowed to send - if (![self toSend]) { - [self pauseSending]; + if (![selfI toSendI:selfI]) { + [selfI pauseSendingI:selfI]; } double now = [NSDate.date timeIntervalSince1970]; - if ([self updateActivityState:now]) { - [self writeActivityState]; + if ([selfI updateActivityStateI:selfI now:now]) { + [selfI writeActivityStateI:selfI]; } } -- (void)eventInternal:(ADJEvent *)event { - if (![self checkActivityState]) return; - if (![self isEnabled]) return; - if (![self checkEvent:event]) return; - if (![self checkTransactionId:event.transactionId]) return; +- (void)eventI:(ADJActivityHandler *)selfI + event:(ADJEvent *)event { + if (![selfI isEnabledI:selfI]) return; + if (![selfI checkEventI:selfI event:event]) return; + if (![selfI checkTransactionIdI:selfI transactionId:event.transactionId]) return; double now = [NSDate.date timeIntervalSince1970]; - self.activityState.eventCount++; - [self updateActivityState:now]; + selfI.activityState.eventCount++; + [selfI updateActivityStateI:selfI now:now]; // create and populate event package ADJPackageBuilder *eventBuilder = [[ADJPackageBuilder alloc] - initWithDeviceInfo:self.deviceInfo - activityState:self.activityState - config:self.adjustConfig + initWithDeviceInfo:selfI.deviceInfo + activityState:selfI.activityState + config:selfI.adjustConfig createdAt:now]; - ADJActivityPackage *eventPackage = [eventBuilder buildEventPackage:event]; - [self.packageHandler addPackage:eventPackage]; + ADJActivityPackage *eventPackage = [eventBuilder buildEventPackage:event sessionParameters:selfI.sessionParameters isInDelay:[selfI.internalState isDelayStart]]; + [selfI.packageHandler addPackage:eventPackage]; - if (self.adjustConfig.eventBufferingEnabled) { - [self.logger info:@"Buffered event %@", eventPackage.suffix]; + if (selfI.adjustConfig.eventBufferingEnabled) { + [selfI.logger info:@"Buffered event %@", eventPackage.suffix]; } else { - [self.packageHandler sendFirstPackage]; + [selfI.packageHandler sendFirstPackage]; } // if it is in the background and it can send, start the background timer - if (self.adjustConfig.sendInBackground && [self.internalState isBackground]) { - [self startBackgroundTimer]; + if (selfI.adjustConfig.sendInBackground && [selfI.internalState isBackground]) { + [selfI startBackgroundTimerI:selfI]; } - [self writeActivityState]; + [selfI writeActivityStateI:selfI]; } -- (void) launchEventResponseTasksInternal:(ADJEventResponseData *)eventResponseData { +- (void)launchEventResponseTasksI:(ADJActivityHandler *)selfI + eventResponseData:(ADJEventResponseData *)eventResponseData { // event success callback if (eventResponseData.success - && [self.adjustDelegate respondsToSelector:@selector(adjustEventTrackingSucceeded:)]) + && [selfI.adjustDelegate respondsToSelector:@selector(adjustEventTrackingSucceeded:)]) { - [self.logger debug:@"Launching success event tracking delegate"]; - [ADJUtil launchInMainThread:self.adjustDelegate + [selfI.logger debug:@"Launching success event tracking delegate"]; + [ADJUtil launchInMainThread:selfI.adjustDelegate selector:@selector(adjustEventTrackingSucceeded:) withObject:[eventResponseData successResponseData]]; return; } // event failure callback if (!eventResponseData.success - && [self.adjustDelegate respondsToSelector:@selector(adjustEventTrackingFailed:)]) + && [selfI.adjustDelegate respondsToSelector:@selector(adjustEventTrackingFailed:)]) { - [self.logger debug:@"Launching failed event tracking delegate"]; - [ADJUtil launchInMainThread:self.adjustDelegate + [selfI.logger debug:@"Launching failed event tracking delegate"]; + [ADJUtil launchInMainThread:selfI.adjustDelegate selector:@selector(adjustEventTrackingFailed:) withObject:[eventResponseData failureResponseData]]; return; } } -- (void) launchSessionResponseTasksInternal:(ADJSessionResponseData *)sessionResponseData { - BOOL toLaunchAttributionDelegate = [self updateAttribution:sessionResponseData.attribution]; +- (void)launchSessionResponseTasksI:(ADJActivityHandler *)selfI + sessionResponseData:(ADJSessionResponseData *)sessionResponseData { + BOOL toLaunchAttributionDelegate = [selfI updateAttributionI:selfI attribution:sessionResponseData.attribution]; // session success callback if (sessionResponseData.success - && [self.adjustDelegate respondsToSelector:@selector(adjustSessionTrackingSucceeded:)]) + && [selfI.adjustDelegate respondsToSelector:@selector(adjustSessionTrackingSucceeded:)]) { - [self.logger debug:@"Launching success session tracking delegate"]; - [ADJUtil launchInMainThread:self.adjustDelegate + [selfI.logger debug:@"Launching success session tracking delegate"]; + [ADJUtil launchInMainThread:selfI.adjustDelegate selector:@selector(adjustSessionTrackingSucceeded:) withObject:[sessionResponseData successResponseData]]; } // session failure callback if (!sessionResponseData.success - && [self.adjustDelegate respondsToSelector:@selector(adjustSessionTrackingFailed:)]) + && [selfI.adjustDelegate respondsToSelector:@selector(adjustSessionTrackingFailed:)]) { - [self.logger debug:@"Launching failed session tracking delegate"]; - [ADJUtil launchInMainThread:self.adjustDelegate + [selfI.logger debug:@"Launching failed session tracking delegate"]; + [ADJUtil launchInMainThread:selfI.adjustDelegate selector:@selector(adjustSessionTrackingFailed:) withObject:[sessionResponseData failureResponseData]]; } // try to update and launch the attribution changed delegate if (toLaunchAttributionDelegate) { - [self.logger debug:@"Launching attribution changed delegate"]; - [ADJUtil launchInMainThread:self.adjustDelegate + [selfI.logger debug:@"Launching attribution changed delegate"]; + [ADJUtil launchInMainThread:selfI.adjustDelegate selector:@selector(adjustAttributionChanged:) withObject:sessionResponseData.attribution]; } +} + +- (void)launchAttributionResponseTasksI:(ADJActivityHandler *)selfI + attributionResponseData:(ADJAttributionResponseData *)attributionResponseData { + BOOL toLaunchAttributionDelegate = [selfI updateAttributionI:selfI + attribution:attributionResponseData.attribution]; + + // try to update and launch the attribution changed delegate non-blocking + if (toLaunchAttributionDelegate) { + [selfI.logger debug:@"Launching attribution changed delegate"]; + [ADJUtil launchInMainThread:selfI.adjustDelegate + selector:@selector(adjustAttributionChanged:) + withObject:attributionResponseData.attribution]; + } - [self prepareDeeplink:sessionResponseData]; + [selfI prepareDeeplinkI:selfI responseData:attributionResponseData]; } -- (void)prepareDeeplink:(ADJResponseData *)responseData { - if (responseData == nil) { +- (void)prepareDeeplinkI:(ADJActivityHandler *)selfI + responseData:(ADJAttributionResponseData *)attributionResponseData { + if (attributionResponseData == nil) { return; } - NSString *deepLink = [responseData.jsonResponse objectForKey:@"deeplink"]; - if (deepLink == nil) { + if (attributionResponseData.deeplink == nil) { return; } - NSURL* deepLinkUrl = [NSURL URLWithString:deepLink]; - - [self.logger info:@"Open deep link (%@)", deepLink]; + [selfI.logger info:@"Open deep link (%@)", attributionResponseData.deeplink.absoluteString]; [ADJUtil launchInMainThread:^{ BOOL toLaunchDeeplink = YES; - if ([self.adjustDelegate respondsToSelector:@selector(adjustDeeplinkResponse:)]) { - toLaunchDeeplink = [self.adjustDelegate adjustDeeplinkResponse:deepLinkUrl]; + if ([selfI.adjustDelegate respondsToSelector:@selector(adjustDeeplinkResponse:)]) { + toLaunchDeeplink = [selfI.adjustDelegate adjustDeeplinkResponse:attributionResponseData.deeplink]; } if (toLaunchDeeplink) { - [self launchDeepLinkMain:deepLinkUrl]; + [ADJUtil launchDeepLinkMain:attributionResponseData.deeplink]; } }]; } -- (void)launchDeepLinkMain:(NSURL *) deepLinkUrl{ - BOOL success = [[UIApplication sharedApplication] openURL:deepLinkUrl]; - - if (!success) { - [self.logger error:@"Unable to open deep link (%@)", deepLinkUrl]; - } -} - -- (void) launchAttributionResponseTasksInternal:(ADJAttributionResponseData *)attributionResponseData { - BOOL toLaunchAttributionDelegate = [self updateAttribution:attributionResponseData.attribution]; - - // try to update and launch the attribution changed delegate non-blocking - if (toLaunchAttributionDelegate) { - [self.logger debug:@"Launching attribution changed delegate"]; - [ADJUtil launchInMainThread:self.adjustDelegate - selector:@selector(adjustAttributionChanged:) - withObject:attributionResponseData.attribution]; - } -} - -- (BOOL)updateAttribution:(ADJAttribution *)attribution { +- (BOOL)updateAttributionI:(ADJActivityHandler *)selfI + attribution:(ADJAttribution *)attribution { if (attribution == nil) { return NO; } - if ([attribution isEqual:self.attribution]) { + if ([attribution isEqual:selfI.attribution]) { return NO; } - self.attribution = attribution; - [self writeAttribution]; + // copy attribution property + // to avoid using the same object for the delegate + selfI.attribution = attribution; + [selfI writeAttributionI:selfI]; - if (self.adjustDelegate == nil) { + if (selfI.adjustDelegate == nil) { return NO; } - if (![self.adjustConfig hasAttributionChangedDelegate]) { + if (![selfI.adjustConfig hasAttributionChangedDelegate]) { return NO; } - if (![self.adjustDelegate respondsToSelector:@selector(adjustAttributionChanged:)]) { + if (![selfI.adjustDelegate respondsToSelector:@selector(adjustAttributionChanged:)]) { return NO; } return YES; } -- (void) appWillOpenUrlInternal:(NSURL *)url { +- (void)appWillOpenUrlI:(ADJActivityHandler *)selfI + url:(NSURL *)url { if ([ADJUtil isNull:url]) { return; } @@ -734,14 +933,14 @@ - (void) appWillOpenUrlInternal:(NSURL *)url { ADJAttribution *deeplinkAttribution = [[ADJAttribution alloc] init]; for (NSString* fieldValuePair in queryArray) { - [self readDeeplinkQueryString:fieldValuePair adjustDeepLinks:adjustDeepLinks attribution:deeplinkAttribution]; + [selfI readDeeplinkQueryStringI:selfI queryString:fieldValuePair adjustDeepLinks:adjustDeepLinks attribution:deeplinkAttribution]; } double now = [NSDate.date timeIntervalSince1970]; ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] - initWithDeviceInfo:self.deviceInfo - activityState:self.activityState - config:self.adjustConfig + initWithDeviceInfo:selfI.deviceInfo + activityState:selfI.activityState + config:selfI.adjustConfig createdAt:now]; clickBuilder.deeplinkParameters = adjustDeepLinks; clickBuilder.attribution = deeplinkAttribution; @@ -749,10 +948,11 @@ - (void) appWillOpenUrlInternal:(NSURL *)url { clickBuilder.deeplink = [url absoluteString]; ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"deeplink"]; - [self.sdkClickHandler sendSdkClick:clickPackage]; + [selfI.sdkClickHandler sendSdkClick:clickPackage]; } -- (BOOL) readDeeplinkQueryString:(NSString *)queryString +- (BOOL)readDeeplinkQueryStringI:(ADJActivityHandler *)selfI + queryString:(NSString *)queryString adjustDeepLinks:(NSMutableDictionary*)adjustDeepLinks attribution:(ADJAttribution *)deeplinkAttribution { @@ -772,17 +972,17 @@ - (BOOL) readDeeplinkQueryString:(NSString *)queryString NSString* keyWOutPrefix = [keyDecoded substringFromIndex:kAdjustPrefix.length]; if (keyWOutPrefix.length == 0) return NO; - if (![self trySetAttributionDeeplink:deeplinkAttribution withKey:keyWOutPrefix withValue:valueDecoded]) { + if (![selfI trySetAttributionDeeplink:deeplinkAttribution withKey:keyWOutPrefix withValue:valueDecoded]) { [adjustDeepLinks setObject:valueDecoded forKey:keyWOutPrefix]; } return YES; } -- (BOOL) trySetAttributionDeeplink:(ADJAttribution *)deeplinkAttribution - withKey:(NSString *)key - withValue:(NSString*)value { - +- (BOOL)trySetAttributionDeeplink:(ADJAttribution *)deeplinkAttribution + withKey:(NSString *)key + withValue:(NSString*)value +{ if ([key isEqualToString:@"tracker"]) { deeplinkAttribution.trackerName = value; return YES; @@ -806,7 +1006,8 @@ - (BOOL) trySetAttributionDeeplink:(ADJAttribution *)deeplinkAttribution return NO; } -- (void)setDeviceTokenInternal:(NSData *)deviceToken { +- (void)setDeviceTokenI:(ADJActivityHandler *)selfI + deviceToken:(NSData *)deviceToken { if (deviceToken == nil) { return; } @@ -815,66 +1016,125 @@ - (void)setDeviceTokenInternal:(NSData *)deviceToken { [NSCharacterSet characterSetWithCharactersInString:@"<>"]]; deviceTokenString = [deviceTokenString stringByReplacingOccurrencesOfString:@" " withString:@""]; - if (![self updateDeviceToken:deviceTokenString]) { + if (deviceTokenString == nil) { + return; + } + + if ([deviceTokenString isEqualToString:selfI.activityState.deviceToken]) { return; } double now = [NSDate.date timeIntervalSince1970]; ADJPackageBuilder * clickBuilder = [[ADJPackageBuilder alloc] - initWithDeviceInfo:self.deviceInfo - activityState:self.activityState - config:self.adjustConfig + initWithDeviceInfo:selfI.deviceInfo + activityState:selfI.activityState + config:selfI.adjustConfig createdAt:now]; clickBuilder.deviceToken = deviceTokenString; ADJActivityPackage * clickPackage = [clickBuilder buildClickPackage:@"push"]; - [self.sdkClickHandler sendSdkClick:clickPackage]; + [selfI.sdkClickHandler sendSdkClick:clickPackage]; + + // save new push token + selfI.activityState.deviceToken = deviceTokenString; + [selfI writeActivityStateI:selfI]; } -- (BOOL)updateDeviceToken:(NSString *)deviceToken { - if (deviceToken == nil) { - return NO; - } +#pragma mark - private - if ([deviceToken isEqualToString:self.activityState.deviceToken]) { - return NO; +- (BOOL)isEnabledI:(ADJActivityHandler *)selfI { + if (selfI.activityState != nil) { + return selfI.activityState.enabled; + } else { + return [selfI.internalState isEnabled]; } - - return YES; } -#pragma mark - private +- (BOOL)isToUpdatePackagesI:(ADJActivityHandler *)selfI { + if (selfI.activityState != nil) { + return selfI.activityState.updatePackages; + } else { + return [selfI.internalState isToUpdatePackages]; + } +} // returns whether or not the activity state should be written -- (BOOL)updateActivityState:(double)now { - if (![self checkActivityState]) return NO; +- (BOOL)updateActivityStateI:(ADJActivityHandler *)selfI + now:(double)now { + if (![selfI checkActivityStateI:selfI]) return NO; - double lastInterval = now - self.activityState.lastActivity; + double lastInterval = now - selfI.activityState.lastActivity; // ignore late updates if (lastInterval > kSessionInterval) return NO; - self.activityState.lastActivity = now; + selfI.activityState.lastActivity = now; if (lastInterval < 0) { - [self.logger error:@"Time travel!"]; + [selfI.logger error:@"Time travel!"]; return YES; } else { - self.activityState.sessionLength += lastInterval; - self.activityState.timeSpent += lastInterval; + selfI.activityState.sessionLength += lastInterval; + selfI.activityState.timeSpent += lastInterval; } return YES; } -- (void)writeActivityState { - [ADJUtil writeObject:self.activityState filename:kActivityStateFilename objectName:@"Activity state"]; +- (void)writeActivityStateI:(ADJActivityHandler *)selfI +{ + [selfI writeActivityStateS:selfI changesInStateBlock:nil]; } -- (void)writeAttribution { - [ADJUtil writeObject:self.attribution filename:kAttributionFilename objectName:@"Attribution"]; +- (void)writeActivityStateS:(ADJActivityHandler *)selfS + changesInStateBlock:(void (^)(void))changesInStateBlock +{ + @synchronized ([ADJActivityState class]) { + if (selfS.activityState == nil) { + return; + } + if (changesInStateBlock != nil) { + changesInStateBlock(); + } + [ADJUtil writeObject:selfS.activityState filename:kActivityStateFilename objectName:@"Activity state"]; + } +} + +- (void)teardownActivityStateS:(BOOL)deleteState +{ + @synchronized ([ADJActivityState class]) { + if (self.activityState == nil) { + return; + } + if (deleteState) { + [ADJUtil deleteFile:kActivityStateFilename]; + } + self.activityState = nil; + } +} + +- (void)writeAttributionI:(ADJActivityHandler *)selfI { + @synchronized ([ADJAttribution class]) { + if (selfI.attribution == nil) { + return; + } + [ADJUtil writeObject:selfI.attribution filename:kAttributionFilename objectName:@"Attribution"]; + } +} + +- (void)teardownAttributionS:(BOOL)deleteState +{ + @synchronized ([ADJAttribution class]) { + if (self.attribution == nil) { + return; + } + if (deleteState) { + [ADJUtil deleteFile:kAttributionFilename]; + } + self.attribution = nil; + } } - (void)readActivityState { @@ -890,113 +1150,391 @@ - (void)readAttribution { class:[ADJAttribution class]]; } -- (void)transferSessionPackage:(double)now { - ADJPackageBuilder *sessionBuilder = [[ADJPackageBuilder alloc] - initWithDeviceInfo:self.deviceInfo - activityState:self.activityState - config:self.adjustConfig - createdAt:now]; - ADJActivityPackage *sessionPackage = [sessionBuilder buildSessionPackage]; - [self.packageHandler addPackage:sessionPackage]; - [self.packageHandler sendFirstPackage]; +- (void)writeSessionCallbackParametersI:(ADJActivityHandler *)selfI { + @synchronized ([ADJSessionParameters class]) { + if (selfI.sessionParameters == nil) { + return; + } + [ADJUtil writeObject:selfI.sessionParameters.callbackParameters + filename:kSessionCallbackParametersFilename + objectName:@"Session Callback parameters"]; + } +} + +- (void)writeSessionPartnerParametersI:(ADJActivityHandler *)selfI { + @synchronized ([ADJSessionParameters class]) { + if (selfI.sessionParameters == nil) { + return; + } + [ADJUtil writeObject:selfI.sessionParameters.partnerParameters + filename:kSessionPartnerParametersFilename + objectName:@"Session Partner parameters"]; + } +} + +- (void)teardownAllSessionParametersS:(BOOL)deleteState { + @synchronized ([ADJSessionParameters class]) { + if (self.sessionParameters == nil) { + return; + } + if (deleteState) { + [ADJUtil deleteFile:kSessionCallbackParametersFilename]; + [ADJUtil deleteFile:kSessionPartnerParametersFilename]; + } + [self.sessionParameters.callbackParameters removeAllObjects]; + [self.sessionParameters.partnerParameters removeAllObjects]; + self.sessionParameters = nil; + } +} + +- (void)readSessionCallbackParametersI:(ADJActivityHandler *)selfI { + selfI.sessionParameters.callbackParameters = [ADJUtil readObject:kSessionCallbackParametersFilename + objectName:@"Session Callback parameters" + class:[NSDictionary class]]; +} + +- (void)readSessionPartnerParametersI:(ADJActivityHandler *)selfI { + selfI.sessionParameters.partnerParameters = [ADJUtil readObject:kSessionPartnerParametersFilename + objectName:@"Session Partner parameters" + class:[NSDictionary class]]; } # pragma mark - handlers status -- (void)updateHandlersStatusAndSendInternal { +- (void)updateHandlersStatusAndSendI:(ADJActivityHandler *)selfI { // check if it should stop sending - - if (![self toSend]) { - [self pauseSending]; + if (![selfI toSendI:selfI]) { + [selfI pauseSendingI:selfI]; return; } - [self resumeSending]; + [selfI resumeSendingI:selfI]; // try to send - if (!self.adjustConfig.eventBufferingEnabled) { - [self.packageHandler sendFirstPackage]; + if (!selfI.adjustConfig.eventBufferingEnabled) { + [selfI.packageHandler sendFirstPackage]; } } -- (void)pauseSending { - [self.attributionHandler pauseSending]; - [self.packageHandler pauseSending]; - [self.sdkClickHandler pauseSending]; +- (void)pauseSendingI:(ADJActivityHandler *)selfI { + [selfI.attributionHandler pauseSending]; + [selfI.packageHandler pauseSending]; + // the conditions to pause the sdk click handler are less restrictive + // it's possible for the sdk click handler to be active while others are paused + if (![selfI toSendI:selfI sdkClickHandlerOnly:YES]) { + [selfI.sdkClickHandler pauseSending]; + } else { + [selfI.sdkClickHandler resumeSending]; + } } -- (void)resumeSending { - [self.attributionHandler resumeSending]; - [self.packageHandler resumeSending]; - [self.sdkClickHandler resumeSending]; +- (void)resumeSendingI:(ADJActivityHandler *)selfI { + [selfI.attributionHandler resumeSending]; + [selfI.packageHandler resumeSending]; + [selfI.sdkClickHandler resumeSending]; } -// offline or disabled pauses the sdk -- (BOOL)paused { - return [self.internalState isOffline] || ![self isEnabled]; +- (BOOL)pausedI:(ADJActivityHandler *)selfI { + return [selfI pausedI:selfI sdkClickHandlerOnly:NO]; } -- (BOOL)toSend { - // if it's offline, disabled -> don't send - if ([self paused]) { +- (BOOL)pausedI:(ADJActivityHandler *)selfI +sdkClickHandlerOnly:(BOOL)sdkClickHandlerOnly +{ + if (sdkClickHandlerOnly) { + // sdk click handler is paused if either: + return [selfI.internalState isOffline] || // it's offline + ![selfI isEnabledI:selfI]; // is disabled + } + // other handlers are paused if either: + return [selfI.internalState isOffline] || // it's offline + ![selfI isEnabledI:selfI] || // is disabled + [selfI.internalState isDelayStart]; // is in delayed start +} + +- (BOOL)toSendI:(ADJActivityHandler *)selfI { + return [selfI toSendI:selfI sdkClickHandlerOnly:NO]; +} + +- (BOOL)toSendI:(ADJActivityHandler *)selfI +sdkClickHandlerOnly:(BOOL)sdkClickHandlerOnly +{ + // don't send when it's paused + if ([selfI pausedI:selfI sdkClickHandlerOnly:sdkClickHandlerOnly]) { return NO; } // has the option to send in the background -> is to send - if (self.adjustConfig.sendInBackground) { + if (selfI.adjustConfig.sendInBackground) { return YES; } // doesn't have the option -> depends on being on the background/foreground - return [self.internalState isForeground]; + return [selfI.internalState isForeground]; } # pragma mark - timer -- (void)startForegroundTimer { - // don't start the timer if it's disabled/offline - if ([self paused]) { +- (void)startForegroundTimerI:(ADJActivityHandler *)selfI { + // don't start the timer when it's disabled + if (![selfI isEnabledI:selfI]) { return; } - [self.foregroundTimer resume]; + [selfI.foregroundTimer resume]; } -- (void)stopForegroundTimer { - [self.foregroundTimer suspend]; +- (void)stopForegroundTimerI:(ADJActivityHandler *)selfI { + [selfI.foregroundTimer suspend]; } -- (void)foregroundTimerFiredInternal { - if ([self paused]) { - // stop the timer cycle if it's disabled/offline - [self stopForegroundTimer]; +- (void)foregroundTimerFiredI:(ADJActivityHandler *)selfI { + // stop the timer cycle when it's disabled + if (![selfI isEnabledI:selfI]) { + [selfI stopForegroundTimerI:selfI]; return; } - [self.packageHandler sendFirstPackage]; + + if ([selfI toSendI:selfI]) { + [selfI.packageHandler sendFirstPackage]; + } + double now = [NSDate.date timeIntervalSince1970]; - if ([self updateActivityState:now]) { - [self writeActivityState]; + if ([selfI updateActivityStateI:selfI now:now]) { + [selfI writeActivityStateI:selfI]; } } -- (void)startBackgroundTimer { +- (void)startBackgroundTimerI:(ADJActivityHandler *)selfI { + if (selfI.backgroundTimer == nil) { + return; + } + // check if it can send in the background - if (![self toSend]) { + if (![selfI toSendI:selfI]) { return; } // background timer already started - if ([self.backgroundTimer fireIn] > 0) { + if ([selfI.backgroundTimer fireIn] > 0) { return; } - [self.backgroundTimer startIn:kBackgroundTimerInterval]; + [selfI.backgroundTimer startIn:kBackgroundTimerInterval]; } -- (void)stopBackgroundTimer { - [self.backgroundTimer cancel]; +- (void)stopBackgroundTimerI:(ADJActivityHandler *)selfI { + if (selfI.backgroundTimer == nil) { + return; + } + + [selfI.backgroundTimer cancel]; } --(void)backgroundTimerFiredInternal { - [self.packageHandler sendFirstPackage]; +- (void)backgroundTimerFiredI:(ADJActivityHandler *)selfI { + if ([selfI toSendI:selfI]) { + [selfI.packageHandler sendFirstPackage]; + } +} + +#pragma mark - delay +- (void)delayStartI:(ADJActivityHandler *)selfI { + // it's not configured to start delayed or already finished + if ([selfI.internalState isToStartNow]) { + return; + } + + // the delay has already started + if ([selfI isToUpdatePackagesI:selfI]) { + return; + } + + // check against max start delay + double delayStart = selfI.adjustConfig.delayStart; + double maxDelayStart = [ADJAdjustFactory maxDelayStart]; + + if (delayStart > maxDelayStart) { + NSString * delayStartFormatted = [ADJUtil secondsNumberFormat:delayStart]; + NSString * maxDelayStartFormatted = [ADJUtil secondsNumberFormat:maxDelayStart]; + + [selfI.logger warn:@"Delay start of %@ seconds bigger than max allowed value of %@ seconds", delayStartFormatted, maxDelayStartFormatted]; + delayStart = maxDelayStart; + } + + NSString * delayStartFormatted = [ADJUtil secondsNumberFormat:delayStart]; + [selfI.logger info:@"Waiting %@ seconds before starting first session", delayStartFormatted]; + + [selfI.delayStartTimer startIn:delayStart]; + + selfI.internalState.updatePackages = YES; + + if (selfI.activityState != nil) { + selfI.activityState.updatePackages = YES; + [selfI writeActivityStateI:selfI]; + } +} + +- (void)sendFirstPackagesI:(ADJActivityHandler *)selfI { + if ([selfI.internalState isToStartNow]) { + [selfI.logger info:@"Start delay expired or never configured"]; + return; + } + // update packages in queue + [selfI updatePackagesI:selfI]; + // no longer is in delay start + selfI.internalState.delayStart = NO; + // cancel possible still running timer if it was called by user + [selfI.delayStartTimer cancel]; + // and release timer + selfI.delayStartTimer = nil; + // update the status and try to send first package + [selfI updateHandlersStatusAndSendI:selfI]; +} + +- (void)updatePackagesI:(ADJActivityHandler *)selfI { + // update activity packages + [selfI.packageHandler updatePackages:selfI.sessionParameters]; + // no longer needs to update packages + selfI.internalState.updatePackages = NO; + if (selfI.activityState != nil) { + selfI.activityState.updatePackages = NO; + [selfI writeActivityStateI:selfI]; + } +} + +#pragma mark - session parameters +- (void)addSessionCallbackParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key + value:(NSString *)value +{ + if (![ADJUtil isValidParameter:key + attributeType:@"key" + parameterName:@"Session Callback"]) return; + + if (![ADJUtil isValidParameter:value + attributeType:@"value" + parameterName:@"Session Callback"]) return; + + if (selfI.sessionParameters.callbackParameters == nil) { + selfI.sessionParameters.callbackParameters = [NSMutableDictionary dictionary]; + } + + NSString * oldValue = [selfI.sessionParameters.callbackParameters objectForKey:key]; + + if (oldValue != nil) { + if ([oldValue isEqualToString:value]) { + [selfI.logger verbose:@"Key %@ already present with the same value", key]; + return; + } + [selfI.logger warn:@"Key %@ will be overwritten", key]; + } + + [selfI.sessionParameters.callbackParameters setObject:value forKey:key]; + + [selfI writeSessionCallbackParametersI:selfI]; +} + +- (void)addSessionPartnerParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key + value:(NSString *)value +{ + if (![ADJUtil isValidParameter:key + attributeType:@"key" + parameterName:@"Session Partner"]) return; + + if (![ADJUtil isValidParameter:value + attributeType:@"value" + parameterName:@"Session Partner"]) return; + + if (selfI.sessionParameters.partnerParameters == nil) { + selfI.sessionParameters.partnerParameters = [NSMutableDictionary dictionary]; + } + + NSString * oldValue = [selfI.sessionParameters.partnerParameters objectForKey:key]; + + if (oldValue != nil) { + if ([oldValue isEqualToString:value]) { + [selfI.logger verbose:@"Key %@ already present with the same value", key]; + return; + } + [selfI.logger warn:@"Key %@ will be overwritten", key]; + } + + + [selfI.sessionParameters.partnerParameters setObject:value forKey:key]; + + [selfI writeSessionPartnerParametersI:selfI]; +} + +- (void)removeSessionCallbackParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key { + if (![ADJUtil isValidParameter:key + attributeType:@"key" + parameterName:@"Session Callback"]) return; + + if (selfI.sessionParameters.callbackParameters == nil) { + [selfI.logger warn:@"Session Callback parameters are not set"]; + return; + } + + NSString * oldValue = [selfI.sessionParameters.callbackParameters objectForKey:key]; + if (oldValue == nil) { + [selfI.logger warn:@"Key %@ does not exist", key]; + return; + } + + [selfI.logger debug:@"Key %@ will be removed", key]; + [selfI.sessionParameters.callbackParameters removeObjectForKey:key]; + [selfI writeSessionCallbackParametersI:selfI]; +} + +- (void)removeSessionPartnerParameterI:(ADJActivityHandler *)selfI + key:(NSString *)key { + if (![ADJUtil isValidParameter:key + attributeType:@"key" + parameterName:@"Session Partner"]) return; + + if (selfI.sessionParameters.partnerParameters == nil) { + [selfI.logger warn:@"Session Partner parameters are not set"]; + return; + } + + NSString * oldValue = [selfI.sessionParameters.partnerParameters objectForKey:key]; + if (oldValue == nil) { + [selfI.logger warn:@"Key %@ does not exist", key]; + return; + } + + [selfI.logger debug:@"Key %@ will be removed", key]; + [selfI.sessionParameters.partnerParameters removeObjectForKey:key]; + [selfI writeSessionPartnerParametersI:selfI]; +} + +- (void)resetSessionCallbackParametersI:(ADJActivityHandler *)selfI { + if (selfI.sessionParameters.callbackParameters == nil) { + [selfI.logger warn:@"Session Callback parameters are not set"]; + return; + } + selfI.sessionParameters.callbackParameters = nil; + [selfI writeSessionCallbackParametersI:selfI]; +} + +- (void)resetSessionPartnerParametersI:(ADJActivityHandler *)selfI { + if (selfI.sessionParameters.partnerParameters == nil) { + [selfI.logger warn:@"Session Partner parameters are not set"]; + return; + } + selfI.sessionParameters.partnerParameters = nil; + [selfI writeSessionPartnerParametersI:selfI]; +} + +- (void)sessionParametersActionsI:(ADJActivityHandler *)selfI + sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray +{ + if (sessionParametersActionsArray == nil) { + return; + } + for (activityHandlerBlockI activityHandlerActionI in sessionParametersActionsArray) { + activityHandlerActionI(selfI); + } } #pragma mark - notifications @@ -1026,40 +1564,42 @@ - (void)removeNotificationObserver { #pragma mark - checks -- (BOOL)checkTransactionId:(NSString *)transactionId { +- (BOOL)checkTransactionIdI:(ADJActivityHandler *)selfI + transactionId:(NSString *)transactionId { if (transactionId == nil || transactionId.length == 0) { return YES; // no transaction ID given } - if ([self.activityState findTransactionId:transactionId]) { - [self.logger info:@"Skipping duplicate transaction ID '%@'", transactionId]; - [self.logger verbose:@"Found transaction ID in %@", self.activityState.transactionIds]; + if ([selfI.activityState findTransactionId:transactionId]) { + [selfI.logger info:@"Skipping duplicate transaction ID '%@'", transactionId]; + [selfI.logger verbose:@"Found transaction ID in %@", selfI.activityState.transactionIds]; return NO; // transaction ID found -> used already } - [self.activityState addTransactionId:transactionId]; - [self.logger verbose:@"Added transaction ID %@", self.activityState.transactionIds]; + [selfI.activityState addTransactionId:transactionId]; + [selfI.logger verbose:@"Added transaction ID %@", selfI.activityState.transactionIds]; // activity state will get written by caller return YES; } -- (BOOL)checkEvent:(ADJEvent *)event { +- (BOOL)checkEventI:(ADJActivityHandler *)selfI + event:(ADJEvent *)event { if (event == nil) { - [self.logger error:@"Event missing"]; + [selfI.logger error:@"Event missing"]; return NO; } if (![event isValid]) { - [self.logger error:@"Event not initialized correctly"]; + [selfI.logger error:@"Event not initialized correctly"]; return NO; } return YES; } -- (BOOL)checkActivityState { - if (self.activityState == nil) { - [self.logger error:@"Missing activity state"]; +- (BOOL)checkActivityStateI:(ADJActivityHandler *)selfI { + if (selfI.activityState == nil) { + [selfI.logger error:@"Missing activity state"]; return NO; } return YES; diff --git a/Adjust/ADJActivityPackage.h b/Adjust/ADJActivityPackage.h index e740fbb35..50ee01744 100644 --- a/Adjust/ADJActivityPackage.h +++ b/Adjust/ADJActivityPackage.h @@ -13,10 +13,13 @@ // data @property (nonatomic, copy) NSString *path; @property (nonatomic, copy) NSString *clientSdk; -@property (nonatomic, retain) NSDictionary *parameters; +@property (nonatomic, strong) NSMutableDictionary *parameters; @property (nonatomic, assign) NSInteger retries; +@property (nonatomic, strong) NSDictionary *callbackParameters; +@property (nonatomic, strong) NSDictionary *partnerParameters; + // logs @property (nonatomic, assign) ADJActivityKind activityKind; @property (nonatomic, copy) NSString *suffix; diff --git a/Adjust/ADJActivityPackage.m b/Adjust/ADJActivityPackage.m index 78bbf4b51..6c4fa9923 100644 --- a/Adjust/ADJActivityPackage.m +++ b/Adjust/ADJActivityPackage.m @@ -71,6 +71,8 @@ - (id)initWithCoder:(NSCoder *)decoder { self.activityKind = [ADJActivityKindUtil activityKindFromString:kindString]; + self.callbackParameters = [decoder decodeObjectForKey:@"callbackParameters"]; + self.partnerParameters = [decoder decodeObjectForKey:@"partnerParameters"]; return self; } @@ -82,6 +84,8 @@ - (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeObject:self.parameters forKey:@"parameters"]; [encoder encodeObject:kindString forKey:@"kind"]; [encoder encodeObject:self.suffix forKey:@"suffix"]; + [encoder encodeObject:self.callbackParameters forKey:@"callbackParameters"]; + [encoder encodeObject:self.partnerParameters forKey:@"partnerParameters"]; } @end diff --git a/Adjust/ADJActivityState.h b/Adjust/ADJActivityState.h index 39f82005c..a19c5dc4f 100644 --- a/Adjust/ADJActivityState.h +++ b/Adjust/ADJActivityState.h @@ -5,35 +5,40 @@ // Created by Christian Wellenbrock on 2013-07-02. // Copyright (c) 2013 adjust GmbH. All rights reserved. // + #import @interface ADJActivityState : NSObject -// persistent data -@property (nonatomic, copy) NSString *uuid; +// Persistent data @property (nonatomic, assign) BOOL enabled; @property (nonatomic, assign) BOOL askingAttribution; + +@property (nonatomic, copy) NSString *uuid; @property (nonatomic, copy) NSString *deviceToken; +@property (nonatomic, assign) BOOL updatePackages; -// global counters +// Global counters @property (nonatomic, assign) int eventCount; @property (nonatomic, assign) int sessionCount; -// session attributes +// Session attributes @property (nonatomic, assign) int subsessionCount; -@property (nonatomic, assign) double sessionLength; // all durations in seconds + @property (nonatomic, assign) double timeSpent; -@property (nonatomic, assign) double lastActivity; // all times in seconds since 1970 +@property (nonatomic, assign) double lastActivity; // Entire time in seconds since 1970 +@property (nonatomic, assign) double sessionLength; // Entire duration in seconds // last ten transaction identifiers -@property (nonatomic, retain) NSMutableArray *transactionIds; +@property (nonatomic, strong) NSMutableArray *transactionIds; -// not persisted, only injected +// Not persisted, only injected +@property (nonatomic, assign) BOOL isPersisted; @property (nonatomic, assign) double lastInterval; - (void)resetSessionAttributes:(double)now; -// transaction ID management +// Transaction ID management - (void)addTransactionId:(NSString *)transactionId; - (BOOL)findTransactionId:(NSString *)transactionId; diff --git a/Adjust/ADJActivityState.m b/Adjust/ADJActivityState.m index 080f4d213..659f6c7f6 100644 --- a/Adjust/ADJActivityState.m +++ b/Adjust/ADJActivityState.m @@ -6,90 +6,134 @@ // Copyright (c) 2013 adjust GmbH. All rights reserved. // +#import "ADJKeychain.h" #import "ADJActivityState.h" #import "UIDevice+ADJAdditions.h" static const int kTransactionIdCount = 10; -#pragma mark public implementation @implementation ADJActivityState +#pragma mark - Object lifecycle methods + - (id)init { self = [super init]; - if (self == nil) return nil; - // create UUID for new devices - self.uuid = [UIDevice.currentDevice adjCreateUuid]; + if (self == nil) { + return nil; + } - self.eventCount = 0; - self.sessionCount = 0; - self.subsessionCount = -1; // -1 means unknown - self.sessionLength = -1; - self.timeSpent = -1; - self.lastActivity = -1; - self.lastInterval = -1; - self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount]; - self.enabled = YES; - self.askingAttribution = NO; - self.deviceToken = nil; + [self assignUuid:[UIDevice.currentDevice adjCreateUuid]]; + + self.eventCount = 0; + self.sessionCount = 0; + self.subsessionCount = -1; // -1 means unknown + self.sessionLength = -1; + self.timeSpent = -1; + self.lastActivity = -1; + self.lastInterval = -1; + self.enabled = YES; + self.askingAttribution = NO; + self.deviceToken = nil; + self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount]; + self.updatePackages = NO; return self; } +#pragma mark - Public methods + - (void)resetSessionAttributes:(double)now { self.subsessionCount = 1; self.sessionLength = 0; self.timeSpent = 0; - self.lastActivity = now; self.lastInterval = -1; + self.lastActivity = now; } - (void)addTransactionId:(NSString *)transactionId { - if (self.transactionIds == nil) { // create array + // Create array. + if (self.transactionIds == nil) { self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount]; } + // Make space. if (self.transactionIds.count == kTransactionIdCount) { - [self.transactionIds removeObjectAtIndex:0]; // make space + [self.transactionIds removeObjectAtIndex:0]; } - [self.transactionIds addObject:transactionId]; // add new ID + // Add the new ID. + [self.transactionIds addObject:transactionId]; } - (BOOL)findTransactionId:(NSString *)transactionId { return [self.transactionIds containsObject:transactionId]; } +#pragma mark - Private & helper methods + +- (void)assignUuid:(NSString *)uuid { + // First check if there's any UUID written in keychain. + // If yes, use keychain value and flag it. + // If not, use given UUID and store it to keychain. + // If successfully written, flag it. + // If writing failed, don't flat it. + + NSString *persistedUuid = [ADJKeychain valueForKeychainKey:@"adjust_persisted_uuid" service:@"deviceInfo"]; + + // Check if value existed in keychain. + if (persistedUuid != nil) { + // Check if value has UUID format. + if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuid]) { + // Value written in keychain seems to have UUID format. + self.uuid = persistedUuid; + self.isPersisted = YES; + + return; + } + } + + // At this point, UUID was not persisted or if persisted, didn't have proper UUID format. + + // Since we don't have anything in the keychain, we'll use the passed UUID value. + // Try to save that value to the keychain and flag if successfully written. + self.uuid = uuid; + self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:@"adjust_persisted_uuid" inService:@"deviceInfo"]; +} + - (NSString *)description { return [NSString stringWithFormat:@"ec:%d sc:%d ssc:%d ask:%d sl:%.1f ts:%.1f la:%.1f dt:%@", self.eventCount, self.sessionCount, self.subsessionCount, self.askingAttribution, self.sessionLength, self.timeSpent, self.lastActivity, self.deviceToken]; } -#pragma mark NSCoding +#pragma mark - NSCoding protocol methods - (id)initWithCoder:(NSCoder *)decoder { self = [super init]; - if (self == nil) return nil; - self.eventCount = [decoder decodeIntForKey:@"eventCount"]; - self.sessionCount = [decoder decodeIntForKey:@"sessionCount"]; - self.subsessionCount = [decoder decodeIntForKey:@"subsessionCount"]; - self.sessionLength = [decoder decodeDoubleForKey:@"sessionLength"]; - self.timeSpent = [decoder decodeDoubleForKey:@"timeSpent"]; - self.lastActivity = [decoder decodeDoubleForKey:@"lastActivity"]; + if (self == nil) { + return nil; + } - // default values for migrating devices + self.eventCount = [decoder decodeIntForKey:@"eventCount"]; + self.sessionCount = [decoder decodeIntForKey:@"sessionCount"]; + self.subsessionCount = [decoder decodeIntForKey:@"subsessionCount"]; + self.sessionLength = [decoder decodeDoubleForKey:@"sessionLength"]; + self.timeSpent = [decoder decodeDoubleForKey:@"timeSpent"]; + self.lastActivity = [decoder decodeDoubleForKey:@"lastActivity"]; + + // Default values for migrating devices if ([decoder containsValueForKey:@"uuid"]) { - self.uuid = [decoder decodeObjectForKey:@"uuid"]; + [self assignUuid:[decoder decodeObjectForKey:@"uuid"]]; } if (self.uuid == nil) { - self.uuid = [UIDevice.currentDevice adjCreateUuid]; + [self assignUuid:[UIDevice.currentDevice adjCreateUuid]]; } if ([decoder containsValueForKey:@"transactionIds"]) { - self.transactionIds = [decoder decodeObjectForKey:@"transactionIds"]; + self.transactionIds = [decoder decodeObjectForKey:@"transactionIds"]; } if (self.transactionIds == nil) { @@ -97,7 +141,7 @@ - (id)initWithCoder:(NSCoder *)decoder { } if ([decoder containsValueForKey:@"enabled"]) { - self.enabled = [decoder decodeBoolForKey:@"enabled"]; + self.enabled = [decoder decodeBoolForKey:@"enabled"]; } else { self.enabled = YES; } @@ -109,7 +153,13 @@ - (id)initWithCoder:(NSCoder *)decoder { } if ([decoder containsValueForKey:@"deviceToken"]) { - self.deviceToken = [decoder decodeObjectForKey:@"deviceToken"]; + self.deviceToken = [decoder decodeObjectForKey:@"deviceToken"]; + } + + if ([decoder containsValueForKey:@"updatePackages"]) { + self.updatePackages = [decoder decodeBoolForKey:@"updatePackages"]; + } else { + self.updatePackages = NO; } self.lastInterval = -1; @@ -129,24 +179,27 @@ - (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeBool:self.enabled forKey:@"enabled"]; [encoder encodeBool:self.askingAttribution forKey:@"askingAttribution"]; [encoder encodeObject:self.deviceToken forKey:@"deviceToken"]; + [encoder encodeBool:self.updatePackages forKey:@"updatePackages"]; } --(id)copyWithZone:(NSZone *)zone -{ - ADJActivityState* copy = [[[self class] allocWithZone:zone] init]; +- (id)copyWithZone:(NSZone *)zone { + ADJActivityState *copy = [[[self class] allocWithZone:zone] init]; + if (copy) { - copy.sessionCount = self.sessionCount; - copy.subsessionCount = self.subsessionCount; - copy.sessionLength = self.sessionLength; - copy.timeSpent = self.timeSpent; - copy.uuid = [self.uuid copyWithZone:zone]; - copy.lastInterval = self.lastInterval; - copy.eventCount = self.eventCount; - copy.enabled = self.enabled; - copy.lastActivity = self.lastActivity; - copy.askingAttribution = self.askingAttribution; - copy.deviceToken = self.deviceToken; - // transactionIds not copied + copy.sessionCount = self.sessionCount; + copy.subsessionCount = self.subsessionCount; + copy.sessionLength = self.sessionLength; + copy.timeSpent = self.timeSpent; + copy.uuid = [self.uuid copyWithZone:zone]; + copy.lastInterval = self.lastInterval; + copy.eventCount = self.eventCount; + copy.enabled = self.enabled; + copy.lastActivity = self.lastActivity; + copy.askingAttribution = self.askingAttribution; + copy.deviceToken = [self.deviceToken copyWithZone:zone]; + copy.updatePackages = self.updatePackages; + + // transactionIds not copied. } return copy; diff --git a/Adjust/ADJAdjustFactory.h b/Adjust/ADJAdjustFactory.h index 4c94acea0..94e66c601 100644 --- a/Adjust/ADJAdjustFactory.h +++ b/Adjust/ADJAdjustFactory.h @@ -21,7 +21,8 @@ + (id)packageHandlerForActivityHandler:(id)activityHandler startsSending:(BOOL)startsSending; + (id)requestHandlerForPackageHandler:(id)packageHandler; -+ (id)activityHandlerWithConfig:(ADJConfig *)adjustConfig; ++ (id)activityHandlerWithConfig:(ADJConfig *)adjustConfig + sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray; + (id)sdkClickHandlerWithStartsPaused:(BOOL)startsSending; + (id)logger; @@ -37,6 +38,7 @@ startsSending:(BOOL)startsSending hasAttributionChangedDelegate:(BOOL)hasAttributionChangedDelegate; + (BOOL)testing; ++ (NSTimeInterval)maxDelayStart; + (void)setPackageHandler:(id)packageHandler; + (void)setRequestHandler:(id)requestHandler; @@ -51,5 +53,7 @@ + (void)setPackageHandlerBackoffStrategy:(ADJBackoffStrategy *)backoffStrategy; + (void)setSdkClickHandlerBackoffStrategy:(ADJBackoffStrategy *)backoffStrategy; + (void)setTesting:(BOOL)testing; ++ (void)setMaxDelayStart:(NSTimeInterval)maxDelayStart; ++ (void)teardown; @end diff --git a/Adjust/ADJAdjustFactory.m b/Adjust/ADJAdjustFactory.m index 7d9f1cbbc..16986d6ac 100644 --- a/Adjust/ADJAdjustFactory.m +++ b/Adjust/ADJAdjustFactory.m @@ -22,6 +22,7 @@ static ADJBackoffStrategy * packageHandlerBackoffStrategy = nil; static ADJBackoffStrategy * sdkClickHandlerBackoffStrategy = nil; static BOOL internalTesting = NO; +static NSTimeInterval internalMaxDelayStart = -1; @implementation ADJAdjustFactory @@ -41,11 +42,15 @@ @implementation ADJAdjustFactory return [internalRequestHandler initWithPackageHandler:packageHandler]; } -+ (id)activityHandlerWithConfig:(ADJConfig *)adjustConfig { ++ (id)activityHandlerWithConfig:(ADJConfig *)adjustConfig + sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray +{ if (internalActivityHandler == nil) { - return [ADJActivityHandler handlerWithConfig:adjustConfig]; + return [ADJActivityHandler handlerWithConfig:adjustConfig + sessionParametersActionsArray:sessionParametersActionsArray]; } - return [internalActivityHandler initWithConfig:adjustConfig]; + return [internalActivityHandler initWithConfig:adjustConfig + sessionParametersActionsArray:sessionParametersActionsArray]; } + (id)logger { @@ -129,6 +134,13 @@ + (BOOL)testing { return internalTesting; } ++ (NSTimeInterval)maxDelayStart { + if (internalMaxDelayStart == -1) { + return 10.0; // 10 seconds + } + return internalMaxDelayStart; +} + + (void)setPackageHandler:(id)packageHandler { internalPackageHandler = packageHandler; } @@ -180,4 +192,25 @@ + (void)setSdkClickHandlerBackoffStrategy:(ADJBackoffStrategy *)backoffStrategy + (void)setTesting:(BOOL)testing { internalTesting = testing; } + ++ (void)setMaxDelayStart:(NSTimeInterval)maxDelayStart { + internalMaxDelayStart = maxDelayStart; +} + ++ (void)teardown { + internalPackageHandler = nil; + internalRequestHandler = nil; + internalActivityHandler = nil; + internalLogger = nil; + internalAttributionHandler = nil; + internalSdkClickHandler = nil; + + internalSessionInterval = -1; + intervalSubsessionInterval = -1; + internalTimerInterval = -1; + intervalTimerStart = -1; + packageHandlerBackoffStrategy = nil; + sdkClickHandlerBackoffStrategy = nil; + internalMaxDelayStart = -1; +} @end diff --git a/Adjust/ADJAttributionHandler.h b/Adjust/ADJAttributionHandler.h index af61954cb..bc1e767d6 100644 --- a/Adjust/ADJAttributionHandler.h +++ b/Adjust/ADJAttributionHandler.h @@ -27,6 +27,8 @@ hasAttributionChangedDelegate:(BOOL)hasAttributionChangedDelegate; - (void)resumeSending; +- (void)teardown; + @end @interface ADJAttributionHandler : NSObject diff --git a/Adjust/ADJAttributionHandler.m b/Adjust/ADJAttributionHandler.m index b8a43d0c6..0fdaf39cb 100644 --- a/Adjust/ADJAttributionHandler.m +++ b/Adjust/ADJAttributionHandler.m @@ -18,11 +18,11 @@ @interface ADJAttributionHandler() -@property (nonatomic) dispatch_queue_t internalQueue; -@property (nonatomic, assign) id activityHandler; -@property (nonatomic, assign) id logger; -@property (nonatomic, retain) ADJTimerOnce *attributionTimer; -@property (nonatomic, retain) ADJActivityPackage * attributionPackage; +@property (nonatomic, strong) dispatch_queue_t internalQueue; +@property (nonatomic, weak) id activityHandler; +@property (nonatomic, weak) id logger; +@property (nonatomic, strong) ADJTimerOnce *attributionTimer; +@property (nonatomic, strong) ADJActivityPackage * attributionPackage; @property (nonatomic, assign) BOOL paused; @property (nonatomic, assign) BOOL hasNeedsResponseDelegate; @@ -57,66 +57,75 @@ - (id)initWithActivityHandler:(id) activityHandler self.attributionPackage = attributionPackage; self.paused = !startsSending; self.hasNeedsResponseDelegate = hasAttributionChangedDelegate; - self.attributionTimer = [ADJTimerOnce timerWithBlock:^{ [self getAttributionInternal]; } + __weak __typeof__(self) weakSelf = self; + self.attributionTimer = [ADJTimerOnce timerWithBlock:^{ + __typeof__(self) strongSelf = weakSelf; + if (strongSelf == nil) return; + + [strongSelf requestAttributionI:strongSelf]; + } queue:self.internalQueue name:kAttributionTimerName]; return self; } -- (void) checkSessionResponse:(ADJSessionResponseData *)sessionResponseData { - dispatch_async(self.internalQueue, ^{ - [self checkSessionResponseInternal:sessionResponseData]; - }); -} - -- (void) checkAttributionResponse:(ADJAttributionResponseData *)attributionResponseData { - dispatch_async(self.internalQueue, ^{ - [self checkAttributionResponseInternal:attributionResponseData]; - }); +- (void)checkSessionResponse:(ADJSessionResponseData *)sessionResponseData { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJAttributionHandler* selfI) { + [selfI checkSessionResponseI:selfI + sessionResponseData:sessionResponseData]; + }]; } -- (void) getAttributionWithDelay:(int)milliSecondsDelay { - NSTimeInterval secondsDelay = milliSecondsDelay / 1000; - NSTimeInterval nextAskIn = [self.attributionTimer fireIn]; - if (nextAskIn > secondsDelay) { - return; - } - - if (milliSecondsDelay > 0) { - [self.logger debug:@"Waiting to query attribution in %d milliseconds", milliSecondsDelay]; - } +- (void)checkAttributionResponse:(ADJAttributionResponseData *)attributionResponseData { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJAttributionHandler* selfI) { + [selfI checkAttributionResponseI:selfI + attributionResponseData:attributionResponseData]; - // set the new time the timer will fire in - [self.attributionTimer startIn:secondsDelay]; + }]; } -- (void) getAttribution { - [self getAttributionWithDelay:0]; +- (void)getAttribution { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJAttributionHandler* selfI) { + [selfI waitRequestAttributionWithDelayI:selfI + milliSecondsDelay:0]; + + }]; } -- (void) pauseSending { +- (void)pauseSending { self.paused = YES; } -- (void) resumeSending { +- (void)resumeSending { self.paused = NO; } #pragma mark - internal -- (void) checkSessionResponseInternal:(ADJSessionResponseData *)sessionResponseData { - [self checkAttributionInternal:sessionResponseData]; +- (void)checkSessionResponseI:(ADJAttributionHandler*)selfI + sessionResponseData:(ADJSessionResponseData *)sessionResponseData { + [selfI checkAttributionI:selfI responseData:sessionResponseData]; - [self.activityHandler launchSessionResponseTasks:sessionResponseData]; + [selfI.activityHandler launchSessionResponseTasks:sessionResponseData]; } -- (void) checkAttributionResponseInternal:(ADJAttributionResponseData *)attributionResponseData { - [self checkAttributionInternal:attributionResponseData]; +- (void)checkAttributionResponseI:(ADJAttributionHandler*)selfI + attributionResponseData:(ADJAttributionResponseData *)attributionResponseData { + [selfI checkAttributionI:selfI responseData:attributionResponseData]; + + [selfI checkDeeplinkI:selfI attributionResponseData:attributionResponseData]; - [self.activityHandler launchAttributionResponseTasks:attributionResponseData]; + [selfI.activityHandler launchAttributionResponseTasks:attributionResponseData]; } -- (void) checkAttributionInternal:(ADJResponseData *)responseData { +- (void)checkAttributionI:(ADJAttributionHandler*)selfI + responseData:(ADJResponseData *)responseData { if (responseData.jsonResponse == nil) { return; } @@ -124,59 +133,109 @@ - (void) checkAttributionInternal:(ADJResponseData *)responseData { NSNumber *timerMilliseconds = [responseData.jsonResponse objectForKey:@"ask_in"]; if (timerMilliseconds != nil) { - [self.activityHandler setAskingAttribution:YES]; + [selfI.activityHandler setAskingAttribution:YES]; - [self getAttributionWithDelay:[timerMilliseconds intValue]]; + [selfI waitRequestAttributionWithDelayI:selfI + milliSecondsDelay:[timerMilliseconds intValue]]; return; } - [self.activityHandler setAskingAttribution:NO]; + [selfI.activityHandler setAskingAttribution:NO]; NSDictionary * jsonAttribution = [responseData.jsonResponse objectForKey:@"attribution"]; responseData.attribution = [ADJAttribution dataWithJsonDict:jsonAttribution]; } -- (void) getAttributionInternal { - if (!self.hasNeedsResponseDelegate) { +- (void)checkDeeplinkI:(ADJAttributionHandler*)selfI +attributionResponseData:(ADJAttributionResponseData *)attributionResponseData { + if (attributionResponseData.jsonResponse == nil) { + return; + } + + NSDictionary * jsonAttribution = [attributionResponseData.jsonResponse objectForKey:@"attribution"]; + if (jsonAttribution == nil) { return; } - if (self.paused) { - [self.logger debug:@"Attribution handler is paused"]; + + NSString *deepLink = [jsonAttribution objectForKey:@"deeplink"]; + if (deepLink == nil) { return; } - [self.logger verbose:@"%@", self.attributionPackage.extendedString]; - [ADJUtil sendRequest:[self request] + attributionResponseData.deeplink = [NSURL URLWithString:deepLink]; +} + +- (void)requestAttributionI:(ADJAttributionHandler*)selfI { + if (!selfI.hasNeedsResponseDelegate) { + return; + } + if (selfI.paused) { + [selfI.logger debug:@"Attribution handler is paused"]; + return; + } + [selfI.logger verbose:@"%@", selfI.attributionPackage.extendedString]; + + [ADJUtil sendRequest:[selfI requestI:selfI] prefixErrorMessage:@"Failed to get attribution" - activityPackage:self.attributionPackage + activityPackage:selfI.attributionPackage responseDataHandler:^(ADJResponseData * responseData) { if ([responseData isKindOfClass:[ADJAttributionResponseData class]]) { - [self checkAttributionResponse:(ADJAttributionResponseData*)responseData]; + [selfI checkAttributionResponse:(ADJAttributionResponseData*)responseData]; } }]; } +- (void)waitRequestAttributionWithDelayI:(ADJAttributionHandler*)selfI + milliSecondsDelay:(int)milliSecondsDelay +{ + NSTimeInterval secondsDelay = milliSecondsDelay / 1000; + NSTimeInterval nextAskIn = [selfI.attributionTimer fireIn]; + if (nextAskIn > secondsDelay) { + return; + } + + if (milliSecondsDelay > 0) { + [selfI.logger debug:@"Waiting to query attribution in %d milliseconds", milliSecondsDelay]; + } + + // set the new time the timer will fire in + [selfI.attributionTimer startIn:secondsDelay]; +} + #pragma mark - private -- (NSMutableURLRequest *)request { - NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[self url]]; +- (NSMutableURLRequest *)requestI:(ADJAttributionHandler*)selfI { + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[selfI urlI:selfI]]; request.timeoutInterval = kRequestTimeout; request.HTTPMethod = @"GET"; - [request setValue:self.attributionPackage.clientSdk forHTTPHeaderField:@"Client-Sdk"]; + [request setValue:selfI.attributionPackage.clientSdk forHTTPHeaderField:@"Client-Sdk"]; return request; } -- (NSURL *)url { - NSString *parameters = [ADJUtil queryString:self.attributionPackage.parameters]; - NSString *relativePath = [NSString stringWithFormat:@"%@?%@", self.attributionPackage.path, parameters]; +- (NSURL *)urlI:(ADJAttributionHandler*)selfI { + NSString *parameters = [ADJUtil queryString:selfI.attributionPackage.parameters]; + NSString *relativePath = [NSString stringWithFormat:@"%@?%@", selfI.attributionPackage.path, parameters]; NSURL *baseUrl = [NSURL URLWithString:ADJUtil.baseUrl]; NSURL *url = [NSURL URLWithString:relativePath relativeToURL:baseUrl]; return url; } +- (void)teardown { + [ADJAdjustFactory.logger verbose:@"ADJAttributionHandler teardown"]; + + if (self.attributionTimer != nil) { + [self.attributionTimer cancel]; + } + self.internalQueue = nil; + self.activityHandler = nil; + self.logger = nil; + self.attributionTimer = nil; + self.attributionPackage = nil; +} + @end diff --git a/Adjust/ADJConfig.h b/Adjust/ADJConfig.h index e4edf2ce8..1774c80c7 100644 --- a/Adjust/ADJConfig.h +++ b/Adjust/ADJConfig.h @@ -23,91 +23,120 @@ /** * Optional delegate method that gets called when the attribution information changed * - * @param attribution The attribution information. See ADJAttribution for details. + * @param attribution The attribution information. + * See ADJAttribution for details */ - (void)adjustAttributionChanged:(ADJAttribution *)attribution; /** * Optional delegate method that gets called when an event is tracked with success * - * @param eventSuccessResponseData The response information from tracking with success. See ADJEventSuccess for details. + * @param eventSuccessResponseData The response information from tracking with success + * See ADJEventSuccess for details */ - (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData; /** * Optional delegate method that gets called when an event is tracked with failure * - * @param eventFailureResponseData The response information from tracking with failure. See ADJEventFailure for details. + * @param eventFailureResponseData The response information from tracking with failure + * See ADJEventFailure for details */ - (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData; /** * Optional delegate method that gets called when an session is tracked with success * - * @param sessionSuccessResponseData The response information from tracking with success. See ADJSessionSuccess for details. + * @param sessionSuccessResponseData The response information from tracking with success + * See ADJSessionSuccess for details */ - (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData; /** * Optional delegate method that gets called when an session is tracked with failure * - * @param sessionFailureResponseData The response information from tracking with failure. See ADJSessionFailure for details. + * @param sessionFailureResponseData The response information from tracking with failure + * See ADJSessionFailure for details */ - (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData; /** * Optional delegate method that gets called when a deeplink is about to be opened by the adjust SDK * - * @param deeplink The deeplink url that was received by the adjust SDK to be opened - * @return boolean value that indicates whether the deeplink should be opened by the adjust SDK + * @param deeplink The deeplink url that was received by the adjust SDK to be opened + * @return boolean Value that indicates whether the deeplink should be opened by the adjust SDK */ - (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink; + @end @interface ADJConfig : NSObject -@property (nonatomic, copy, readonly) NSString *appToken; -@property (nonatomic, copy, readonly) NSString *environment; @property (nonatomic, copy) NSString *sdkPrefix; @property (nonatomic, copy) NSString *defaultTracker; +@property (nonatomic, copy, readonly) NSString *appToken; +@property (nonatomic, copy, readonly) NSString *environment; + +/** + * Configuration object for the initialization of the Adjust SDK + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment; /** * Configuration object for the initialization of the Adjust SDK. * - * @param appToken The App Token of your app. This unique identifier can - * be found it in your dashboard at http://adjust.com and should always - * be 12 characters long. - * @param environment The current environment your app. We use this environment to - * distinguish between real traffic and artificial traffic from test devices. - * It is very important that you keep this value meaningful at all times! - * Especially if you are tracking revenue. + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + * @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress + * and replaces the default value for production environment */ -+ (ADJConfig*)configWithAppToken:(NSString *)appToken environment:(NSString *)environment; -- (id)initWithAppToken:(NSString *)appToken environment:(NSString *)environment; ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; /** - * Change the verbosity of Adjust's logs. + * Change the verbosity of Adjust's logs * * You can increase or reduce the amount of logs from Adjust by passing - * one of the following parameters. Use Log.ASSERT to disable all logging. + * one of the following parameters. Use ADJLogLevelSuppress to disable all logging * * @var logLevel The desired minimum log level (default: info) * Must be one of the following: - * - ADJLogLevelVerbose (enable all logging) - * - ADJLogLevelDebug (enable more logging) - * - ADJLogLevelInfo (the default) - * - ADJLogLevelWarn (disable info logging) - * - ADJLogLevelError (disable warnings as well) - * - ADJLogLevelAssert (disable errors as well) + * - ADJLogLevelVerbose (enable all logging) + * - ADJLogLevelDebug (enable more logging) + * - ADJLogLevelInfo (the default) + * - ADJLogLevelWarn (disable info logging) + * - ADJLogLevelError (disable warnings as well) + * - ADJLogLevelAssert (disable errors as well) + * - ADJLogLevelSuppress (suppress all logging) */ @property (nonatomic, assign) ADJLogLevel logLevel; /** * Enable event buffering if your app triggers a lot of events. * When enabled, events get buffered and only get tracked each - * minute. Buffered events are still persisted, of course. + * minute. Buffered events are still persisted, of course * - * @var eventBufferingEnabled Enable or disable event buffering + * @var eventBufferingEnabled Enable or disable event buffering */ @property (nonatomic, assign) BOOL eventBufferingEnabled; @@ -116,18 +145,31 @@ * * See the AdjustDelegate declaration above for details * - * @var delegate The delegate that might implement the optional delegate - * methods like adjustAttributionChanged, adjustTrackingSucceeded or adjustTrackingFailed: + * @var delegate The delegate that might implement the optional delegate methods */ @property (nonatomic, weak) NSObject *delegate; /** * Enables sending in the background * - * @var sendInBackground Enable or disable sending in the background + * @var sendInBackground Enable or disable sending in the background */ @property (nonatomic, assign) BOOL sendInBackground; +/** + * Enables delayed start of the SDK + * + * @var delayStart Number of seconds after which SDK will start + */ +@property (nonatomic, assign) double delayStart; + +/** + * User agent for the requests. + * + * @var userAgent User agent value. + */ +@property (nonatomic, copy) NSString *userAgent; + @property (nonatomic, assign, readonly) BOOL hasResponseDelegate; @property (nonatomic, assign, readonly) BOOL hasAttributionChangedDelegate; diff --git a/Adjust/ADJConfig.m b/Adjust/ADJConfig.m index 8d17842c5..5c36732b0 100644 --- a/Adjust/ADJConfig.m +++ b/Adjust/ADJConfig.m @@ -10,39 +10,55 @@ #import "ADJAdjustFactory.h" #import "ADJLogger.h" #import "ADJUtil.h" +#import "Adjust.h" + +@interface ADJConfig() + +@property (nonatomic, weak) id logger; +@property (nonatomic, assign) BOOL allowSuppressLogLevel; + +@end @implementation ADJConfig -+ (ADJConfig *) configWithAppToken:(NSString *)appToken - environment:(NSString *)environment { ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment { return [[ADJConfig alloc] initWithAppToken:appToken environment:environment]; } -- (id) initWithAppToken:(NSString *)appToken - environment:(NSString *)environment ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel { - if (![self checkAppToken:appToken]) return self; - if (![self checkEnvironment:environment]) return self; + return [[ADJConfig alloc] initWithAppToken:appToken environment:environment allowSuppressLogLevel:allowSuppressLogLevel]; +} - return [self initSelfWithAppToken:appToken environment:environment]; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment +{ + return [self initWithAppToken:appToken + environment:environment + allowSuppressLogLevel:NO]; } -- (id) initWithoutCheckAppToken:(NSString *)appToken - environment:(NSString *)environment +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel { self = [super init]; if (self == nil) return nil; - return [self initSelfWithAppToken:appToken environment:environment]; -} + self.allowSuppressLogLevel = allowSuppressLogLevel; + self.logger = ADJAdjustFactory.logger; + // default values + [self setLogLevel:ADJLogLevelInfo environment:environment]; + + if (![self checkEnvironment:environment]) return self; + if (![self checkAppToken:appToken]) return self; -- (id) initSelfWithAppToken:(NSString *)appToken - environment:(NSString *)environment { _appToken = appToken; _environment = environment; - // default values - self.logLevel = ADJLogLevelInfo; _hasResponseDelegate = NO; _hasAttributionChangedDelegate = NO; self.eventBufferingEnabled = NO; @@ -50,59 +66,81 @@ - (id) initSelfWithAppToken:(NSString *)appToken return self; } -- (void) setDelegate:(NSObject *)delegate { +- (void)setLogLevel:(ADJLogLevel)logLevel { + [self setLogLevel:logLevel environment:self.environment]; +} + +- (void)setLogLevel:(ADJLogLevel)logLevel + environment:(NSString *)environment{ + if ([environment isEqualToString:ADJEnvironmentProduction]) { + if (self.allowSuppressLogLevel) { + _logLevel = ADJLogLevelSuppress; + } else { + _logLevel = ADJLogLevelAssert; + } + } else { + if (!self.allowSuppressLogLevel && + logLevel == ADJLogLevelSuppress) { + _logLevel = ADJLogLevelAssert; + } else { + _logLevel = logLevel; + } + } + [self.logger setLogLevel:self.logLevel]; +} + + +- (void)setDelegate:(NSObject *)delegate { _hasResponseDelegate = NO; _hasAttributionChangedDelegate = NO; BOOL implementsDeeplinkCallback = NO; - id logger = ADJAdjustFactory.logger; - if ([ADJUtil isNull:delegate]) { - [logger warn:@"Delegate is nil"]; + [self.logger warn:@"Delegate is nil"]; _delegate = nil; return; } if ([delegate respondsToSelector:@selector(adjustAttributionChanged:)]) { - [logger debug:@"Delegate implements adjustAttributionChanged:"]; + [self.logger debug:@"Delegate implements adjustAttributionChanged:"]; _hasResponseDelegate = YES; _hasAttributionChangedDelegate = YES; } if ([delegate respondsToSelector:@selector(adjustEventTrackingSucceeded:)]) { - [logger debug:@"Delegate implements adjustEventTrackingSucceeded:"]; + [self.logger debug:@"Delegate implements adjustEventTrackingSucceeded:"]; _hasResponseDelegate = YES; } if ([delegate respondsToSelector:@selector(adjustEventTrackingFailed:)]) { - [logger debug:@"Delegate implements adjustEventTrackingFailed:"]; + [self.logger debug:@"Delegate implements adjustEventTrackingFailed:"]; _hasResponseDelegate = YES; } if ([delegate respondsToSelector:@selector(adjustSessionTrackingSucceeded:)]) { - [logger debug:@"Delegate implements adjustSessionTrackingSucceeded:"]; + [self.logger debug:@"Delegate implements adjustSessionTrackingSucceeded:"]; _hasResponseDelegate = YES; } if ([delegate respondsToSelector:@selector(adjustSessionTrackingFailed:)]) { - [logger debug:@"Delegate implements adjustSessionTrackingFailed:"]; + [self.logger debug:@"Delegate implements adjustSessionTrackingFailed:"]; _hasResponseDelegate = YES; } if ([delegate respondsToSelector:@selector(adjustDeeplinkResponse:)]) { - [logger debug:@"Delegate implements adjustDeeplinkResponse:"]; + [self.logger debug:@"Delegate implements adjustDeeplinkResponse:"]; // does not enable hasDelegate flag implementsDeeplinkCallback = YES; } if (!(self.hasResponseDelegate || implementsDeeplinkCallback)) { - [logger error:@"Delegate does not implement any optional method"]; + [self.logger error:@"Delegate does not implement any optional method"]; _delegate = nil; return; } @@ -110,46 +148,45 @@ - (void) setDelegate:(NSObject *)delegate { _delegate = delegate; } -- (BOOL) checkEnvironment:(NSString *)environment +- (BOOL)checkEnvironment:(NSString *)environment { - id logger = ADJAdjustFactory.logger; if ([ADJUtil isNull:environment]) { - [logger error:@"Missing environment"]; + [self.logger error:@"Missing environment"]; return NO; } if ([environment isEqualToString:ADJEnvironmentSandbox]) { - [logger assert:@"SANDBOX: Adjust is running in Sandbox mode. Use this setting for testing. Don't forget to set the environment to `production` before publishing"]; + [self.logger assert:@"SANDBOX: Adjust is running in Sandbox mode. Use this setting for testing. Don't forget to set the environment to `production` before publishing"]; return YES; } else if ([environment isEqualToString:ADJEnvironmentProduction]) { - [logger assert:@"PRODUCTION: Adjust is running in Production mode. Use this setting only for the build that you want to publish. Set the environment to `sandbox` if you want to test your app!"]; + [self.logger assert:@"PRODUCTION: Adjust is running in Production mode. Use this setting only for the build that you want to publish. Set the environment to `sandbox` if you want to test your app!"]; return YES; } - [logger error:@"Unknown environment '%@'", environment]; + [self.logger error:@"Unknown environment '%@'", environment]; return NO; } - (BOOL)checkAppToken:(NSString *)appToken { if ([ADJUtil isNull:appToken]) { - [ADJAdjustFactory.logger error:@"Missing App Token"]; + [self.logger error:@"Missing App Token"]; return NO; } if (appToken.length != 12) { - [ADJAdjustFactory.logger error:@"Malformed App Token '%@'", appToken]; + [self.logger error:@"Malformed App Token '%@'", appToken]; return NO; } return YES; } -- (BOOL) isValid { +- (BOOL)isValid { return self.appToken != nil; } -(id)copyWithZone:(NSZone *)zone { - ADJConfig* copy = [[[self class] allocWithZone:zone] - initWithoutCheckAppToken:[self.appToken copyWithZone:zone] - environment:[self.environment copyWithZone:zone]]; + ADJConfig* copy = [[[self class] allocWithZone:zone] init]; if (copy) { + copy->_appToken = [self.appToken copyWithZone:zone]; + copy->_environment = [self.environment copyWithZone:zone]; copy.logLevel = self.logLevel; copy.sdkPrefix = [self.sdkPrefix copyWithZone:zone]; copy.defaultTracker = [self.defaultTracker copyWithZone:zone]; @@ -157,6 +194,8 @@ -(id)copyWithZone:(NSZone *)zone copy->_hasResponseDelegate = self.hasResponseDelegate; copy->_hasAttributionChangedDelegate = self.hasAttributionChangedDelegate; copy.sendInBackground = self.sendInBackground; + copy.delayStart = self.delayStart; + copy.userAgent = [self.userAgent copyWithZone:zone]; // adjust delegate not copied } diff --git a/Adjust/ADJDeviceInfo.h b/Adjust/ADJDeviceInfo.h index baf59492d..4465eded2 100644 --- a/Adjust/ADJDeviceInfo.h +++ b/Adjust/ADJDeviceInfo.h @@ -8,7 +8,7 @@ #import -@interface ADJDeviceInfo : NSObject +@interface ADJDeviceInfo : NSObject @property (nonatomic, copy) NSString *idForAdvertisers; @property (nonatomic, copy) NSString *fbAttributionId; @@ -26,8 +26,9 @@ @property (nonatomic, copy) NSString *countryCode; @property (nonatomic, copy) NSString *machineModel; @property (nonatomic, copy) NSString *cpuSubtype; +@property (nonatomic, copy) NSString *installReceiptBase64; -- (id) initWithSdkPrefix:(NSString *)sdkPrefix; +- (id)initWithSdkPrefix:(NSString *)sdkPrefix; + (ADJDeviceInfo *)deviceInfoWithSdkPrefix:(NSString *)sdkPrefix; @end diff --git a/Adjust/ADJDeviceInfo.m b/Adjust/ADJDeviceInfo.m index 899a1b367..992ab904c 100644 --- a/Adjust/ADJDeviceInfo.m +++ b/Adjust/ADJDeviceInfo.m @@ -11,6 +11,7 @@ #import "NSString+ADJAdditions.h" #import "ADJUtil.h" #import "ADJSystemProfile.h" +#import "NSData+ADJAdditions.h" @implementation ADJDeviceInfo @@ -18,7 +19,7 @@ + (ADJDeviceInfo *) deviceInfoWithSdkPrefix:(NSString *)sdkPrefix { return [[ADJDeviceInfo alloc] initWithSdkPrefix:sdkPrefix]; } -- (id) initWithSdkPrefix:(NSString *)sdkPrefix { +- (id)initWithSdkPrefix:(NSString *)sdkPrefix { self = [super init]; if (self == nil) return nil; @@ -49,9 +50,27 @@ - (id) initWithSdkPrefix:(NSString *)sdkPrefix { self.clientSdk = [NSString stringWithFormat:@"%@@%@", sdkPrefix, ADJUtil.clientSdk]; } + [self injectInstallReceipt:bundle]; + return self; } +- (void)injectInstallReceipt:(NSBundle *)bundle{ + @try { + if (![bundle respondsToSelector:@selector(appStoreReceiptURL)]) { + return; + } + NSURL * installReceiptLocation = [bundle appStoreReceiptURL]; + if (installReceiptLocation == nil) return; + + NSData * installReceiptData = [NSData dataWithContentsOfURL:installReceiptLocation]; + if (installReceiptData == nil) return; + + self.installReceiptBase64 = [installReceiptData adjEncodeBase64]; + } @catch (NSException *exception) { + } +} +/* -(id)copyWithZone:(NSZone *)zone { ADJDeviceInfo* copy = [[[self class] allocWithZone:zone] init]; @@ -76,5 +95,6 @@ -(id)copyWithZone:(NSZone *)zone return copy; } +*/ @end diff --git a/Adjust/ADJEvent.m b/Adjust/ADJEvent.m index 56742249a..3b585b184 100644 --- a/Adjust/ADJEvent.m +++ b/Adjust/ADJEvent.m @@ -12,9 +12,9 @@ #pragma mark - @interface ADJEvent() -@property (nonatomic, retain) id logger; -@property (nonatomic, retain) NSMutableDictionary* callbackMutableParameters; -@property (nonatomic, retain) NSMutableDictionary* partnerMutableParameters; +@property (nonatomic, weak) id logger; +@property (nonatomic, strong) NSMutableDictionary* callbackMutableParameters; +@property (nonatomic, strong) NSMutableDictionary* partnerMutableParameters; @end @implementation ADJEvent @@ -27,7 +27,7 @@ - (id) initWithEventToken:(NSString *)eventToken { self = [super init]; if (self == nil) return nil; - self.logger = ADJAdjustFactory.logger; + self.logger = ADJAdjustFactory.logger; if (![self checkEventToken:eventToken]) return self; @@ -39,13 +39,13 @@ - (id) initWithEventToken:(NSString *)eventToken { - (void) addCallbackParameter:(NSString *)key value:(NSString *)value { - if (![self isValidParameter:key - attributeType:@"key" - parameterName:@"Callback"]) return; + if (![ADJUtil isValidParameter:key + attributeType:@"key" + parameterName:@"Callback"]) return; - if (![self isValidParameter:value - attributeType:@"value" - parameterName:@"Callback"]) return; + if (![ADJUtil isValidParameter:value + attributeType:@"value" + parameterName:@"Callback"]) return; if (self.callbackMutableParameters == nil) { self.callbackMutableParameters = [[NSMutableDictionary alloc] init]; @@ -61,13 +61,13 @@ - (void) addCallbackParameter:(NSString *)key - (void) addPartnerParameter:(NSString *)key value:(NSString *)value { - if (![self isValidParameter:key - attributeType:@"key" - parameterName:@"Partner"]) return; + if (![ADJUtil isValidParameter:key + attributeType:@"key" + parameterName:@"Partner"]) return; - if (![self isValidParameter:value - attributeType:@"value" - parameterName:@"Partner"]) return; + if (![ADJUtil isValidParameter:value + attributeType:@"value" + parameterName:@"Partner"]) return; if (self.partnerMutableParameters == nil) { self.partnerMutableParameters = [[NSMutableDictionary alloc] init]; @@ -166,43 +166,18 @@ - (BOOL) checkReceipt:(NSData *)receipt transactionId:(NSString *)transactionId return YES; } -- (BOOL) isValidParameter:(NSString *)attribute - attributeType:(NSString *)attributeType - parameterName:(NSString *)parameterName -{ - if ([ADJUtil isNull:attribute]) { - [self.logger error:@"%@ parameter %@ is missing", parameterName, attributeType]; - return NO; - } - - if ([attribute isEqualToString:@""]) { - [self.logger error:@"%@ parameter %@ is empty", parameterName, attributeType]; - return NO; - } - - return YES; -} - -(id)copyWithZone:(NSZone *)zone { - ADJEvent* copy = [[[self class] allocWithZone:zone] - initWithEventToken:[self.eventToken copyWithZone:zone]]; + ADJEvent* copy = [[[self class] allocWithZone:zone] init]; if (copy) { - if (self.revenue != nil) { - double amount = [[self.revenue copyWithZone:zone] doubleValue]; - [copy setRevenue:amount currency:[self.currency copyWithZone:zone]]; - } + copy->_eventToken = [self.eventToken copyWithZone:zone]; + copy->_revenue = [self.revenue copyWithZone:zone]; + copy->_currency = [self.currency copyWithZone:zone]; copy.callbackMutableParameters = [self.callbackMutableParameters copyWithZone:zone]; copy.partnerMutableParameters = [self.partnerMutableParameters copyWithZone:zone]; - if (self.emptyReceipt) { - [copy setReceipt:self.receipt transactionId:self.transactionId]; - } else if (self.transactionId != nil) { - if (self.receipt != nil) { - [copy setReceipt:self.receipt transactionId:self.transactionId]; - } else { - [copy setTransactionId:self.transactionId]; - } - } + copy->_transactionId = [self.transactionId copyWithZone:zone]; + copy->_receipt = [self.receipt copyWithZone:zone]; + copy->_emptyReceipt = self.emptyReceipt; } return copy; } diff --git a/Adjust/ADJEventFailure.h b/Adjust/ADJEventFailure.h index 8bec40a6d..46ef36d16 100644 --- a/Adjust/ADJEventFailure.h +++ b/Adjust/ADJEventFailure.h @@ -26,7 +26,7 @@ @property (nonatomic, assign) BOOL willRetry; // the server response in json format -@property (nonatomic, retain) NSDictionary *jsonResponse; +@property (nonatomic, strong) NSDictionary *jsonResponse; + (ADJEventFailure *)eventFailureResponseData; - (id)init; diff --git a/Adjust/ADJEventSuccess.h b/Adjust/ADJEventSuccess.h index f1efd0494..ce2abb1bd 100644 --- a/Adjust/ADJEventSuccess.h +++ b/Adjust/ADJEventSuccess.h @@ -23,7 +23,7 @@ @property (nonatomic, copy) NSString * eventToken; // the server response in json format -@property (nonatomic, retain) NSDictionary *jsonResponse; +@property (nonatomic, strong) NSDictionary *jsonResponse; + (ADJEventSuccess *)eventSuccessResponseData; - (id)init; diff --git a/Adjust/ADJKeychain.h b/Adjust/ADJKeychain.h new file mode 100644 index 000000000..18ceab0a3 --- /dev/null +++ b/Adjust/ADJKeychain.h @@ -0,0 +1,16 @@ +// +// ADJKeychain.h +// Adjust +// +// Created by Uglješa Erceg on 25/08/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJKeychain : NSObject + ++ (NSString *)valueForKeychainKey:(NSString *)key service:(NSString *)service; ++ (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service; + +@end diff --git a/Adjust/ADJKeychain.m b/Adjust/ADJKeychain.m new file mode 100644 index 000000000..3ebe33428 --- /dev/null +++ b/Adjust/ADJKeychain.m @@ -0,0 +1,116 @@ +// +// ADJKeychain.m +// Adjust +// +// Created by Uglješa Erceg on 25/08/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import "ADJLogger.h" +#import "ADJKeychain.h" +#import "ADJAdjustFactory.h" + +@implementation ADJKeychain + ++ (id)getInstance { + static ADJKeychain *defaultInstance = nil; + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + defaultInstance = [[self alloc] init]; + }); + + return defaultInstance; +} + +- (id)init { + self = [super init]; + + if (self == nil) { + return nil; + } + + return self; +} + ++ (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { + return [[ADJKeychain getInstance] setValue:value forKeychainKey:key inService:service]; +} + ++ (NSString *)valueForKeychainKey:(NSString *)key service:(NSString *)service { + return [[ADJKeychain getInstance] valueForKeychainKey:key service:service]; +} + +- (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { + OSStatus status = [self setValueWithStatus:value forKeychainKey:key inService:service]; + + if (status != noErr) { + [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain"]; + return NO; + } else { + // Check was writing successful. + BOOL wasSuccessful = [self wasWritingSuccessful:value forKeychainKey:key inService:service]; + + if (wasSuccessful) { + [[ADJAdjustFactory logger] verbose:@"Value successfully written to the keychain"]; + } else { + [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain after the check"]; + } + + return wasSuccessful; + } +} + +- (NSString *)valueForKeychainKey:(NSString *)key service:(NSString *)service { + CFDictionaryRef result = nil; + NSMutableDictionary *keychainItem = [self keychainItemForKey:key service:service]; + + keychainItem[(__bridge id)kSecReturnData] = (__bridge id)kCFBooleanTrue; + keychainItem[(__bridge id)kSecReturnAttributes] = (__bridge id)kCFBooleanTrue; + + OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)keychainItem, (CFTypeRef *)&result); + + if (status != noErr) { + return nil; + } + + NSDictionary *resultDict = (__bridge_transfer NSDictionary *)result; + NSData *data = resultDict[(__bridge id)kSecValueData]; + + if (!data) { + return nil; + } + + return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; +} + +- (NSMutableDictionary *)keychainItemForKey:(NSString *)key service:(NSString *)service { + NSMutableDictionary *keychainItem = [[NSMutableDictionary alloc] init]; + + keychainItem[(__bridge id)kSecClass] = (__bridge id)kSecClassGenericPassword; + keychainItem[(__bridge id)kSecAttrAccessible] = (__bridge id)kSecAttrAccessibleAlways; + keychainItem[(__bridge id)kSecAttrAccount] = key; + keychainItem[(__bridge id)kSecAttrService] = service; + + return keychainItem; +} + +- (OSStatus)setValueWithStatus:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { + NSMutableDictionary *keychainItem = [self keychainItemForKey:key service:service]; + + keychainItem[(__bridge id)kSecValueData] = [value dataUsingEncoding:NSUTF8StringEncoding]; + + return SecItemAdd((__bridge CFDictionaryRef)keychainItem, NULL); +} + +- (BOOL)wasWritingSuccessful:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { + NSString *writtenValue = [self valueForKeychainKey:key service:service]; + + if ([writtenValue isEqualToString:value]) { + return YES; + } else { + return NO; + } +} + +@end diff --git a/Adjust/ADJLogger.h b/Adjust/ADJLogger.h index ea003c724..89f02f159 100644 --- a/Adjust/ADJLogger.h +++ b/Adjust/ADJLogger.h @@ -8,18 +8,20 @@ #import typedef enum { - ADJLogLevelVerbose = 1, - ADJLogLevelDebug = 2, - ADJLogLevelInfo = 3, - ADJLogLevelWarn = 4, - ADJLogLevelError = 5, - ADJLogLevelAssert = 6 + ADJLogLevelVerbose = 1, + ADJLogLevelDebug = 2, + ADJLogLevelInfo = 3, + ADJLogLevelWarn = 4, + ADJLogLevelError = 5, + ADJLogLevelAssert = 6, + ADJLogLevelSuppress = 7 } ADJLogLevel; // A simple logger with multiple log levels. @protocol ADJLogger - (void)setLogLevel:(ADJLogLevel)logLevel; +- (void)lockLogLevel; - (void)verbose:(NSString *)message, ...; - (void)debug: (NSString *)message, ...; diff --git a/Adjust/ADJLogger.m b/Adjust/ADJLogger.m index 745e46a5b..002e7ef71 100644 --- a/Adjust/ADJLogger.m +++ b/Adjust/ADJLogger.m @@ -13,15 +13,33 @@ @interface ADJLogger() @property (nonatomic, assign) ADJLogLevel loglevel; +@property (nonatomic, assign) BOOL logLevelLocked; @end #pragma mark - @implementation ADJLogger +- (id)init { + self = [super init]; + if (self == nil) return nil; + + //default values + self.logLevelLocked = NO; + _loglevel = ADJLogLevelInfo; + + return self; +} - (void)setLogLevel:(ADJLogLevel)logLevel { - self.loglevel = logLevel; + if (self.logLevelLocked) { + return; + } + _loglevel = logLevel; +} + +- (void)lockLogLevel { + self.logLevelLocked = YES; } - (void)verbose:(NSString *)format, ... { diff --git a/Adjust/ADJPackageBuilder.h b/Adjust/ADJPackageBuilder.h index 79e23c57a..9378bc9ac 100644 --- a/Adjust/ADJPackageBuilder.h +++ b/Adjust/ADJPackageBuilder.h @@ -5,31 +5,43 @@ // Created by Christian Wellenbrock on 2013-07-03. // Copyright (c) 2013 adjust GmbH. All rights reserved. // -#import + #import "ADJEvent.h" +#import "ADJConfig.h" #import "ADJDeviceInfo.h" #import "ADJActivityState.h" #import "ADJActivityPackage.h" -#import "ADJConfig.h" +#import "ADJSessionParameters.h" + +#import @interface ADJPackageBuilder : NSObject -@property (nonatomic, copy) ADJAttribution *attribution; -@property (nonatomic, copy) NSDate *purchaseTime; @property (nonatomic, copy) NSDate *clickTime; -@property (nonatomic, retain) NSDictionary *iadDetails; -@property (nonatomic, retain) NSDictionary* deeplinkParameters; +@property (nonatomic, copy) NSDate *purchaseTime; + @property (nonatomic, copy) NSString *deeplink; @property (nonatomic, copy) NSString *deviceToken; -- (id) initWithDeviceInfo:(ADJDeviceInfo *)deviceInfo - activityState:(ADJActivityState *)activityState - config:(ADJConfig *)adjustConfig - createdAt:(double)createdAt; +@property (nonatomic, strong) NSDictionary *iadDetails; +@property (nonatomic, strong) NSDictionary* deeplinkParameters; -- (ADJActivityPackage *)buildSessionPackage; -- (ADJActivityPackage *)buildEventPackage:(ADJEvent *)event; -- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource; +@property (nonatomic, copy) ADJAttribution *attribution; + +- (id)initWithDeviceInfo:(ADJDeviceInfo *)deviceInfo + activityState:(ADJActivityState *)activityState + config:(ADJConfig *)adjustConfig + createdAt:(double)createdAt; + +- (ADJActivityPackage *)buildSessionPackage:(ADJSessionParameters *)sessionParameters + isInDelay:(BOOL)isInDelay; - (ADJActivityPackage *)buildAttributionPackage; +- (ADJActivityPackage *)buildEventPackage:(ADJEvent *)event + sessionParameters:(ADJSessionParameters *)sessionParameters + isInDelay:(BOOL)isInDelay; +- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource; + ++ (void)parameters:(NSMutableDictionary *)parameters setDictionary:(NSDictionary *)dictionary forKey:(NSString *)key; ++ (void)parameters:(NSMutableDictionary *)parameters setString:(NSString *)value forKey:(NSString *)key; @end diff --git a/Adjust/ADJPackageBuilder.m b/Adjust/ADJPackageBuilder.m index ec6a80e8d..a1fe38c14 100644 --- a/Adjust/ADJPackageBuilder.m +++ b/Adjust/ADJPackageBuilder.m @@ -6,45 +6,56 @@ // Copyright (c) 2013 adjust GmbH. All rights reserved. // -#import "ADJPackageBuilder.h" -#import "ADJActivityPackage.h" #import "ADJUtil.h" #import "ADJAttribution.h" +#import "ADJPackageBuilder.h" +#import "ADJActivityPackage.h" #import "NSData+ADJAdditions.h" +#import "ADJAdjustFactory.h" @interface ADJPackageBuilder() -@property (nonatomic, copy) ADJDeviceInfo* deviceInfo; -@property (nonatomic, copy) ADJActivityState *activityState; -@property (nonatomic, copy) ADJConfig *adjustConfig; @property (nonatomic, assign) double createdAt; +@property (nonatomic, weak) ADJDeviceInfo* deviceInfo; +@property (nonatomic, copy) ADJActivityState *activityState; +@property (nonatomic, weak) ADJConfig *adjustConfig; + @end -#pragma mark - @implementation ADJPackageBuilder +#pragma mark - Object lifecycle methods + - (id)initWithDeviceInfo:(ADJDeviceInfo *)deviceInfo activityState:(ADJActivityState *)activityState config:(ADJConfig *)adjustConfig - createdAt:(double)createdAt -{ + createdAt:(double)createdAt { self = [super init]; - if (self == nil) return nil; + if (self == nil) { + return nil; + } + + self.createdAt = createdAt; self.deviceInfo = deviceInfo; - self.activityState = activityState; self.adjustConfig = adjustConfig; - self.createdAt = createdAt; + self.activityState = activityState; return self; } -- (ADJActivityPackage *)buildSessionPackage { - NSMutableDictionary *parameters = [self defaultParameters]; - [self parameters:parameters setDuration:self.activityState.lastInterval forKey:@"last_interval"]; - [self parameters:parameters setString:self.adjustConfig.defaultTracker forKey:@"default_tracker"]; +#pragma mark - Public methods +- (ADJActivityPackage *)buildSessionPackage:(ADJSessionParameters *)sessionParameters + isInDelay:(BOOL)isInDelay { + NSMutableDictionary *parameters = [self defaultParameters]; + [ADJPackageBuilder parameters:parameters setDuration:self.activityState.lastInterval forKey:@"last_interval"]; + [ADJPackageBuilder parameters:parameters setString:self.adjustConfig.defaultTracker forKey:@"default_tracker"]; + if (!isInDelay) { + [ADJPackageBuilder parameters:parameters setDictionary:sessionParameters.callbackParameters forKey:@"callback_params"]; + [ADJPackageBuilder parameters:parameters setDictionary:sessionParameters.partnerParameters forKey:@"partner_params"]; + } ADJActivityPackage *sessionPackage = [self defaultActivityPackage]; sessionPackage.path = @"/session"; sessionPackage.activityKind = ADJActivityKindSession; @@ -54,25 +65,34 @@ - (ADJActivityPackage *)buildSessionPackage { return sessionPackage; } -- (ADJActivityPackage *)buildEventPackage:(ADJEvent *) event{ +- (ADJActivityPackage *)buildEventPackage:(ADJEvent *)event + sessionParameters:(ADJSessionParameters *)sessionParameters + isInDelay:(BOOL)isInDelay { NSMutableDictionary *parameters = [self defaultParameters]; - [self parameters:parameters setInt:self.activityState.eventCount forKey:@"event_count"]; - [self parameters:parameters setNumber:event.revenue forKey:@"revenue"]; - [self parameters:parameters setString:event.currency forKey:@"currency"]; - [self parameters:parameters setString:event.eventToken forKey:@"event_token"]; - - [self parameters:parameters setDictionary:event.callbackParameters forKey:@"callback_params"]; - [self parameters:parameters setDictionary:event.partnerParameters forKey:@"partner_params"]; - + [ADJPackageBuilder parameters:parameters setInt:self.activityState.eventCount forKey:@"event_count"]; + [ADJPackageBuilder parameters:parameters setNumber:event.revenue forKey:@"revenue"]; + [ADJPackageBuilder parameters:parameters setString:event.currency forKey:@"currency"]; + [ADJPackageBuilder parameters:parameters setString:event.eventToken forKey:@"event_token"]; + + if (!isInDelay) { + NSDictionary * mergedCallbackParameters = [ADJUtil mergeParameters:sessionParameters.callbackParameters + source:event.callbackParameters + parameterName:@"Callback"]; + NSDictionary * mergedPartnerParameters = [ADJUtil mergeParameters:sessionParameters.partnerParameters + source:event.partnerParameters + parameterName:@"Partner"]; + [ADJPackageBuilder parameters:parameters setDictionary:mergedCallbackParameters forKey:@"callback_params"]; + [ADJPackageBuilder parameters:parameters setDictionary:mergedPartnerParameters forKey:@"partner_params"]; + } if (event.emptyReceipt) { NSString *emptyReceipt = @"empty"; - [self parameters:parameters setString:emptyReceipt forKey:@"receipt"]; - [self parameters:parameters setString:event.transactionId forKey:@"transaction_id"]; + [ADJPackageBuilder parameters:parameters setString:emptyReceipt forKey:@"receipt"]; + [ADJPackageBuilder parameters:parameters setString:event.transactionId forKey:@"transaction_id"]; } else if (event.receipt != nil) { NSString *receiptBase64 = [event.receipt adjEncodeBase64]; - [self parameters:parameters setString:receiptBase64 forKey:@"receipt"]; - [self parameters:parameters setString:event.transactionId forKey:@"transaction_id"]; + [ADJPackageBuilder parameters:parameters setString:receiptBase64 forKey:@"receipt"]; + [ADJPackageBuilder parameters:parameters setString:event.transactionId forKey:@"transaction_id"]; } ADJActivityPackage *eventPackage = [self defaultActivityPackage]; @@ -81,27 +101,31 @@ - (ADJActivityPackage *)buildEventPackage:(ADJEvent *) event{ eventPackage.suffix = [self eventSuffix:event]; eventPackage.parameters = parameters; + if (isInDelay) { + eventPackage.callbackParameters = event.callbackParameters; + eventPackage.partnerParameters = event.partnerParameters; + } + return eventPackage; } -- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource -{ +- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource { NSMutableDictionary *parameters = [self idsParameters]; - [self parameters:parameters setString:clickSource forKey:@"source"]; - [self parameters:parameters setDictionary:self.deeplinkParameters forKey:@"params"]; - [self parameters:parameters setDate:self.clickTime forKey:@"click_time"]; - [self parameters:parameters setDate:self.purchaseTime forKey:@"purchase_time"]; + [ADJPackageBuilder parameters:parameters setString:clickSource forKey:@"source"]; + [ADJPackageBuilder parameters:parameters setDictionary:self.deeplinkParameters forKey:@"params"]; + [ADJPackageBuilder parameters:parameters setDate:self.clickTime forKey:@"click_time"]; + [ADJPackageBuilder parameters:parameters setDate:self.purchaseTime forKey:@"purchase_time"]; if (self.attribution != nil) { - [self parameters:parameters setString:self.attribution.trackerName forKey:@"tracker"]; - [self parameters:parameters setString:self.attribution.campaign forKey:@"campaign"]; - [self parameters:parameters setString:self.attribution.adgroup forKey:@"adgroup"]; - [self parameters:parameters setString:self.attribution.creative forKey:@"creative"]; + [ADJPackageBuilder parameters:parameters setString:self.attribution.trackerName forKey:@"tracker"]; + [ADJPackageBuilder parameters:parameters setString:self.attribution.campaign forKey:@"campaign"]; + [ADJPackageBuilder parameters:parameters setString:self.attribution.adgroup forKey:@"adgroup"]; + [ADJPackageBuilder parameters:parameters setString:self.attribution.creative forKey:@"creative"]; } - [self parameters:parameters setDictionary:self.iadDetails forKey:@"details"]; - [self parameters:parameters setString:self.deeplink forKey:@"deeplink"]; - [self parameters:parameters setString:self.deviceToken forKey:@"push_token"]; + [ADJPackageBuilder parameters:parameters setDictionary:self.iadDetails forKey:@"details"]; + [ADJPackageBuilder parameters:parameters setString:self.deeplink forKey:@"deeplink"]; + [ADJPackageBuilder parameters:parameters setString:self.deviceToken forKey:@"push_token"]; ADJActivityPackage *clickPackage = [self defaultActivityPackage]; clickPackage.path = @"/sdk_click"; @@ -124,20 +148,20 @@ - (ADJActivityPackage *)buildAttributionPackage { return attributionPackage; } -#pragma mark private +#pragma mark - Private & helper methods - (ADJActivityPackage *)defaultActivityPackage { ADJActivityPackage *activityPackage = [[ADJActivityPackage alloc] init]; activityPackage.clientSdk = self.deviceInfo.clientSdk; + return activityPackage; } - (NSMutableDictionary *)idsParameters { NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; - [self injectDeviceInfoIds:self.deviceInfo - intoParameters:parameters]; - [self injectConfig:self.adjustConfig intoParameters:parameters]; - [self injectCreatedAt:self.createdAt intoParameters:parameters]; + [self injectDeviceInfoIds:self.deviceInfo intoParameters:parameters]; + [self injectConfig:self.adjustConfig intoParameters:parameters]; + [self injectCommonParameters:parameters]; return parameters; } @@ -145,20 +169,24 @@ - (NSMutableDictionary *)idsParameters { - (NSMutableDictionary *)defaultParameters { NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; - [self injectDeviceInfo:self.deviceInfo - intoParameters:parameters]; - [self injectConfig:self.adjustConfig intoParameters:parameters]; - [self injectActivityState:self.activityState intoParamters:parameters]; - [self injectCreatedAt:self.createdAt intoParameters:parameters]; + [self injectDeviceInfo:self.deviceInfo intoParameters:parameters]; + [self injectConfig:self.adjustConfig intoParameters:parameters]; + [self injectActivityState:self.activityState intoParamters:parameters]; + [self injectCommonParameters:parameters]; return parameters; } +- (void)injectCommonParameters:(NSMutableDictionary *)parameters { + [ADJPackageBuilder parameters:parameters setDate1970:self.createdAt forKey:@"created_at"]; + [ADJPackageBuilder parameters:parameters setBool:YES forKey:@"attribution_deeplink"]; +} + - (void) injectDeviceInfoIds:(ADJDeviceInfo *)deviceInfo intoParameters:(NSMutableDictionary *) parameters { - [self parameters:parameters setString:deviceInfo.idForAdvertisers forKey:@"idfa"]; - [self parameters:parameters setString:deviceInfo.vendorId forKey:@"idfv"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.idForAdvertisers forKey:@"idfa"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.vendorId forKey:@"idfv"]; } - (void) injectDeviceInfo:(ADJDeviceInfo *)deviceInfo @@ -166,47 +194,51 @@ - (void) injectDeviceInfo:(ADJDeviceInfo *)deviceInfo { [self injectDeviceInfoIds:deviceInfo intoParameters:parameters]; - [self parameters:parameters setString:deviceInfo.fbAttributionId forKey:@"fb_id"]; - [self parameters:parameters setInt:deviceInfo.trackingEnabled forKey:@"tracking_enabled"]; - [self parameters:parameters setString:deviceInfo.bundeIdentifier forKey:@"bundle_id"]; - [self parameters:parameters setString:deviceInfo.bundleVersion forKey:@"app_version"]; - [self parameters:parameters setString:deviceInfo.bundleShortVersion forKey:@"app_version_short"]; - [self parameters:parameters setString:deviceInfo.deviceType forKey:@"device_type"]; - [self parameters:parameters setString:deviceInfo.deviceName forKey:@"device_name"]; - [self parameters:parameters setString:deviceInfo.osName forKey:@"os_name"]; - [self parameters:parameters setString:deviceInfo.systemVersion forKey:@"os_version"]; - [self parameters:parameters setString:deviceInfo.languageCode forKey:@"language"]; - [self parameters:parameters setString:deviceInfo.countryCode forKey:@"country"]; - [self parameters:parameters setString:deviceInfo.machineModel forKey:@"hardware_name"]; - [self parameters:parameters setString:deviceInfo.cpuSubtype forKey:@"cpu_type"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.fbAttributionId forKey:@"fb_id"]; + [ADJPackageBuilder parameters:parameters setInt:deviceInfo.trackingEnabled forKey:@"tracking_enabled"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.bundeIdentifier forKey:@"bundle_id"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.bundleVersion forKey:@"app_version"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.bundleShortVersion forKey:@"app_version_short"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.deviceType forKey:@"device_type"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.deviceName forKey:@"device_name"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.osName forKey:@"os_name"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.systemVersion forKey:@"os_version"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.languageCode forKey:@"language"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.countryCode forKey:@"country"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.machineModel forKey:@"hardware_name"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.cpuSubtype forKey:@"cpu_type"]; + [ADJPackageBuilder parameters:parameters setString:deviceInfo.installReceiptBase64 forKey:@"install_receipt"]; } - (void)injectConfig:(ADJConfig*) adjustConfig intoParameters:(NSMutableDictionary *) parameters { - [self parameters:parameters setString:adjustConfig.appToken forKey:@"app_token"]; - [self parameters:parameters setString:adjustConfig.environment forKey:@"environment"]; - [self parameters:parameters setBool:adjustConfig.hasResponseDelegate forKey:@"needs_response_details"]; - [self parameters:parameters setBool:adjustConfig.eventBufferingEnabled forKey:@"event_buffering_enabled"]; + [ADJPackageBuilder parameters:parameters setString:adjustConfig.appToken forKey:@"app_token"]; + [ADJPackageBuilder parameters:parameters setString:adjustConfig.environment forKey:@"environment"]; + [ADJPackageBuilder parameters:parameters setBool:adjustConfig.hasResponseDelegate forKey:@"needs_response_details"]; + [ADJPackageBuilder parameters:parameters setBool:adjustConfig.eventBufferingEnabled forKey:@"event_buffering_enabled"]; } - (void) injectActivityState:(ADJActivityState *)activityState intoParamters:(NSMutableDictionary *)parameters { - [self parameters:parameters setInt:activityState.sessionCount forKey:@"session_count"]; - [self parameters:parameters setInt:activityState.subsessionCount forKey:@"subsession_count"]; - [self parameters:parameters setDuration:activityState.sessionLength forKey:@"session_length"]; - [self parameters:parameters setDuration:activityState.timeSpent forKey:@"time_spent"]; - [self parameters:parameters setString:activityState.uuid forKey:@"ios_uuid"]; + [ADJPackageBuilder parameters:parameters setInt:activityState.sessionCount forKey:@"session_count"]; + [ADJPackageBuilder parameters:parameters setInt:activityState.subsessionCount forKey:@"subsession_count"]; + [ADJPackageBuilder parameters:parameters setDuration:activityState.sessionLength forKey:@"session_length"]; + [ADJPackageBuilder parameters:parameters setDuration:activityState.timeSpent forKey:@"time_spent"]; + [ADJPackageBuilder parameters:parameters setString:activityState.uuid forKey:@"ios_uuid"]; + + // Check if UUID was persisted or not. + // If yes, assign it to persistent_ios_uuid parameter. + // If not, assign it to ios_uuid parameter. + if (activityState.isPersisted) { + [ADJPackageBuilder parameters:parameters setString:activityState.uuid forKey:@"persistent_ios_uuid"]; + } else { + [ADJPackageBuilder parameters:parameters setString:activityState.uuid forKey:@"ios_uuid"]; + } } -- (void)injectCreatedAt:(double) createdAt - intoParameters:(NSMutableDictionary *) parameters -{ - [self parameters:parameters setDate1970:createdAt forKey:@"created_at"]; -} - -- (NSString *)eventSuffix:(ADJEvent*)event { +- (NSString *)eventSuffix:(ADJEvent *)event { if (event.revenue == nil) { return [NSString stringWithFormat:@"'%@'", event.eventToken]; } else { @@ -214,72 +246,75 @@ - (NSString *)eventSuffix:(ADJEvent*)event { } } -- (void)parameters:(NSMutableDictionary *)parameters setString:(NSString *)value forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setString:(NSString *)value forKey:(NSString *)key { if (value == nil || [value isEqualToString:@""]) return; [parameters setObject:value forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setInt:(int)value forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setInt:(int)value forKey:(NSString *)key { if (value < 0) return; NSString *valueString = [NSString stringWithFormat:@"%d", value]; - [self parameters:parameters setString:valueString forKey:key]; + [ADJPackageBuilder parameters:parameters setString:valueString forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setDate1970:(double)value forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setDate1970:(double)value forKey:(NSString *)key { if (value < 0) return; NSString *dateString = [ADJUtil formatSeconds1970:value]; - [self parameters:parameters setString:dateString forKey:key]; + [ADJPackageBuilder parameters:parameters setString:dateString forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setDate:(NSDate *)value forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setDate:(NSDate *)value forKey:(NSString *)key { if (value == nil) return; NSString *dateString = [ADJUtil formatDate:value]; - [self parameters:parameters setString:dateString forKey:key]; + [ADJPackageBuilder parameters:parameters setString:dateString forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setDuration:(double)value forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setDuration:(double)value forKey:(NSString *)key { if (value < 0) return; int intValue = round(value); - [self parameters:parameters setInt:intValue forKey:key]; + [ADJPackageBuilder parameters:parameters setInt:intValue forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setDictionaryJson:(NSDictionary *)dictionary forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setDictionaryJson:(NSDictionary *)dictionary forKey:(NSString *)key { if (dictionary == nil) return; if (dictionary.count == 0) return; if (![NSJSONSerialization isValidJSONObject:dictionary]) return; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:nil]; NSString *dictionaryString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; - [self parameters:parameters setString:dictionaryString forKey:key]; + [ADJPackageBuilder parameters:parameters setString:dictionaryString forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setDictionary:(NSDictionary *)dictionary forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setDictionary:(NSDictionary *)dictionary forKey:(NSString *)key { if (dictionary == nil) return; if (dictionary.count == 0) return; + if (dictionary.count == 0) { + return; + } + NSDictionary * convertedDictionary = [ADJUtil convertDictionaryValues:dictionary]; - [self parameters:parameters setDictionaryJson:convertedDictionary forKey:key]; + [ADJPackageBuilder parameters:parameters setDictionaryJson:convertedDictionary forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setBool:(BOOL)value forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setBool:(BOOL)value forKey:(NSString *)key { int valueInt = [[NSNumber numberWithBool:value] intValue]; - [self parameters:parameters setInt:valueInt forKey:key]; + [ADJPackageBuilder parameters:parameters setInt:valueInt forKey:key]; } -- (void)parameters:(NSMutableDictionary *)parameters setNumber:(NSNumber *)value forKey:(NSString *)key { ++ (void)parameters:(NSMutableDictionary *)parameters setNumber:(NSNumber *)value forKey:(NSString *)key { if (value == nil) return; NSString *numberString = [NSString stringWithFormat:@"%.5f", [value doubleValue]]; - [self parameters:parameters setString:numberString forKey:key]; + [ADJPackageBuilder parameters:parameters setString:numberString forKey:key]; } @end - diff --git a/Adjust/ADJPackageHandler.h b/Adjust/ADJPackageHandler.h index 88dbbbb4c..a18d6c206 100644 --- a/Adjust/ADJPackageHandler.h +++ b/Adjust/ADJPackageHandler.h @@ -11,6 +11,7 @@ #import "ADJPackageHandler.h" #import "ADJActivityHandler.h" #import "ADJResponseData.h" +#import "ADJSessionParameters.h" @protocol ADJPackageHandler @@ -24,7 +25,8 @@ activityPackage:(ADJActivityPackage *)activityPackage; - (void)pauseSending; - (void)resumeSending; - +- (void)updatePackages:(ADJSessionParameters *)sessionParameters; +- (void)teardown:(BOOL)deleteState; @end @interface ADJPackageHandler : NSObject diff --git a/Adjust/ADJPackageHandler.m b/Adjust/ADJPackageHandler.m index 1715ded7b..779ceaf5b 100644 --- a/Adjust/ADJPackageHandler.m +++ b/Adjust/ADJPackageHandler.m @@ -12,6 +12,7 @@ #import "ADJUtil.h" #import "ADJAdjustFactory.h" #import "ADJBackoffStrategy.h" +#import "ADJPackageBuilder.h" static NSString * const kPackageQueueFilename = @"AdjustIoPackageQueue"; static const char * const kInternalQueueName = "io.adjust.PackageQueue"; @@ -20,14 +21,14 @@ #pragma mark - private @interface ADJPackageHandler() -@property (nonatomic) dispatch_queue_t internalQueue; -@property (nonatomic) dispatch_semaphore_t sendingSemaphore; -@property (nonatomic, assign) id activityHandler; -@property (nonatomic, retain) id requestHandler; -@property (nonatomic, retain) id logger; -@property (nonatomic, retain) NSMutableArray *packageQueue; +@property (nonatomic, strong) dispatch_queue_t internalQueue; +@property (nonatomic, strong) dispatch_semaphore_t sendingSemaphore; +@property (nonatomic, strong) id requestHandler; +@property (nonatomic, strong) NSMutableArray *packageQueue; +@property (nonatomic, strong) ADJBackoffStrategy * backoffStrategy; @property (nonatomic, assign) BOOL paused; -@property (nonatomic, retain) ADJBackoffStrategy * backoffStrategy; +@property (nonatomic, weak) id activityHandler; +@property (nonatomic, weak) id logger; @end @@ -49,29 +50,39 @@ - (id)initWithActivityHandler:(id)activityHandler self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); self.backoffStrategy = [ADJAdjustFactory packageHandlerBackoffStrategy]; - dispatch_async(self.internalQueue, ^{ - [self initInternal:activityHandler startsSending:startsSending]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJPackageHandler * selfI) { + [selfI initI:selfI + activityHandler:activityHandler + startsSending:startsSending]; + }]; return self; } - (void)addPackage:(ADJActivityPackage *)package { - dispatch_async(self.internalQueue, ^{ - [self addInternal:package]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJPackageHandler* selfI) { + [selfI addI:selfI package:package]; + }]; } - (void)sendFirstPackage { - dispatch_async(self.internalQueue, ^{ - [self sendFirstInternal]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJPackageHandler* selfI) { + [selfI sendFirstI:selfI]; + }]; } - (void)sendNextPackage:(ADJResponseData *)responseData{ - dispatch_async(self.internalQueue, ^{ - [self sendNextInternal]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJPackageHandler* selfI) { + [selfI sendNextI:selfI]; + }]; [self.activityHandler finishedTracking:responseData]; } @@ -110,89 +121,172 @@ - (void)resumeSending { self.paused = NO; } +- (void)updatePackages:(ADJSessionParameters *)sessionParameters +{ + // make copy to prevent possible Activity Handler changes of it + ADJSessionParameters * sessionParametersCopy = [sessionParameters copy]; + + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJPackageHandler* selfI) { + [selfI updatePackagesI:selfI sessionParameters:sessionParametersCopy]; + }]; +} + +- (void)teardown:(BOOL)deleteState { + [ADJAdjustFactory.logger verbose:@"ADJPackageHandler teardown"]; + if (self.sendingSemaphore != nil) { + dispatch_semaphore_signal(self.sendingSemaphore); + } + if (self.requestHandler != nil) { + [self.requestHandler teardown]; + } + [self teardownPackageQueueS:deleteState]; + self.internalQueue = nil; + self.sendingSemaphore = nil; + self.requestHandler = nil; + self.backoffStrategy = nil; + self.activityHandler = nil; + self.logger = nil; +} + #pragma mark - internal -- (void)initInternal:(id)activityHandler - startsSending:(BOOL)startsSending +- (void)initI:(ADJPackageHandler *)selfI +activityHandler:(id)activityHandler +startsSending:(BOOL)startsSending { - self.activityHandler = activityHandler; - self.paused = !startsSending; - self.requestHandler = [ADJAdjustFactory requestHandlerForPackageHandler:self]; - self.logger = ADJAdjustFactory.logger; - self.sendingSemaphore = dispatch_semaphore_create(1); - [self readPackageQueue]; + selfI.activityHandler = activityHandler; + selfI.paused = !startsSending; + selfI.requestHandler = [ADJAdjustFactory requestHandlerForPackageHandler:selfI]; + selfI.logger = ADJAdjustFactory.logger; + selfI.sendingSemaphore = dispatch_semaphore_create(1); + [selfI readPackageQueueI:selfI]; } -- (void)addInternal:(ADJActivityPackage *)newPackage { - [self.packageQueue addObject:newPackage]; - [self.logger debug:@"Added package %d (%@)", self.packageQueue.count, newPackage]; - [self.logger verbose:@"%@", newPackage.extendedString]; +- (void)addI:(ADJPackageHandler *)selfI + package:(ADJActivityPackage *)newPackage +{ + [selfI.packageQueue addObject:newPackage]; + [selfI.logger debug:@"Added package %d (%@)", selfI.packageQueue.count, newPackage]; + [selfI.logger verbose:@"%@", newPackage.extendedString]; - [self writePackageQueue]; + [selfI writePackageQueueS:selfI]; } -- (void)sendFirstInternal { - NSUInteger queueSize = self.packageQueue.count; +- (void)sendFirstI:(ADJPackageHandler *)selfI +{ + NSUInteger queueSize = selfI.packageQueue.count; if (queueSize == 0) return; - if (self.paused) { - [self.logger debug:@"Package handler is paused"]; + if (selfI.paused) { + [selfI.logger debug:@"Package handler is paused"]; return; } - if (dispatch_semaphore_wait(self.sendingSemaphore, DISPATCH_TIME_NOW) != 0) { - [self.logger verbose:@"Package handler is already sending"]; + if (dispatch_semaphore_wait(selfI.sendingSemaphore, DISPATCH_TIME_NOW) != 0) { + [selfI.logger verbose:@"Package handler is already sending"]; return; } - ADJActivityPackage *activityPackage = [self.packageQueue objectAtIndex:0]; + ADJActivityPackage *activityPackage = [selfI.packageQueue objectAtIndex:0]; if (![activityPackage isKindOfClass:[ADJActivityPackage class]]) { - [self.logger error:@"Failed to read activity package"]; - [self sendNextInternal]; + [selfI.logger error:@"Failed to read activity package"]; + [selfI sendNextI:selfI]; return; } - [self.requestHandler sendPackage:activityPackage - queueSize:queueSize - 1]; + [selfI.requestHandler sendPackage:activityPackage + queueSize:queueSize - 1]; } -- (void)sendNextInternal { - [self.packageQueue removeObjectAtIndex:0]; - [self writePackageQueue]; - dispatch_semaphore_signal(self.sendingSemaphore); - [self sendFirstInternal]; +- (void)sendNextI:(ADJPackageHandler *)selfI { + [selfI.packageQueue removeObjectAtIndex:0]; + [selfI writePackageQueueS:selfI]; + dispatch_semaphore_signal(selfI.sendingSemaphore); + [selfI sendFirstI:selfI]; +} + +- (void)updatePackagesI:(ADJPackageHandler *)selfI + sessionParameters:(ADJSessionParameters *)sessionParameters +{ + [selfI.logger debug:@"Updating package handler queue"]; + [selfI.logger verbose:@"Session callback parameters: %@", sessionParameters.callbackParameters]; + [selfI.logger verbose:@"Session partner parameters: %@", sessionParameters.partnerParameters]; + + for (ADJActivityPackage * activityPackage in selfI.packageQueue) { + // callback parameters + NSDictionary * mergedCallbackParameters = [ADJUtil mergeParameters:sessionParameters.callbackParameters + source:activityPackage.callbackParameters + parameterName:@"Callback"]; + + [ADJPackageBuilder parameters:activityPackage.parameters + setDictionary:mergedCallbackParameters + forKey:@"callback_params"]; + + // partner parameters + NSDictionary * mergedPartnerParameters = [ADJUtil mergeParameters:sessionParameters.partnerParameters + source:activityPackage.partnerParameters + parameterName:@"Partner"]; + + [ADJPackageBuilder parameters:activityPackage.parameters + setDictionary:mergedPartnerParameters + forKey:@"partner_params"]; + } + + [selfI writePackageQueueS:selfI]; } #pragma mark - private -- (void)readPackageQueue { +- (void)readPackageQueueI:(ADJPackageHandler *)selfI { @try { [NSKeyedUnarchiver setClass:[ADJActivityPackage class] forClassName:@"AIActivityPackage"]; - NSString *filename = self.packageQueueFilename; + NSString *filename = selfI.packageQueueFilename; id object = [NSKeyedUnarchiver unarchiveObjectWithFile:filename]; if ([object isKindOfClass:[NSArray class]]) { - self.packageQueue = object; - [self.logger debug:@"Package handler read %d packages", self.packageQueue.count]; + selfI.packageQueue = object; + [selfI.logger debug:@"Package handler read %d packages", selfI.packageQueue.count]; return; } else if (object == nil) { - [self.logger verbose:@"Package queue file not found"]; + [selfI.logger verbose:@"Package queue file not found"]; } else { - [self.logger error:@"Failed to read package queue"]; + [selfI.logger error:@"Failed to read package queue"]; } } @catch (NSException *exception) { - [self.logger error:@"Failed to read package queue (%@)", exception]; + [selfI.logger error:@"Failed to read package queue (%@)", exception]; } // start with a fresh package queue in case of any exception - self.packageQueue = [NSMutableArray array]; + selfI.packageQueue = [NSMutableArray array]; +} + +- (void)writePackageQueueS:(ADJPackageHandler *)selfS { + @synchronized ([ADJPackageHandler class]) { + if (selfS.packageQueue == nil) { + return; + } + NSString *filename = selfS.packageQueueFilename; + BOOL result = [NSKeyedArchiver archiveRootObject:selfS.packageQueue toFile:filename]; + if (result == YES) { + [ADJUtil excludeFromBackup:filename]; + [selfS.logger debug:@"Package handler wrote %d packages", selfS.packageQueue.count]; + } else { + [selfS.logger error:@"Failed to write package queue"]; + } + } } -- (void)writePackageQueue { - NSString *filename = self.packageQueueFilename; - BOOL result = [NSKeyedArchiver archiveRootObject:self.packageQueue toFile:filename]; - if (result == YES) { - [ADJUtil excludeFromBackup:filename]; - [self.logger debug:@"Package handler wrote %d packages", self.packageQueue.count]; - } else { - [self.logger error:@"Failed to write package queue"]; +- (void)teardownPackageQueueS:(BOOL)deleteState +{ + @synchronized ([ADJPackageHandler class]) { + if (self.packageQueue == nil) { + return; + } + if (deleteState) { + [ADJUtil deleteFile:self.packageQueueFilename]; + } + [self.packageQueue removeAllObjects]; + + self.packageQueue = nil; } } diff --git a/Adjust/ADJRequestHandler.h b/Adjust/ADJRequestHandler.h index d148c562a..a86ba874b 100644 --- a/Adjust/ADJRequestHandler.h +++ b/Adjust/ADJRequestHandler.h @@ -16,6 +16,8 @@ - (void)sendPackage:(ADJActivityPackage *)activityPackage queueSize:(NSUInteger)queueSize; +- (void)teardown; + @end diff --git a/Adjust/ADJRequestHandler.m b/Adjust/ADJRequestHandler.m index 72f9c7e42..c14ccd502 100644 --- a/Adjust/ADJRequestHandler.m +++ b/Adjust/ADJRequestHandler.m @@ -18,14 +18,13 @@ #pragma mark - private @interface ADJRequestHandler() -@property (nonatomic) dispatch_queue_t internalQueue; -@property (nonatomic, assign) id packageHandler; -@property (nonatomic, assign) id logger; -@property (nonatomic, retain) NSURL *baseUrl; +@property (nonatomic, strong) dispatch_queue_t internalQueue; +@property (nonatomic, weak) id packageHandler; +@property (nonatomic, weak) id logger; +@property (nonatomic, strong) NSURL *baseUrl; @end - #pragma mark - @implementation ADJRequestHandler @@ -48,29 +47,43 @@ - (id)initWithPackageHandler:(id) packageHandler { - (void)sendPackage:(ADJActivityPackage *)activityPackage queueSize:(NSUInteger)queueSize { - dispatch_async(self.internalQueue, ^{ - [self sendInternal:activityPackage queueSize:queueSize]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJRequestHandler* selfI) { + [selfI sendI:selfI + activityPackage:activityPackage + queueSize:queueSize]; + }]; +} + +- (void)teardown { + [ADJAdjustFactory.logger verbose:@"ADJRequestHandler teardown"]; + + self.internalQueue = nil; + self.packageHandler = nil; + self.logger = nil; + self.baseUrl = nil; } #pragma mark - internal -- (void)sendInternal:(ADJActivityPackage *)package - queueSize:(NSUInteger)queueSize +- (void)sendI:(ADJRequestHandler *)selfI +activityPackage:(ADJActivityPackage *)activityPackage + queueSize:(NSUInteger)queueSize { - [ADJUtil sendPostRequest:self.baseUrl + [ADJUtil sendPostRequest:selfI.baseUrl queueSize:queueSize - prefixErrorMessage:package.failureMessage + prefixErrorMessage:activityPackage.failureMessage suffixErrorMessage:@"Will retry later" - activityPackage:package + activityPackage:activityPackage responseDataHandler:^(ADJResponseData * responseData) { if (responseData.jsonResponse == nil) { - [self.packageHandler closeFirstPackage:responseData activityPackage:package]; + [selfI.packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; return; } - [self.packageHandler sendNextPackage:responseData]; + [selfI.packageHandler sendNextPackage:responseData]; }]; } diff --git a/Adjust/ADJResponseData.h b/Adjust/ADJResponseData.h index 1de93766c..aa785850b 100644 --- a/Adjust/ADJResponseData.h +++ b/Adjust/ADJResponseData.h @@ -28,7 +28,7 @@ @property (nonatomic, assign) BOOL willRetry; -@property (nonatomic, retain) NSDictionary *jsonResponse; +@property (nonatomic, strong) NSDictionary *jsonResponse; @property (nonatomic, copy) ADJAttribution *attribution; @@ -60,6 +60,8 @@ @interface ADJAttributionResponseData : ADJResponseData +@property (nonatomic, strong) NSURL * deeplink; + @end @interface ADJClickResponseData : ADJResponseData diff --git a/Adjust/ADJResponseData.m b/Adjust/ADJResponseData.m index 2d625440a..316389c8b 100644 --- a/Adjust/ADJResponseData.m +++ b/Adjust/ADJResponseData.m @@ -187,6 +187,12 @@ -(id)copyWithZone:(NSZone *)zone return copy; } +- (NSString *)description { + return [NSString stringWithFormat:@"message:%@ timestamp:%@ adid:%@ success:%d willRetry:%d attribution:%@ deeplink:%@ json:%@", + self.message, self.timeStamp, self.adid, self.success, self.willRetry, self.attribution, self.deeplink, self.jsonResponse]; +} + + @end @implementation ADJClickResponseData @@ -221,4 +227,4 @@ -(id)copyWithZone:(NSZone *)zone return copy; } -@end \ No newline at end of file +@end diff --git a/Adjust/ADJSdkClickHandler.h b/Adjust/ADJSdkClickHandler.h index 22979602a..dcc779c26 100644 --- a/Adjust/ADJSdkClickHandler.h +++ b/Adjust/ADJSdkClickHandler.h @@ -16,6 +16,7 @@ - (void)pauseSending; - (void)resumeSending; - (void)sendSdkClick:(ADJActivityPackage *)sdkClickPackage; +- (void)teardown; @end diff --git a/Adjust/ADJSdkClickHandler.m b/Adjust/ADJSdkClickHandler.m index e8cbe4f40..2adb30587 100644 --- a/Adjust/ADJSdkClickHandler.m +++ b/Adjust/ADJSdkClickHandler.m @@ -17,12 +17,12 @@ #pragma mark - private @interface ADJSdkClickHandler() -@property (nonatomic) dispatch_queue_t internalQueue; -@property (nonatomic, retain) id logger; -@property (nonatomic, retain) ADJBackoffStrategy * backoffStrategy; +@property (nonatomic, strong) dispatch_queue_t internalQueue; +@property (nonatomic, weak) id logger; +@property (nonatomic, strong) ADJBackoffStrategy * backoffStrategy; @property (nonatomic, assign) BOOL paused; -@property (nonatomic, retain) NSMutableArray *packageQueue; -@property (nonatomic, retain) NSURL *baseUrl; +@property (nonatomic, strong) NSMutableArray *packageQueue; +@property (nonatomic, strong) NSURL *baseUrl; @end @@ -40,10 +40,14 @@ - (id)initWithStartsSending:(BOOL)startsSending self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); - dispatch_async(self.internalQueue, ^{ - [self initInternal:startsSending]; - }); + self.logger = ADJAdjustFactory.logger; + self.paused = !startsSending; + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJSdkClickHandler * selfI) { + [selfI initI:selfI]; + }]; return self; } @@ -58,69 +62,86 @@ - (void)resumeSending { } - (void)sendSdkClick:(ADJActivityPackage *)sdkClickPackage { - dispatch_async(self.internalQueue, ^{ - [self sendSdkClickInternal:sdkClickPackage]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJSdkClickHandler * selfI) { + [selfI sendSdkClickI:selfI sdkClickPackage:sdkClickPackage]; + }]; } - (void)sendNextSdkClick { - dispatch_async(self.internalQueue, ^{ - [self sendNextSdkClickInternal]; - }); + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJSdkClickHandler * selfI) { + [selfI sendNextSdkClickI:selfI]; + }]; +} + +- (void)teardown { + [ADJAdjustFactory.logger verbose:@"ADJSdkClickHandler teardown"]; + if (self.packageQueue != nil) { + [self.packageQueue removeAllObjects]; + } + self.internalQueue = nil; + self.logger = nil; + self.backoffStrategy = nil; + self.packageQueue = nil; + self.baseUrl = nil; } #pragma mark - internal -- (void)initInternal:(BOOL)startsSending +- (void)initI:(ADJSdkClickHandler *)selfI { - self.paused = !startsSending; - self.logger = ADJAdjustFactory.logger; - self.backoffStrategy = [ADJAdjustFactory sdkClickHandlerBackoffStrategy]; - self.packageQueue = [NSMutableArray array]; - self.baseUrl = [NSURL URLWithString:ADJUtil.baseUrl]; + selfI.backoffStrategy = [ADJAdjustFactory sdkClickHandlerBackoffStrategy]; + selfI.packageQueue = [NSMutableArray array]; + selfI.baseUrl = [NSURL URLWithString:ADJUtil.baseUrl]; } -- (void)sendSdkClickInternal:(ADJActivityPackage *)sdkClickPackage { - [self.packageQueue addObject:sdkClickPackage]; +- (void)sendSdkClickI:(ADJSdkClickHandler *)selfI + sdkClickPackage:(ADJActivityPackage *)sdkClickPackage +{ + [selfI.packageQueue addObject:sdkClickPackage]; - [self.logger debug:@"Added sdk_click %d", self.packageQueue.count]; - [self.logger verbose:@"%@", sdkClickPackage.extendedString]; + [selfI.logger debug:@"Added sdk_click %d", selfI.packageQueue.count]; + [selfI.logger verbose:@"%@", sdkClickPackage.extendedString]; - [self sendNextSdkClick]; + [selfI sendNextSdkClick]; } -- (void)sendNextSdkClickInternal { - if (self.paused) return; - NSUInteger queueSize = self.packageQueue.count; +- (void)sendNextSdkClickI:(ADJSdkClickHandler *)selfI +{ + if (selfI.paused) return; + NSUInteger queueSize = selfI.packageQueue.count; if (queueSize == 0) return; ADJActivityPackage *sdkClickPackage = [self.packageQueue objectAtIndex:0]; [self.packageQueue removeObjectAtIndex:0]; if (![sdkClickPackage isKindOfClass:[ADJActivityPackage class]]) { - [self.logger error:@"Failed to read sdk_click package"]; + [selfI.logger error:@"Failed to read sdk_click package"]; - [self sendNextSdkClick]; + [selfI sendNextSdkClick]; return; } dispatch_block_t work = ^{ - [ADJUtil sendPostRequest:self.baseUrl + [ADJUtil sendPostRequest:selfI.baseUrl queueSize:queueSize - 1 prefixErrorMessage:sdkClickPackage.failureMessage suffixErrorMessage:@"Will retry later" activityPackage:sdkClickPackage responseDataHandler:^(ADJResponseData * responseData) - { - if (responseData.jsonResponse == nil) { - NSInteger retries = [sdkClickPackage increaseRetries]; - [self.logger error:@"Retrying sdk_click package for the %d time", retries]; + { + if (responseData.jsonResponse == nil) { + NSInteger retries = [sdkClickPackage increaseRetries]; + [selfI.logger error:@"Retrying sdk_click package for the %d time", retries]; - [self sendSdkClick:sdkClickPackage]; - } - }]; + [selfI sendSdkClick:sdkClickPackage]; + } + }]; - [self sendNextSdkClick]; + [selfI sendNextSdkClick]; }; NSInteger retries = [sdkClickPackage retries]; diff --git a/Adjust/ADJSessionFailure.h b/Adjust/ADJSessionFailure.h index a39233dc9..25681f03b 100644 --- a/Adjust/ADJSessionFailure.h +++ b/Adjust/ADJSessionFailure.h @@ -23,7 +23,7 @@ @property (nonatomic, assign) BOOL willRetry; // the server response in json format -@property (nonatomic, retain) NSDictionary *jsonResponse; +@property (nonatomic, strong) NSDictionary *jsonResponse; + (ADJSessionFailure *)sessionFailureResponseData; - (id)init; diff --git a/Adjust/ADJSessionParameters.h b/Adjust/ADJSessionParameters.h new file mode 100644 index 000000000..603a89d0d --- /dev/null +++ b/Adjust/ADJSessionParameters.h @@ -0,0 +1,16 @@ +// +// ADJSessionParameters.h +// Adjust +// +// Created by Pedro Filipe on 27/05/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionParameters : NSObject + +@property (nonatomic, strong) NSMutableDictionary* callbackParameters; +@property (nonatomic, strong) NSMutableDictionary* partnerParameters; + +@end diff --git a/Adjust/ADJSessionParameters.m b/Adjust/ADJSessionParameters.m new file mode 100644 index 000000000..1d1f928a1 --- /dev/null +++ b/Adjust/ADJSessionParameters.m @@ -0,0 +1,25 @@ +// +// ADJSessionParameters.m +// Adjust +// +// Created by Pedro Filipe on 27/05/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import "ADJSessionParameters.h" + +@implementation ADJSessionParameters + +#pragma mark - NSCopying +-(id)copyWithZone:(NSZone *)zone +{ + ADJSessionParameters* copy = [[[self class] allocWithZone:zone] init]; + if (copy) { + copy.callbackParameters = [self.callbackParameters copyWithZone:zone]; + copy.partnerParameters = [self.partnerParameters copyWithZone:zone]; + } + + return copy; +} + +@end diff --git a/Adjust/ADJSessionSuccess.h b/Adjust/ADJSessionSuccess.h index 16b43367a..5533928bc 100644 --- a/Adjust/ADJSessionSuccess.h +++ b/Adjust/ADJSessionSuccess.h @@ -20,7 +20,7 @@ @property (nonatomic, copy) NSString * adid; // the server response in json format -@property (nonatomic, retain) NSDictionary *jsonResponse; +@property (nonatomic, strong) NSDictionary *jsonResponse; + (ADJSessionSuccess *)sessionSuccessResponseData; - (id)init; diff --git a/Adjust/ADJTimerCycle.h b/Adjust/ADJTimerCycle.h index dbd7e652e..c2f10da8d 100644 --- a/Adjust/ADJTimerCycle.h +++ b/Adjust/ADJTimerCycle.h @@ -24,4 +24,5 @@ - (void)resume; - (void)suspend; +- (void)cancel; @end diff --git a/Adjust/ADJTimerCycle.m b/Adjust/ADJTimerCycle.m index 48dfca9d8..4e961be20 100644 --- a/Adjust/ADJTimerCycle.m +++ b/Adjust/ADJTimerCycle.m @@ -16,9 +16,9 @@ #pragma mark - private @interface ADJTimerCycle() -@property (nonatomic) dispatch_source_t source; +@property (nonatomic, strong) dispatch_source_t source; @property (nonatomic, assign) BOOL suspended; -@property (nonatomic, retain) id logger; +@property (nonatomic, weak) id logger; @property (nonatomic, copy) NSString *name; @end @@ -64,12 +64,13 @@ - (id)initBlock:(dispatch_block_t)block NSString * startTimeFormatted = [ADJUtil secondsNumberFormat:startTime]; NSString * intervalTimeFormatted = [ADJUtil secondsNumberFormat:intervalTime]; - [self.logger verbose:@"%@ fires after %@ seconds of starting and cycles every %@ seconds", self.name, startTimeFormatted, intervalTimeFormatted]; + [self.logger verbose:@"%@ configured to fire after %@ seconds of starting and cycles every %@ seconds", self.name, startTimeFormatted, intervalTimeFormatted]; return self; } - (void)resume { + if (self.source == nil) return; if (!self.suspended) { [self.logger verbose:@"%@ is already started", self.name]; return; @@ -82,6 +83,7 @@ - (void)resume { } - (void)suspend { + if (self.source == nil) return; if (self.suspended) { [self.logger verbose:@"%@ is already suspended", self.name]; return; @@ -92,4 +94,16 @@ - (void)suspend { self.suspended = YES; } +- (void)cancel { + if (self.source != nil) { + [self resume]; + dispatch_cancel(self.source); + } + self.source = nil; +} + +- (void)dealloc { + [self.logger verbose:@"%@ dealloc", self.name]; +} + @end diff --git a/Adjust/ADJTimerOnce.m b/Adjust/ADJTimerOnce.m index d5eec7323..bfa4d8545 100644 --- a/Adjust/ADJTimerOnce.m +++ b/Adjust/ADJTimerOnce.m @@ -16,12 +16,12 @@ #pragma mark - private @interface ADJTimerOnce() -@property (nonatomic) dispatch_queue_t internalQueue; -@property (nonatomic) dispatch_source_t source; -@property (nonatomic, strong) dispatch_block_t block; +@property (nonatomic, strong) dispatch_queue_t internalQueue; +@property (nonatomic, strong) dispatch_source_t source; +@property (nonatomic, copy) dispatch_block_t block; @property (nonatomic, assign, readonly) dispatch_time_t start; -@property (nonatomic, retain) NSDate * fireDate; -@property (nonatomic, retain) id logger; +@property (nonatomic, strong) NSDate * fireDate; +@property (nonatomic, weak) id logger; @property (nonatomic, copy) NSString *name; @end @@ -96,4 +96,9 @@ - (void)cancel:(BOOL)log { - (void)cancel { [self cancel:YES]; } + +- (void)dealloc { + [self.logger verbose:@"%@ dealloc", self.name]; +} + @end diff --git a/Adjust/ADJUtil.h b/Adjust/ADJUtil.h index b4556e937..3d521b81d 100644 --- a/Adjust/ADJUtil.h +++ b/Adjust/ADJUtil.h @@ -11,9 +11,14 @@ #import "ADJActivityPackage.h" #import "ADJEvent.h" #import "ADJBackoffStrategy.h" +#import "ADJConfig.h" + +typedef void (^selfInjectedBlock)(id); @interface ADJUtil : NSObject ++ (void)updateUrlSessionConfiguration:(ADJConfig *)config; + + (NSString *)baseUrl; + (NSString *)clientSdk; @@ -67,4 +72,17 @@ responseDataHandler:(void (^) (ADJResponseData * responseData))responseDataHandl selector:(SEL)selector withObject:(id)object; + (void)launchInMainThread:(dispatch_block_t)block; ++ (BOOL)isValidParameter:(NSString *)attribute + attributeType:(NSString *)attributeType + parameterName:(NSString *)parameterName; ++ (NSDictionary *)mergeParameters:(NSDictionary *)target + source:(NSDictionary *)source + parameterName:(NSString *)parameterName; + ++ (void)launchInQueue:(dispatch_queue_t)queue + selfInject:(id)selfInject + block:(selfInjectedBlock)block; ++ (BOOL)deleteFile:(NSString *)filename; + ++ (void)launchDeepLinkMain:(NSURL *)deepLinkUrl; @end diff --git a/Adjust/ADJUtil.m b/Adjust/ADJUtil.m index d890792d5..c103548e5 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -6,34 +6,39 @@ // Copyright (c) 2013 adjust GmbH. All rights reserved. // +#include +#include +#include + #import "ADJUtil.h" #import "ADJLogger.h" -#import "UIDevice+ADJAdditions.h" +#import "ADJResponseData.h" #import "ADJAdjustFactory.h" +#import "UIDevice+ADJAdditions.h" #import "NSString+ADJAdditions.h" -#import "ADJAdjustFactory.h" -#import "ADJResponseData.h" +#import -#include -#include -#include +static const double kRequestTimeout = 60; // 60 seconds static NSDateFormatter *dateFormat; static NSRegularExpression * universalLinkRegex = nil; static NSRegularExpression * shortUniversalLinkRegex = nil; +static NSRegularExpression *optionalRedirectRegex = nil; static NSNumberFormatter * secondsNumberFormatter = nil; -static NSString * const kClientSdk = @"ios4.8.5"; -static NSString * const kDefaultScheme = @"AdjustUniversalScheme"; -static NSString * const kUniversalLinkPattern = @"https://[^.]*\\.ulink\\.adjust\\.com/ulink/?(.*)"; +static NSString * const kClientSdk = @"ios4.9.0"; +static NSURLSessionConfiguration * urlSessionConfiguration = nil; +static NSString * userAgent = nil; +static NSString * const kDeeplinkParam = @"deep_link="; +static NSString * const kSchemeDelimiter = @"://"; +static NSString * const kDefaultScheme = @"AdjustUniversalScheme"; +static NSString * const kUniversalLinkPattern = @"https://[^.]*\\.ulink\\.adjust\\.com/ulink/?(.*)"; static NSString * const kShortUniversalLinkPattern = @"http[s]?://[a-z0-9]{4}\\.adj\\.st/?(.*)"; +static NSString * const kOptionalRedirectPattern = @"adjust_redirect=[^&#]*"; +static NSString * const kBaseUrl = @"https://app.adjust.com"; +static NSString * const kDateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z"; -static NSString * const kBaseUrl = @"https://app.adjust.com"; -static NSString * const kDateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z"; -static const double kRequestTimeout = 60; // 60 seconds - -#pragma mark - @implementation ADJUtil + (void) initialize { @@ -44,6 +49,8 @@ + (void) initialize { [self initializeUniversalLinkRegex]; [self initializeSecondsNumberFormatter]; [self initializeShortUniversalLinkRegex]; + [self initializeOptionalRedirectRegex]; + [self initializeUrlSessionConfiguration]; } + (void)initializeDateFormat { @@ -51,7 +58,7 @@ + (void)initializeDateFormat { if ([NSCalendar instancesRespondToSelector:@selector(calendarWithIdentifier:)]) { // http://stackoverflow.com/a/3339787 - NSString * calendarIdentifier; + NSString *calendarIdentifier; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wtautological-pointer-compare" @@ -106,11 +113,38 @@ + (void)initializeShortUniversalLinkRegex { shortUniversalLinkRegex = regex; } ++ (void)initializeOptionalRedirectRegex { + NSError *error = NULL; + + NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:kOptionalRedirectPattern + options:NSRegularExpressionCaseInsensitive + error:&error]; + + if ([ADJUtil isNotNull:error]) { + [ADJAdjustFactory.logger error:@"Optional redirect regex rule error (%@)", [error description]]; + return; + } + + optionalRedirectRegex = regex; +} + + (void)initializeSecondsNumberFormatter { secondsNumberFormatter = [[NSNumberFormatter alloc] init]; [secondsNumberFormatter setPositiveFormat:@"0.0"]; } ++ (void)initializeUrlSessionConfiguration { + urlSessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration]; +} + ++ (void)updateUrlSessionConfiguration:(ADJConfig *)config { + if (config.sendInBackground) { + urlSessionConfiguration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@"Adjust"]; + } + + userAgent = config.userAgent; +} + + (NSString *)baseUrl { return kBaseUrl; } @@ -119,7 +153,7 @@ + (NSString *)clientSdk { return kClientSdk; } -// inspired by https://gist.github.com/kevinbarrett/2002382 +// Inspired by https://gist.github.com/kevinbarrett/2002382 + (void)excludeFromBackup:(NSString *)path { NSURL *url = [NSURL fileURLWithPath:path]; const char* filePath = [[url path] fileSystemRepresentation]; @@ -132,15 +166,18 @@ + (void)excludeFromBackup:(NSString *)path { if (&NSURLIsExcludedFromBackupKey == nil) { u_int8_t attrValue = 1; int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0); + if (result != 0) { [logger debug:@"Failed to exclude '%@' from backup", url.lastPathComponent]; } } else { // iOS 5.0 and higher // First try and remove the extended attribute if it is present ssize_t result = getxattr(filePath, attrName, NULL, sizeof(u_int8_t), 0, 0); + if (result != -1) { // The attribute exists, we need to remove it int removeResult = removexattr(filePath, attrName, 0); + if (removeResult == 0) { [logger debug:@"Removed extended attribute on file '%@'", url]; } @@ -151,57 +188,58 @@ + (void)excludeFromBackup:(NSString *)path { BOOL success = [url setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error]; + if (!success || error != nil) { [logger debug:@"Failed to exclude '%@' from backup (%@)", url.lastPathComponent, error.localizedDescription]; } } #pragma clang diagnostic pop - } -+ (NSString *)formatSeconds1970:(double) value { ++ (NSString *)formatSeconds1970:(double)value { NSDate *date = [NSDate dateWithTimeIntervalSince1970:value]; - return [self formatDate:date]; } -+ (NSString *)formatDate:(NSDate *) value { ++ (NSString *)formatDate:(NSDate *)value { return [dateFormat stringFromDate:value]; } -+ (void) saveJsonResponse:(NSData *)jsonData - responseData:(ADJResponseData *)responseData -{ ++ (void) saveJsonResponse:(NSData *)jsonData responseData:(ADJResponseData *)responseData { NSError *error = nil; NSException *exception = nil; - NSDictionary *jsonDict = [ADJUtil buildJsonDict:jsonData exceptionPtr:&exception errorPtr:&error]; if (exception != nil) { - NSString * message = [NSString stringWithFormat:@"Failed to parse json response. (%@)", exception.description]; + NSString *message = [NSString stringWithFormat:@"Failed to parse json response. (%@)", exception.description]; + [ADJAdjustFactory.logger error:message]; responseData.message = message; + return; } if (error != nil) { - NSString * message = [NSString stringWithFormat:@"Failed to parse json response. (%@)", error.localizedDescription]; + NSString *message = [NSString stringWithFormat:@"Failed to parse json response. (%@)", error.localizedDescription]; + [ADJAdjustFactory.logger error:message]; responseData.message = message; + return; } responseData.jsonResponse = jsonDict; } -+ (NSDictionary *) buildJsonDict:(NSData *)jsonData - exceptionPtr:(NSException **)exceptionPtr - errorPtr:(NSError **)error -{ ++ (NSDictionary *)buildJsonDict:(NSData *)jsonData + exceptionPtr:(NSException **)exceptionPtr + errorPtr:(NSError **)error { if (jsonData == nil) { return nil; } + NSDictionary *jsonDict = nil; + @try { jsonDict = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:error]; } @catch (NSException *ex) { @@ -212,21 +250,23 @@ + (NSDictionary *) buildJsonDict:(NSData *)jsonData return jsonDict; } -+ (NSString *)getFullFilename:(NSString *) baseFilename { ++ (NSString *)getFullFilename:(NSString *)baseFilename { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *path = [paths objectAtIndex:0]; NSString *filename = [path stringByAppendingPathComponent:baseFilename]; + return filename; } + (id)readObject:(NSString *)filename objectName:(NSString *)objectName - class:(Class) classToRead -{ + class:(Class) classToRead { id logger = [ADJAdjustFactory logger]; + @try { NSString *fullFilename = [ADJUtil getFullFilename:filename]; id object = [NSKeyedUnarchiver unarchiveObjectWithFile:fullFilename]; + if ([object isKindOfClass:classToRead]) { [logger debug:@"Read %@: %@", objectName, object]; return object; @@ -248,6 +288,7 @@ + (void)writeObject:(id)object id logger = [ADJAdjustFactory logger]; NSString *fullFilename = [ADJUtil getFullFilename:filename]; BOOL result = [NSKeyedArchiver archiveRootObject:object toFile:fullFilename]; + if (result == YES) { [ADJUtil excludeFromBackup:fullFilename]; [logger debug:@"Wrote %@: %@", objectName, object]; @@ -256,19 +297,20 @@ + (void)writeObject:(id)object } } -+ (NSString *) queryString:(NSDictionary *)parameters { ++ (NSString *)queryString:(NSDictionary *)parameters { return [ADJUtil queryString:parameters queueSize:0]; } -+ (NSString *) queryString:(NSDictionary *)parameters - queueSize:(NSUInteger)queueSize -{ ++ (NSString *)queryString:(NSDictionary *)parameters + queueSize:(NSUInteger)queueSize { NSMutableArray *pairs = [NSMutableArray array]; + for (NSString *key in parameters) { NSString *value = [parameters objectForKey:key]; NSString *escapedValue = [value adjUrlEncode]; NSString *escapedKey = [key adjUrlEncode]; NSString *pair = [NSString stringWithFormat:@"%@=%@", escapedKey, escapedValue]; + [pairs addObject:pair]; } @@ -276,6 +318,7 @@ + (NSString *) queryString:(NSDictionary *)parameters NSString *dateString = [ADJUtil formatSeconds1970:now]; NSString *escapedDate = [dateString adjUrlEncode]; NSString *sentAtPair = [NSString stringWithFormat:@"%@=%@", @"sent_at", escapedDate]; + [pairs addObject:sentAtPair]; if (queueSize > 0) { @@ -283,6 +326,7 @@ + (NSString *) queryString:(NSDictionary *)parameters NSString *queueSizeString = [NSString stringWithFormat:@"%lu", queueSizeNative]; NSString *escapedQueueSize = [queueSizeString adjUrlEncode]; NSString *queueSizePair = [NSString stringWithFormat:@"%@=%@", @"queue_size", escapedQueueSize]; + [pairs addObject:queueSizePair]; } @@ -301,9 +345,8 @@ + (BOOL)isNotNull:(id)value { + (NSString *)formatErrorMessage:(NSString *)prefixErrorMessage systemErrorMessage:(NSString *)systemErrorMessage - suffixErrorMessage:(NSString *)suffixErrorMessage -{ - NSString * errorMessage = [NSString stringWithFormat:@"%@ (%@)", prefixErrorMessage, systemErrorMessage]; + suffixErrorMessage:(NSString *)suffixErrorMessage { + NSString *errorMessage = [NSString stringWithFormat:@"%@ (%@)", prefixErrorMessage, systemErrorMessage]; if (suffixErrorMessage == nil) { return errorMessage; } else { @@ -316,9 +359,8 @@ + (void)sendPostRequest:(NSURL *)baseUrl prefixErrorMessage:(NSString *)prefixErrorMessage suffixErrorMessage:(NSString *)suffixErrorMessage activityPackage:(ADJActivityPackage *)activityPackage - responseDataHandler:(void (^) (ADJResponseData * responseData))responseDataHandler -{ - NSMutableURLRequest * request = [ADJUtil requestForPackage:activityPackage baseUrl:baseUrl queueSize:queueSize]; + responseDataHandler:(void (^)(ADJResponseData *responseData))responseDataHandler { + NSMutableURLRequest *request = [ADJUtil requestForPackage:activityPackage baseUrl:baseUrl queueSize:queueSize]; [ADJUtil sendRequest:request prefixErrorMessage:prefixErrorMessage @@ -329,8 +371,7 @@ + (void)sendPostRequest:(NSURL *)baseUrl + (NSMutableURLRequest *)requestForPackage:(ADJActivityPackage *)activityPackage baseUrl:(NSURL *)baseUrl - queueSize:(NSUInteger)queueSize -{ + queueSize:(NSUInteger)queueSize { NSURL *url = [NSURL URLWithString:activityPackage.path relativeToURL:baseUrl]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; request.timeoutInterval = kRequestTimeout; @@ -349,8 +390,7 @@ + (NSMutableURLRequest *)requestForPackage:(ADJActivityPackage *)activityPackage + (void)sendRequest:(NSMutableURLRequest *)request prefixErrorMessage:(NSString *)prefixErrorMessage activityPackage:(ADJActivityPackage *)activityPackage -responseDataHandler:(void (^) (ADJResponseData * responseData))responseDataHandler -{ +responseDataHandler:(void (^)(ADJResponseData *responseData))responseDataHandler { [ADJUtil sendRequest:request prefixErrorMessage:prefixErrorMessage suffixErrorMessage:nil @@ -362,9 +402,12 @@ + (void)sendRequest:(NSMutableURLRequest *)request prefixErrorMessage:(NSString *)prefixErrorMessage suffixErrorMessage:(NSString *)suffixErrorMessage activityPackage:(ADJActivityPackage *)activityPackage -responseDataHandler:(void (^) (ADJResponseData * responseData))responseDataHandler -{ +responseDataHandler:(void (^)(ADJResponseData *responseData))responseDataHandler { Class NSURLSessionClass = NSClassFromString(@"NSURLSession"); + + if (userAgent != nil) { + [request setValue:userAgent forHTTPHeaderField:@"User-Agent"]; + } if (NSURLSessionClass != nil) { [ADJUtil sendNSURLSessionRequest:request prefixErrorMessage:prefixErrorMessage @@ -384,19 +427,18 @@ + (void)sendNSURLSessionRequest:(NSMutableURLRequest *)request prefixErrorMessage:(NSString *)prefixErrorMessage suffixErrorMessage:(NSString *)suffixErrorMessage activityPackage:(ADJActivityPackage *)activityPackage - responseDataHandler:(void (^) (ADJResponseData * responseData))responseDataHandler + responseDataHandler:(void (^)(ADJResponseData *responseData))responseDataHandler { - NSURLSession *session = [NSURLSession sharedSession]; - + NSURLSession *session = [NSURLSession sessionWithConfiguration:urlSessionConfiguration]; NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler: ^(NSData *data, NSURLResponse *response, NSError *error) { - ADJResponseData * responseData = [ADJUtil completionHandler:data - response:(NSHTTPURLResponse *)response - error:error - prefixErrorMessage:prefixErrorMessage - suffixErrorMessage:suffixErrorMessage - activityPackage:activityPackage]; + ADJResponseData *responseData = [ADJUtil completionHandler:data + response:(NSHTTPURLResponse *)response + error:error + prefixErrorMessage:prefixErrorMessage + suffixErrorMessage:suffixErrorMessage + activityPackage:activityPackage]; responseDataHandler(responseData); }]; [task resume]; @@ -406,24 +448,23 @@ + (void)sendNSURLConnectionRequest:(NSMutableURLRequest *)request prefixErrorMessage:(NSString *)prefixErrorMessage suffixErrorMessage:(NSString *)suffixErrorMessage activityPackage:(ADJActivityPackage *)activityPackage - responseDataHandler:(void (^) (ADJResponseData * responseData))responseDataHandler -{ + responseDataHandler:(void (^)(ADJResponseData *responseData))responseDataHandler { NSError *responseError = nil; NSHTTPURLResponse *urlResponse = nil; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - NSData * data = [NSURLConnection sendSynchronousRequest:request - returningResponse:&urlResponse - error:&responseError]; + NSData *data = [NSURLConnection sendSynchronousRequest:request + returningResponse:&urlResponse + error:&responseError]; #pragma clang diagnostic pop - ADJResponseData * responseData = [ADJUtil completionHandler:data - response:(NSHTTPURLResponse *)urlResponse - error:responseError - prefixErrorMessage:prefixErrorMessage - suffixErrorMessage:suffixErrorMessage - activityPackage:activityPackage]; + ADJResponseData *responseData = [ADJUtil completionHandler:data + response:(NSHTTPURLResponse *)urlResponse + error:responseError + prefixErrorMessage:prefixErrorMessage + suffixErrorMessage:suffixErrorMessage + activityPackage:activityPackage]; responseDataHandler(responseData); } @@ -433,25 +474,29 @@ + (ADJResponseData *)completionHandler:(NSData *)data error:(NSError *)responseError prefixErrorMessage:(NSString *)prefixErrorMessage suffixErrorMessage:(NSString *)suffixErrorMessage - activityPackage:(ADJActivityPackage *)activityPackage -{ - ADJResponseData * responseData = [ADJResponseData buildResponseData:activityPackage]; + activityPackage:(ADJActivityPackage *)activityPackage { + ADJResponseData *responseData = [ADJResponseData buildResponseData:activityPackage]; - // connection error + // Connection error if (responseError != nil) { - NSString * errorMessage = [ADJUtil formatErrorMessage:prefixErrorMessage - systemErrorMessage:responseError.localizedDescription - suffixErrorMessage:suffixErrorMessage]; + NSString *errorMessage = [ADJUtil formatErrorMessage:prefixErrorMessage + systemErrorMessage:responseError.localizedDescription + suffixErrorMessage:suffixErrorMessage]; + [ADJAdjustFactory.logger error:errorMessage]; responseData.message = errorMessage; + return responseData; } + if ([ADJUtil isNull:data]) { - NSString * errorMessage = [ADJUtil formatErrorMessage:prefixErrorMessage - systemErrorMessage:@"empty error" - suffixErrorMessage:suffixErrorMessage]; + NSString *errorMessage = [ADJUtil formatErrorMessage:prefixErrorMessage + systemErrorMessage:@"empty error" + suffixErrorMessage:suffixErrorMessage]; + [ADJAdjustFactory.logger error:errorMessage]; responseData.message = errorMessage; + return responseData; } @@ -459,18 +504,17 @@ + (ADJResponseData *)completionHandler:(NSData *)data NSInteger statusCode = urlResponse.statusCode; [ADJAdjustFactory.logger verbose:@"Response: %@", responseString]; - [ADJUtil saveJsonResponse:data responseData:responseData]; if ([ADJUtil isNull:responseData.jsonResponse]) { return responseData; } - NSString* messageResponse = [responseData.jsonResponse objectForKey:@"message"]; + NSString *messageResponse = [responseData.jsonResponse objectForKey:@"message"]; - responseData.message = messageResponse; - responseData.timeStamp = [responseData.jsonResponse objectForKey:@"timestamp"]; - responseData.adid = [responseData.jsonResponse objectForKey:@"adid"]; + responseData.message = messageResponse; + responseData.timeStamp = [responseData.jsonResponse objectForKey:@"timestamp"]; + responseData.adid = [responseData.jsonResponse objectForKey:@"adid"]; if (messageResponse == nil) { messageResponse = @"No message found"; @@ -486,26 +530,24 @@ + (ADJResponseData *)completionHandler:(NSData *)data return responseData; } -// convert all values to strings, if value is dictionary -> recursive call -+ (NSDictionary *)convertDictionaryValues:(NSDictionary *)dictionary -{ - NSMutableDictionary * convertedDictionary = [[NSMutableDictionary alloc] initWithCapacity:dictionary.count]; +// Convert all values to strings, if value is dictionary -> recursive call ++ (NSDictionary *)convertDictionaryValues:(NSDictionary *)dictionary { + NSMutableDictionary *convertedDictionary = [[NSMutableDictionary alloc] initWithCapacity:dictionary.count]; - for (NSString * key in dictionary) { + for (NSString *key in dictionary) { id value = [dictionary objectForKey:key]; + if ([value isKindOfClass:[NSDictionary class]]) { - // dictionary value, recursive call - NSDictionary * dictionaryValue = [ADJUtil convertDictionaryValues:(NSDictionary *)value]; + // Dictionary value, recursive call + NSDictionary *dictionaryValue = [ADJUtil convertDictionaryValues:(NSDictionary *)value]; [convertedDictionary setObject:dictionaryValue forKey:key]; - } else if ([value isKindOfClass:[NSDate class]]) { - // format date to our custom format - NSString * dateStingValue = [ADJUtil formatDate:value]; + // Format date to our custom format + NSString *dateStingValue = [ADJUtil formatDate:value]; [convertedDictionary setObject:dateStingValue forKey:key]; - } else { - // convert all other objects directly to string - NSString * stringValue = [NSString stringWithFormat:@"%@", value]; + // Convert all other objects directly to string + NSString *stringValue = [NSString stringWithFormat:@"%@", value]; [convertedDictionary setObject:stringValue forKey:key]; } } @@ -520,16 +562,16 @@ + (NSString *)idfa { + (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme { id logger = ADJAdjustFactory.logger; - if ([ADJUtil isNull:scheme] || [scheme length] == 0) { - [logger warn:@"Non-empty scheme required, using the scheme \"AdjustUniversalScheme\""]; - scheme = kDefaultScheme; - } - if ([ADJUtil isNull:url]) { [logger error:@"Received universal link is nil"]; return nil; } + if ([ADJUtil isNull:scheme] || [scheme length] == 0) { + [logger warn:@"Non-empty scheme required, using the scheme \"AdjustUniversalScheme\""]; + scheme = kDefaultScheme; + } + NSString *urlString = [url absoluteString]; if ([ADJUtil isNull:urlString]) { @@ -571,7 +613,9 @@ + (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme { NSString *tailSubString = [urlString substringWithRange:[match rangeAtIndex:1]]; - NSString *extractedUrlString = [NSString stringWithFormat:@"%@://%@", scheme, tailSubString]; + NSString *finalTailSubString = [ADJUtil removeOptionalRedirect:tailSubString]; + + NSString *extractedUrlString = [NSString stringWithFormat:@"%@://%@", scheme, finalTailSubString]; [logger info:@"Converted deeplink from universal link %@", extractedUrlString]; @@ -585,8 +629,76 @@ + (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme { return extractedUrl; } ++ (NSString *)removeOptionalRedirect:(NSString *)tailSubString { + id logger = ADJAdjustFactory.logger; + + if (optionalRedirectRegex == nil) { + [ADJAdjustFactory.logger error:@"Remove Optional Redirect regex not correctly configured"]; + return tailSubString; + } + + NSArray *optionalRedirectmatches = [optionalRedirectRegex matchesInString:tailSubString + options:0 + range:NSMakeRange(0, [tailSubString length])]; + + if ([optionalRedirectmatches count] == 0) { + [logger debug:@"Universal link does not contain option adjust_redirect parameter"]; + return tailSubString; + } + + if ([optionalRedirectmatches count] > 1) { + [logger error:@"Universal link contains multiple option adjust_redirect parameters"]; + return tailSubString; + } + + NSTextCheckingResult *redirectMatch = optionalRedirectmatches[0]; + + NSRange redirectRange = [redirectMatch rangeAtIndex:0]; + + NSString *beforeRedirect = [tailSubString substringToIndex:redirectRange.location]; + NSString *afterRedirect = [tailSubString substringFromIndex:(redirectRange.location + redirectRange.length)]; + + if (beforeRedirect.length > 0 && + afterRedirect.length > 0) + { + NSString *lastCharacterBeforeRedirect = [beforeRedirect substringFromIndex:beforeRedirect.length - 1]; + NSString *firstCharacterAfterRedirect = [afterRedirect substringToIndex:1]; + + if ([@"&" isEqualToString:lastCharacterBeforeRedirect] && + [@"&" isEqualToString:firstCharacterAfterRedirect]) + { + beforeRedirect = [beforeRedirect + substringToIndex:beforeRedirect.length - 1]; + } + + if ([@"&" isEqualToString:lastCharacterBeforeRedirect] && + [@"#" isEqualToString:firstCharacterAfterRedirect]) + { + beforeRedirect = [beforeRedirect + substringToIndex:beforeRedirect.length - 1]; + } + + if ([@"?" isEqualToString:lastCharacterBeforeRedirect] && + [@"#" isEqualToString:firstCharacterAfterRedirect]) + { + beforeRedirect = [beforeRedirect + substringToIndex:beforeRedirect.length - 1]; + } + + if ([@"?" isEqualToString:lastCharacterBeforeRedirect] && + [@"&" isEqualToString:firstCharacterAfterRedirect]) + { + afterRedirect = [afterRedirect substringFromIndex:1]; + } + + } + NSString * removedRedirect = [NSString stringWithFormat:@"%@%@", beforeRedirect, afterRedirect]; + + return removedRedirect; +} + + (NSString *)secondsNumberFormat:(double)seconds { - // normalize negative zero + // Normalize negative zero if (seconds < 0) { seconds = seconds * -1; } @@ -594,8 +706,9 @@ + (NSString *)secondsNumberFormat:(double)seconds { return [secondsNumberFormatter stringFromNumber:[NSNumber numberWithDouble:seconds]]; } -+ (double)randomInRange:(double) minRange maxRange:(double) maxRange { ++ (double)randomInRange:(double)minRange maxRange:(double)maxRange { static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ srand48(arc4random()); }); @@ -604,40 +717,44 @@ + (double)randomInRange:(double) minRange maxRange:(double) maxRange { double range = maxRange - minRange; double scaled = random * range; double shifted = scaled + minRange; + return shifted; } + (NSTimeInterval)waitingTime:(NSInteger)retries - backoffStrategy:(ADJBackoffStrategy *)backoffStrategy -{ + backoffStrategy:(ADJBackoffStrategy *)backoffStrategy { if (retries < backoffStrategy.minRetries) { return 0; } - // start with base 0 + + // Start with base 0 NSInteger base = retries - backoffStrategy.minRetries; - // get the exponential Time from the base: 1, 2, 4, 8, 16, ... * times the multiplier + + // Get the exponential Time from the base: 1, 2, 4, 8, 16, ... * times the multiplier NSTimeInterval exponentialTime = pow(2.0, base) * backoffStrategy.secondMultiplier; - // limit the maximum allowed time to wait + + // Limit the maximum allowed time to wait NSTimeInterval ceilingTime = MIN(exponentialTime, backoffStrategy.maxWait); - // add 1 to allow maximum value + + // Add 1 to allow maximum value double randomRange = [ADJUtil randomInRange:backoffStrategy.minRange maxRange:backoffStrategy.maxRange]; - // apply jitter factor + + // Apply jitter factor NSTimeInterval waitingTime = ceilingTime * randomRange; + return waitingTime; } + (void)launchInMainThread:(NSObject *)receiver selector:(SEL)selector - withObject:(id)object -{ + withObject:(id)object { if (ADJAdjustFactory.testing) { [ADJAdjustFactory.logger debug:@"Launching in the background for testing"]; - [receiver performSelectorInBackground:selector - withObject:object]; + [receiver performSelectorInBackground:selector withObject:object]; } else { [receiver performSelectorOnMainThread:selector withObject:object - waitUntilDone:NO]; // non-blocking + waitUntilDone:NO]; // non-blocking } } @@ -649,4 +766,141 @@ + (void)launchInMainThread:(dispatch_block_t)block { dispatch_async(dispatch_get_main_queue(), block); } } + ++ (BOOL)isValidParameter:(NSString *)attribute + attributeType:(NSString *)attributeType + parameterName:(NSString *)parameterName { + if ([ADJUtil isNull:attribute]) { + [ADJAdjustFactory.logger error:@"%@ parameter %@ is missing", parameterName, attributeType]; + return NO; + } + + if ([attribute isEqualToString:@""]) { + [ADJAdjustFactory.logger error:@"%@ parameter %@ is empty", parameterName, attributeType]; + return NO; + } + + return YES; +} + ++ (NSDictionary *)mergeParameters:(NSDictionary *)target + source:(NSDictionary *)source + parameterName:(NSString *)parameterName { + if (target == nil) { + return source; + } + + if (source == nil) { + return target; + } + + NSMutableDictionary *mergedParameters = [NSMutableDictionary dictionaryWithDictionary:target]; + [source enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *obj, BOOL *stop) { + NSString *oldValue = [mergedParameters objectForKey:key]; + + if (oldValue != nil) { + [ADJAdjustFactory.logger warn:@"Key %@ with value %@ from %@ parameter was replaced by value %@", + key, oldValue, parameterName, obj]; + } + + [mergedParameters setObject:obj forKey:key]; + }]; + + return (NSDictionary *)mergedParameters; +} + ++ (void)launchInQueue:(dispatch_queue_t)queue + selfInject:(id)selfInject + block:(selfInjectedBlock)block { + __weak __typeof__(selfInject) weakSelf = selfInject; + + dispatch_async(queue, ^{ + __typeof__(selfInject) strongSelf = weakSelf; + + if (strongSelf == nil) { + return; + } + + block(strongSelf); + }); +} + ++ (NSString *)getFilename:(NSString *)filename { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *path = [paths objectAtIndex:0]; + NSString *filepath = [path stringByAppendingPathComponent:filename]; + + return filepath; +} + ++ (BOOL)deleteFile:(NSString *)filename { + NSString *filepath = [ADJUtil getFilename:filename]; + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSError *error = nil; + BOOL exists = [fileManager fileExistsAtPath:filepath]; + + if (!exists) { + [ADJAdjustFactory.logger verbose:@"File %@ does not exist at path %@", filename, filepath]; + return YES; + } + + BOOL deleted = [fileManager removeItemAtPath:filepath error:&error]; + + if (!deleted) { + [ADJAdjustFactory.logger verbose:@"Unable to delete file %@ at path %@", filename, filepath]; + } + + if (error) { + [ADJAdjustFactory.logger error:@"Error (%@) deleting file %@", [error localizedDescription], filename]; + } + + return deleted; +} + ++ (void)launchDeepLinkMain:(NSURL *)deepLinkUrl { + UIApplication * sharedUIApplication = [UIApplication sharedApplication]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" + SEL openUrlSelector = @selector(openURL:options:completionHandler:); +#pragma clang diagnostic pop + + if ([sharedUIApplication respondsToSelector:openUrlSelector]) { + /* + [sharedUIApplication openURL:deepLinkUrl options:@{} completionHandler:^(BOOL success) { + if (!success) { + [ADJAdjustFactory.logger error:@"Unable to open deep link (%@)", deepLinkUrl]; + } + }]; + */ + + NSMethodSignature * methSig = [sharedUIApplication methodSignatureForSelector: openUrlSelector]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: methSig]; + + [invocation setSelector: openUrlSelector]; + [invocation setTarget: sharedUIApplication]; + + NSDictionary * emptyDictionary = @{}; + void (^completion)(BOOL) = ^(BOOL success) { + if (!success) { + [ADJAdjustFactory.logger error:@"Unable to open deep link (%@)", deepLinkUrl]; + } + }; + + [invocation setArgument: &deepLinkUrl atIndex: 2]; + [invocation setArgument: &emptyDictionary atIndex: 3]; + [invocation setArgument: &completion atIndex: 4]; + + [invocation invoke]; + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + BOOL success = [sharedUIApplication openURL:deepLinkUrl]; +#pragma clang diagnostic pop + + if (!success) { + [ADJAdjustFactory.logger error:@"Unable to open deep link (%@)", deepLinkUrl]; + } + } +} + @end diff --git a/Adjust/Adjust.h b/Adjust/Adjust.h index 41c0213f2..337479af3 100644 --- a/Adjust/Adjust.h +++ b/Adjust/Adjust.h @@ -11,13 +11,13 @@ #import "ADJConfig.h" /** - * Constants for our supported tracking environments. + * Constants for our supported tracking environments */ extern NSString * const ADJEnvironmentSandbox; extern NSString * const ADJEnvironmentProduction; /** - * The main interface to Adjust. + * The main interface to Adjust * * Use the methods of this class to tell Adjust about the usage of your app. * See the README for details. @@ -25,92 +25,151 @@ extern NSString * const ADJEnvironmentProduction; @interface Adjust : NSObject /** - * Tell Adjust that the application did launch. + * Tell Adjust that the application did launch * * This is required to initialize Adjust. Call this in the didFinishLaunching * method of your AppDelegate. * * See ADJConfig.h for more configuration options * - * @param adjustConfig The configuration object that includes the environment - * and the App Token of your app. This unique identifier can - * be found it in your dashboard at http://adjust.com and should always - * be 12 characters long. + * @param adjustConfig The configuration object that includes the environment + * and the App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long. */ + (void)appDidLaunch:(ADJConfig *)adjustConfig; /** - * Tell Adjust that a particular event has happened. + * Tell Adjust that a particular event has happened * - * See ADJEvent.h for more event options + * See ADJEvent.h for more event options. * * @param event The Event object for this kind of event. It needs a event token - * that is created in the dashboard at http://adjust.com and should be six - * characters long. + * that is created in the dashboard at http://adjust.com and should be six + * characters long. */ + (void)trackEvent:(ADJEvent *)event; /** - * Tell adjust that the application resumed. + * Tell adjust that the application resumed * * Only necessary if the native notifications can't be used */ + (void)trackSubsessionStart; /** - * Tell adjust that the application paused. + * Tell adjust that the application paused * * Only necessary if the native notifications can't be used */ + (void)trackSubsessionEnd; /** - * Enable or disable the adjust SDK. This setting is saved - * for future sessions + * Enable or disable the adjust SDK. This setting is saved for future sessions * - * @param enabled The flag to enable or disable the adjust SDK + * @param enabled The flag to enable or disable the adjust SDK */ + (void)setEnabled:(BOOL)enabled; /** * Check if the SDK is enabled or disabled + * + * return Boolean indicating whether SDK is enabled or not */ + (BOOL)isEnabled; /** - * Read the URL that opened the application to search for - * an adjust deep link + * Read the URL that opened the application to search for an adjust deep link + * + * @param url URL object which contains info about adjust deep link */ + (void)appWillOpenUrl:(NSURL *)url; /** * Set the device token used by push notifications + * + * @param deviceToken Apple push notification token for iOS device */ + (void)setDeviceToken:(NSData *)deviceToken; /** - * Enable or disable offline mode. Activities won't be sent - * but they are saved when offline mode is disabled. This - * feature is not saved for future sessions + * Enable or disable offline mode. Activities won't be sent but they are saved when + * offline mode is disabled. This feature is not saved for future sessions + * + * @param enabled The flag to enable or disable offline mode */ + (void)setOfflineMode:(BOOL)enabled; /** * Convert a universal link style url to a deeplink style url with the corresponding scheme + * + * @param url URL object which contains info about adjust deep link + * @param scheme Desired scheme to which you want your resulting URL object to be prefixed with + * + * @return URL object in custom URL scheme style prefixed with given scheme name */ -+ (NSURL*)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; ++ (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; /** - * Retrieve iOS device IDFA value. + * Retrieve iOS device IDFA value + * + * @return Device IDFA value */ -+ (NSString*)idfa; ++ (NSString *)idfa; + +/** + * Tell the adjust SDK to stop waiting for delayed initialisation timer to complete but rather to start + * upon this call. This should be called if you have obtained needed callback/partner parameters which you + * wanted to put as default ones before the delayedStart value you have set on ADJConfig has expired + */ ++ (void)sendFirstPackages; /** * Tell adjust to send the request to Google and check if the installation - * belongs to Google AdWords campaign. + * belongs to Google AdWords campaign */ + (void)sendAdWordsRequest; +/** + * Add default callback parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default callback parameter key + * @param value Default callback parameter value + */ ++ (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +/** + * Add default partner parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default partner parameter key + * @param value Default partner parameter value + */ ++ (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; + +/** + * Remove default callback parameter from the session packages + * + * @param key Default callback parameter key + */ ++ (void)removeSessionCallbackParameter:(NSString *)key; + +/** + * Remove default partner parameter from the session packages + * + * @param key Default partner parameter key + */ ++ (void)removeSessionPartnerParameter:(NSString *)key; + +/** + * Remove all default callback parameters from the session packages + */ ++ (void)resetSessionCallbackParameters; + +/** + * Remove all default partner parameters from the session packages + */ ++ (void)resetSessionPartnerParameters; + /** * Obtain singleton Adjust object */ @@ -118,15 +177,25 @@ extern NSString * const ADJEnvironmentProduction; - (void)appDidLaunch:(ADJConfig *)adjustConfig; - (void)trackEvent:(ADJEvent *)event; -- (void)trackSubsessionStart; -- (void)trackSubsessionEnd; - (void)setEnabled:(BOOL)enabled; -- (BOOL)isEnabled; +- (void)teardown:(BOOL)deleteState; - (void)appWillOpenUrl:(NSURL *)url; -- (void)setDeviceToken:(NSData *)deviceToken; - (void)setOfflineMode:(BOOL)enabled; -- (NSURL*)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; -- (NSString*)idfa; +- (void)setDeviceToken:(NSData *)deviceToken; + +- (BOOL)isEnabled; +- (NSString *)idfa; +- (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +- (void)sendFirstPackages; - (void)sendAdWordsRequest; +- (void)trackSubsessionEnd; +- (void)trackSubsessionStart; +- (void)resetSessionPartnerParameters; +- (void)resetSessionCallbackParameters; +- (void)removeSessionPartnerParameter:(NSString *)key; +- (void)removeSessionCallbackParameter:(NSString *)key; +- (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; +- (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; @end diff --git a/Adjust/Adjust.m b/Adjust/Adjust.m index 57d28c244..97dc2dc29 100644 --- a/Adjust/Adjust.m +++ b/Adjust/Adjust.m @@ -23,8 +23,9 @@ @interface Adjust() -@property (nonatomic, retain) id logger; -@property (nonatomic, retain) id activityHandler; +@property (nonatomic, strong) id activityHandler; +@property (nonatomic, weak) id logger; +@property (nonatomic, strong) NSMutableArray* sessionParametersActionsArray; @end @@ -79,6 +80,38 @@ + (NSURL*)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme { return [[Adjust getInstance] convertUniversalLink:url scheme:scheme]; } ++ (void)sendFirstPackages { + [[Adjust getInstance] sendFirstPackages]; +} + ++ (void)addSessionCallbackParameter:(NSString *)key + value:(NSString *)value { + [[Adjust getInstance] addSessionCallbackParameter:key value:value]; + +} + ++ (void)addSessionPartnerParameter:(NSString *)key + value:(NSString *)value { + [[Adjust getInstance] addSessionPartnerParameter:key value:value]; +} + + ++ (void)removeSessionCallbackParameter:(NSString *)key { + [[Adjust getInstance] removeSessionCallbackParameter:key]; +} + ++ (void)removeSessionPartnerParameter:(NSString *)key { + [[Adjust getInstance] removeSessionPartnerParameter:key]; +} + ++ (void)resetSessionCallbackParameters { + [[Adjust getInstance] resetSessionCallbackParameters]; +} + ++ (void)resetSessionPartnerParameters { + [[Adjust getInstance] resetSessionPartnerParameters]; +} + + (id)getInstance { static Adjust *defaultInstance = nil; static dispatch_once_t onceToken; @@ -105,7 +138,8 @@ - (void)appDidLaunch:(ADJConfig *)adjustConfig { return; } - self.activityHandler = [ADJAdjustFactory activityHandlerWithConfig:adjustConfig]; + self.activityHandler = [ADJAdjustFactory activityHandlerWithConfig:adjustConfig + sessionParametersActionsArray:self.sessionParametersActionsArray]; } - (void)trackEvent:(ADJEvent *)event { @@ -160,9 +194,115 @@ - (NSURL*)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme { return [ADJUtil convertUniversalLink:url scheme:scheme]; } +- (void)sendFirstPackages { + if (![self checkActivityHandler]) return; + [self.activityHandler sendFirstPackages]; +} + +- (void)addSessionCallbackParameter:(NSString *)key + value:(NSString *)value { + if (self.activityHandler != nil) { + [self.activityHandler addSessionCallbackParameter:key value:value]; + return; + } + + if (self.sessionParametersActionsArray == nil) { + self.sessionParametersActionsArray = [[NSMutableArray alloc] init]; + } + + [self.sessionParametersActionsArray addObject:^(ADJActivityHandler * activityHandler){ + [activityHandler addSessionCallbackParameterI:activityHandler key:key value:value]; + }]; +} + +- (void)addSessionPartnerParameter:(NSString *)key + value:(NSString *)value { + if (self.activityHandler != nil) { + [self.activityHandler addSessionPartnerParameter:key value:value]; + return; + } + + if (self.sessionParametersActionsArray == nil) { + self.sessionParametersActionsArray = [[NSMutableArray alloc] init]; + } + + [self.sessionParametersActionsArray addObject:^(ADJActivityHandler * activityHandler){ + [activityHandler addSessionPartnerParameterI:activityHandler key:key value:value]; + }]; +} + +- (void)removeSessionCallbackParameter:(NSString *)key { + if (self.activityHandler != nil) { + [self.activityHandler removeSessionCallbackParameter:key]; + return; + } + + if (self.sessionParametersActionsArray == nil) { + self.sessionParametersActionsArray = [[NSMutableArray alloc] init]; + } + + [self.sessionParametersActionsArray addObject:^(ADJActivityHandler * activityHandler){ + [activityHandler removeSessionCallbackParameterI:activityHandler key:key]; + }]; +} + +- (void)removeSessionPartnerParameter:(NSString *)key { + if (self.activityHandler != nil) { + [self.activityHandler removeSessionPartnerParameter:key]; + return; + } + + if (self.sessionParametersActionsArray == nil) { + self.sessionParametersActionsArray = [[NSMutableArray alloc] init]; + } + + [self.sessionParametersActionsArray addObject:^(ADJActivityHandler * activityHandler){ + [activityHandler removeSessionPartnerParameterI:activityHandler key:key]; + }]; +} + +- (void)resetSessionCallbackParameters { + if (self.activityHandler != nil) { + [self.activityHandler resetSessionCallbackParameters]; + return; + } + + if (self.sessionParametersActionsArray == nil) { + self.sessionParametersActionsArray = [[NSMutableArray alloc] init]; + } + + [self.sessionParametersActionsArray addObject:^(ADJActivityHandler * activityHandler){ + [activityHandler resetSessionCallbackParametersI:activityHandler]; + }]; +} + +- (void)resetSessionPartnerParameters { + if (self.activityHandler != nil) { + [self.activityHandler resetSessionPartnerParameters]; + return; + } + + if (self.sessionParametersActionsArray == nil) { + self.sessionParametersActionsArray = [[NSMutableArray alloc] init]; + } + + [self.sessionParametersActionsArray addObject:^(ADJActivityHandler * activityHandler){ + [activityHandler resetSessionPartnerParametersI:activityHandler]; + }]; +} + +- (void)teardown:(BOOL)deleteState { + if (self.activityHandler == nil) { + [self.logger error:@"Adjust already down or not initialized"]; + return; + } + [self.activityHandler teardown:deleteState]; + self.activityHandler = nil; +} + #pragma mark - private -- (BOOL) checkActivityHandler { +- (BOOL)checkActivityHandler { if (self.activityHandler == nil) { [self.logger error:@"Please initialize Adjust by calling 'appDidLaunch' before"]; return NO; diff --git a/AdjustBridge/AdjustBridge.m b/AdjustBridge/AdjustBridge.m index 53f75bcba..f001d5d38 100644 --- a/AdjustBridge/AdjustBridge.m +++ b/AdjustBridge/AdjustBridge.m @@ -6,7 +6,8 @@ // Copyright © 2016 adjust GmbH. All rights reserved. // -#import "Adjust.h" +// #import "Adjust.h" +#import // In case of erroneous import statement try with: // #import // (depends how you import the adjust SDK to your app) diff --git a/AdjustSdkTv/AdjustSdkTv.h b/AdjustSdkTv/AdjustSdkTv.h new file mode 100644 index 000000000..bf083fa5a --- /dev/null +++ b/AdjustSdkTv/AdjustSdkTv.h @@ -0,0 +1,27 @@ +// +// AdjustSdkTv.h +// AdjustSdkTv +// +// Created by Uglješa Erceg on 29/08/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +//! Project version number for AdjustSdkTv. +FOUNDATION_EXPORT double AdjustSdkTvVersionNumber; + +//! Project version string for AdjustSdkTv. +FOUNDATION_EXPORT const unsigned char AdjustSdkTvVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/AdjustSdkTv/Info.plist b/AdjustSdkTv/Info.plist new file mode 100644 index 000000000..d3de8eefb --- /dev/null +++ b/AdjustSdkTv/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/AdjustTests/ADJActivityHandlerConstructorState.h b/AdjustTests/ADJActivityHandlerConstructorState.h new file mode 100644 index 000000000..03a65608d --- /dev/null +++ b/AdjustTests/ADJActivityHandlerConstructorState.h @@ -0,0 +1,23 @@ +// +// ADJActivityHandlerConstructorState.h +// Adjust +// +// Created by Pedro Filipe on 30/06/2016. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +#import "ADJConfig.h" + +@interface ADJActivityHandlerConstructorState : NSObject + +@property (nonatomic, strong) ADJConfig * config; +@property (nonatomic, copy) NSString * readActivityState; +@property (nonatomic, copy) NSString * readAttribution; +@property (nonatomic, assign) BOOL startEnabled; +@property (nonatomic, strong) NSArray * sessionParametersActionsArray; +@property (nonatomic, assign) BOOL isToUpdatePackages; + +- (id)initWithConfig:(ADJConfig *)config; +@end diff --git a/AdjustTests/ADJActivityHandlerConstructorState.m b/AdjustTests/ADJActivityHandlerConstructorState.m new file mode 100644 index 000000000..f7e75c0af --- /dev/null +++ b/AdjustTests/ADJActivityHandlerConstructorState.m @@ -0,0 +1,27 @@ +// +// ADJActivityHandlerConstructorState.m +// Adjust +// +// Created by Pedro Filipe on 30/06/2016. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import "ADJActivityHandlerConstructorState.h" + +@implementation ADJActivityHandlerConstructorState + +- (id)initWithConfig:(ADJConfig *)config { + self = [super init]; + if (self == nil) return nil; + + self.config = config; + + // default values + self.readActivityState = nil; + self.readAttribution = nil; + self.startEnabled = YES; + self.isToUpdatePackages = NO;\ + + return self; +} +@end diff --git a/AdjustTests/ADJActivityHandlerMock.m b/AdjustTests/ADJActivityHandlerMock.m index 71a3b0e8a..9020bf376 100644 --- a/AdjustTests/ADJActivityHandlerMock.m +++ b/AdjustTests/ADJActivityHandlerMock.m @@ -21,13 +21,15 @@ @interface ADJActivityHandlerMock() @implementation ADJActivityHandlerMock -- (id)initWithConfig:(ADJConfig *)adjustConfig { +- (id)initWithConfig:(ADJConfig *)adjustConfig +sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray +{ self = [super init]; if (self == nil) return nil; self.loggerMock = (ADJLoggerMock *) [ADJAdjustFactory logger]; - [self.loggerMock test:[prefix stringByAppendingFormat:@"initWithConfig"]]; + [self.loggerMock test:[prefix stringByAppendingFormat:@"initWithConfig, %@", sessionParametersActionsArray]]; return self; } @@ -94,7 +96,7 @@ - (void) setAskingAttribution:(BOOL)askingAttribution { [self.loggerMock test:[prefix stringByAppendingFormat:@"setAskingAttribution, %d", askingAttribution]]; } -- (BOOL) updateAttribution:(ADJAttribution*) attribution { +- (BOOL)updateAttributionI:(id)selfI attribution:(ADJAttribution *)attribution { [self.loggerMock test:[prefix stringByAppendingFormat:@"updateAttribution, %@", attribution]]; self.attributionUpdated = attribution; return NO; @@ -118,4 +120,38 @@ - (ADJInternalState*) internalState { return nil; } +- (void)sendFirstPackages { + [self.loggerMock test:[prefix stringByAppendingFormat:@"sendFirstPackages"]]; +} + +- (void)addSessionCallbackParameter:(NSString *)key + value:(NSString *)value { + [self.loggerMock test:[prefix stringByAppendingFormat:@"addSessionCallbackParameter, key %@ value, %@", key, value]]; +} + +- (void)addSessionPartnerParameter:(NSString *)key + value:(NSString *)value { + [self.loggerMock test:[prefix stringByAppendingFormat:@"addSessionPartnerParameter, key %@ value, %@", key, value]]; +} + +- (void)removeSessionCallbackParameter:(NSString *)key { + [self.loggerMock test:[prefix stringByAppendingFormat:@"removeSessionCallbackParameter, %@", key]]; +} + +- (void)removeSessionPartnerParameter:(NSString *)key { + [self.loggerMock test:[prefix stringByAppendingFormat:@"removeSessionPartnerParameter, %@", key]]; +} + +- (void)resetSessionCallbackParameters { + [self.loggerMock test:[prefix stringByAppendingFormat:@"resetSessionCallbackParameters"]]; +} + +- (void)resetSessionPartnerParameters { + [self.loggerMock test:[prefix stringByAppendingFormat:@"resetSessionPartnerParameters"]]; +} + +- (void)teardown:(BOOL)deleteState { + [self.loggerMock test:[prefix stringByAppendingFormat:@"teardown"]]; +} + @end diff --git a/AdjustTests/ADJActivityHandlerTests.m b/AdjustTests/ADJActivityHandlerTests.m index b420ab0d0..47126c069 100644 --- a/AdjustTests/ADJActivityHandlerTests.m +++ b/AdjustTests/ADJActivityHandlerTests.m @@ -23,6 +23,9 @@ #import "ADJSdkClickHandlerMock.h" #import "ADJSessionState.h" #import "ADJDeeplinkDelegate.h" +#import "ADJActivityHandlerConstructorState.h" +#import "ADJEndSessionState.h" +#import "ADJInitState.h" @interface ADJActivityHandlerTests : ADJTestActivityPackage @@ -80,6 +83,9 @@ - (void)reset { // starting from a clean slate XCTAssert([ADJTestsUtil deleteFile:@"AdjustIoActivityState" logger:self.loggerMock], @"%@", self.loggerMock); XCTAssert([ADJTestsUtil deleteFile:@"AdjustIoAttribution" logger:self.loggerMock], @"%@", self.loggerMock); + XCTAssert([ADJTestsUtil deleteFile:@"AdjustSessionParameters" logger:self.loggerMock], @"%@", self.loggerMock); + XCTAssert([ADJTestsUtil deleteFile:@"AdjustSessionCallbackParameters" logger:self.loggerMock], @"%@", self.loggerMock); + XCTAssert([ADJTestsUtil deleteFile:@"AdjustSessionPartnerParameters" logger:self.loggerMock], @"%@", self.loggerMock); } - (void)testFirstSession @@ -112,7 +118,7 @@ - (void)testEventBuffered [self reset]; // create the config to start the session - ADJConfig * config = [self getConfig:ADJLogLevelVerbose]; + ADJConfig * config = [self getConfig]; // buffer events config.eventBufferingEnabled = YES; @@ -121,22 +127,19 @@ - (void)testEventBuffered [config setDefaultTracker:@"default1234tracker"]; // create handler and start the first session - id activityHandler = [self getFirstActivityHandler:config logLevel:ADJLogLevelVerbose]; + id activityHandler = [self getFirstActivityHandler:config]; [NSThread sleepForTimeInterval:2.0]; // test init values - [self checkInitTests:YES defaultTracker:@"default1234tracker" startsSending:NO]; - - [self startActivity:activityHandler]; - - [NSThread sleepForTimeInterval:2.0]; + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + initState.eventBufferingIsEnabled = YES; + initState.defaultTracker = @"default1234tracker"; ADJSessionState * sessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; sessionState.eventBufferingIsEnabled = YES; - // test first session start - [self checkStartInternal:sessionState]; + [self checkInitAndStart:initState sessionState:sessionState]; // create the first Event object with callback and partner parameters ADJEvent * firstEvent = [ADJEvent eventWithEventToken:@"event1"]; @@ -323,22 +326,10 @@ - (void)testEventsNotBuffered [self reset]; // create the config to start the session - ADJConfig * config = [self getConfig:ADJLogLevelDebug]; + ADJConfig * config = [self getConfig]; // start activity handler with config - id activityHandler = [self getFirstActivityHandler:config logLevel:ADJLogLevelDebug]; - - [NSThread sleepForTimeInterval:2.0]; - - // test init values - [self checkInitTests]; - - [self startActivity:activityHandler]; - - [NSThread sleepForTimeInterval:2.0]; - - // test session - [self checkFirstSession]; + id activityHandler = [self startAndCheckFirstSession:config]; // create the first Event ADJEvent * firstEvent = [ADJEvent eventWithEventToken:@"event1"]; @@ -364,6 +355,45 @@ - (void)testEventsNotBuffered aDebug(@"Wrote Activity state"); } +- (void)testEventBeforeStart { + // reseting to make the test order independent + [self reset]; + + // create the config to start the session + ADJConfig * config = [self getConfig]; + + // create the first Event + ADJEvent * firstEvent = [ADJEvent eventWithEventToken:@"event1"]; + + // start activity handler with config + id activityHandler = [self getFirstActivityHandler:config]; + + // track event + [activityHandler trackEvent:firstEvent]; + + [NSThread sleepForTimeInterval:2]; + + // test session + ADJSessionState * sessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; + // does not start until it goes to foreground + sessionState.foregroundTimerStarts = NO; + sessionState.toSend = NO; + sessionState.startSubSession = NO; + + // XXX + // test init values + [self checkInitAndStartTestsWithHandler:activityHandler]; + + // check that event package was added + aTest(@"PackageHandler addPackage"); + + // check that event was sent to package handler + aTest(@"PackageHandler sendFirstPackage"); + + // after tracking the event it should write the activity state + aDebug(@"Wrote Activity state: ec:1 sc:1 ssc:1"); +} + - (void)testChecks { // reseting to make the test order independent @@ -394,13 +424,15 @@ - (void)testChecks aFalse(wrongEnvironmentConfig.isValid); // activity handler created with a nil config - id nilConfigActivityHandler = [ADJActivityHandler handlerWithConfig:nil]; + id nilConfigActivityHandler = [ADJActivityHandler handlerWithConfig:nil + sessionParametersActionsArray:nil]; aError(@"AdjustConfig missing"); aNil(nilConfigActivityHandler); // activity handler created with an invalid config - id invalidConfigActivityHandler = [ADJActivityHandler handlerWithConfig:nilAppTokenConfig]; + id invalidConfigActivityHandler = [ADJActivityHandler handlerWithConfig:nilAppTokenConfig + sessionParametersActionsArray:nil]; aError(@"AdjustConfig not initialized correctly"); aNil(invalidConfigActivityHandler); @@ -418,7 +450,7 @@ - (void)testChecks aFalse(malformedTokenEvent.isValid); // create the config to start the session - ADJConfig * config = [self getConfig:ADJLogLevelInfo]; + ADJConfig * config = [self getConfig]; // set the delegate that doesn't implement the optional selector ADJTestsUtil * delegateNotImpl = [[ADJTestsUtil alloc] init]; @@ -427,19 +459,7 @@ - (void)testChecks aError(@"Delegate does not implement any optional method"); // create handler and start the first session - id activityHandler = [self getFirstActivityHandler:config logLevel:ADJLogLevelInfo]; - - [NSThread sleepForTimeInterval:2]; - - // test init values - [self checkInitTests]; - - [self startActivity:activityHandler]; - - [NSThread sleepForTimeInterval:2.0]; - - // test first session start - [self checkFirstSession]; + id activityHandler = [self startAndCheckFirstSession:config]; // track null event [activityHandler trackEvent:nil]; @@ -558,8 +578,61 @@ - (void)testChecks // test first event [self testEventPackage:eventPackage fields:eventFields eventToken:@"event1"]; + + [activityHandler resetSessionCallbackParameters]; + [activityHandler resetSessionPartnerParameters]; + + [activityHandler removeSessionCallbackParameter:nil]; + [activityHandler removeSessionCallbackParameter:@""]; + [activityHandler removeSessionCallbackParameter:@"nonExistent"]; + + [activityHandler removeSessionPartnerParameter:nil]; + [activityHandler removeSessionPartnerParameter:@""]; + [activityHandler removeSessionPartnerParameter:@"nonExistent"]; + + [activityHandler addSessionCallbackParameter:nil value:@"value"]; + [activityHandler addSessionCallbackParameter:@"" value:@"value"]; + + [activityHandler addSessionCallbackParameter:@"key" value:nil]; + [activityHandler addSessionCallbackParameter:@"key" value:@""]; + + [activityHandler addSessionPartnerParameter:nil value:@"value"]; + [activityHandler addSessionPartnerParameter:@"" value:@"value"]; + + [activityHandler addSessionPartnerParameter:@"key" value:nil]; + [activityHandler addSessionPartnerParameter:@"key" value:@""]; + + [activityHandler removeSessionCallbackParameter:@"nonExistent"]; + [activityHandler removeSessionPartnerParameter:@"nonExistent"]; + + [NSThread sleepForTimeInterval:2]; + + aWarn(@"Session Callback parameters are not set"); + aWarn(@"Session Partner parameters are not set"); + + aError(@"Session Callback parameter key is missing"); + aError(@"Session Callback parameter key is empty"); + aWarn(@"Session Callback parameters are not set"); + + aError(@"Session Partner parameter key is missing"); + aError(@"Session Partner parameter key is empty"); + aWarn(@"Session Partner parameters are not set"); + + aError(@"Session Callback parameter key is missing"); + aError(@"Session Callback parameter key is empty"); + aError(@"Session Callback parameter value is missing"); + aError(@"Session Callback parameter value is empty"); + + aError(@"Session Partner parameter key is missing"); + aError(@"Session Partner parameter key is empty"); + aError(@"Session Partner parameter value is missing"); + aError(@"Session Partner parameter value is empty"); + + aWarn(@"Session Callback parameters are not set"); + aWarn(@"Session Partner parameters are not set"); } + - (void)testSessions { // reseting to make the test order independent @@ -570,10 +643,10 @@ - (void)testSessions [ADJAdjustFactory setSubsessionInterval:(1)]; // 1 second // create the config to start the session - ADJConfig * config = [self getConfig:ADJLogLevelWarn]; + ADJConfig * config = [self getConfig]; // create handler and start the first session - id activityHandler = [self startAndCheckFirstSession:config logLevel:ADJLogLevelWarn]; + id activityHandler = [self startAndCheckFirstSession:config]; [self stopActivity:activityHandler]; @@ -582,13 +655,19 @@ - (void)testSessions // test the end of the subsession [self checkEndSession]; - [self startActivity:activityHandler]; + [activityHandler applicationDidBecomeActive]; + + ADJInternalState * internalState = [activityHandler internalState]; + + // comes to the foreground + aTrue([internalState isForeground]); [NSThread sleepForTimeInterval:1]; // test the new sub session ADJSessionState * secondSubsession = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; secondSubsession.subsessionCount = 2; + secondSubsession.toSend = YES; [self checkStartInternal:secondSubsession]; [self stopActivity:activityHandler]; @@ -599,7 +678,7 @@ - (void)testSessions [self checkEndSession]; // trigger a new session - [self startActivity:activityHandler]; + [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:1]; @@ -607,20 +686,25 @@ - (void)testSessions ADJSessionState * secondSession = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; secondSession.sessionCount = 2; secondSession.timerAlreadyStarted = YES; + secondSession.toSend = YES; [self checkStartInternal:secondSession]; // stop and start the activity with little interval // so it won't trigger a sub session [self stopActivity:activityHandler]; - [self startActivity:activityHandler]; + [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:1]; // test the end of the subsession - [self checkEndSession:NO updateActivityState:YES eventBufferingEnabled:NO]; + ADJEndSessionState * endState = [[ADJEndSessionState alloc] init]; + endState.pausing = NO; + + [self checkEndSession:endState]; // test non sub session ADJSessionState * nonSessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeNonSession]; + nonSessionState.toSend = YES; [self checkStartInternal:nonSessionState]; // 2 session packages @@ -647,6 +731,7 @@ - (void)testSessions [self testPackageSession:secondSessionActivityPackage fields:secondSessionPackageFields sessionCount:@"2"]; } + - (void)testDisable { // reseting to make the test order independent @@ -661,10 +746,14 @@ - (void)testDisable [ADJAdjustFactory setSubsessionInterval:(1)]; // 1 second // create the config to start the session - ADJConfig * config = [self getConfig:ADJLogLevelError]; + ADJConfig * config = [self getConfig]; // start activity handler with config - id activityHandler = [self getFirstActivityHandler:config logLevel:ADJLogLevelError]; + // start activity handler with config + id activityHandler = [self getFirstActivityHandler:config]; + + // check that it is enabled + aTrue([activityHandler isEnabled]); // disable sdk [activityHandler setEnabled:NO]; @@ -672,49 +761,38 @@ - (void)testDisable // check that it is disabled aFalse([activityHandler isEnabled]); - [NSThread sleepForTimeInterval:2.0]; - // not writing activity state because it set enable does not start the sdk anDebug(@"Wrote Activity state"); // check if message the disable of the SDK - aInfo(@"Package handler and attribution handler will start as paused due to the SDK being disabled"); + aInfo(@"Handlers will start as paused due to the SDK being disabled"); + + [NSThread sleepForTimeInterval:4.0]; // test init values - [self checkInitTests:NO]; + [self checkInitAndStartTestsWithHandler:activityHandler]; + // disable runs after start [self checkHandlerStatus:YES]; - // start the sdk - // foreground timer does not start because it's paused - [self startActivity:activityHandler]; - - [NSThread sleepForTimeInterval:2.0]; + // try to do activities while SDK disabled + [activityHandler applicationDidBecomeActive]; + [activityHandler trackEvent:[ADJEvent eventWithEventToken:@"event1"]]; - ADJSessionState * sessionStartsPaused = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; + [NSThread sleepForTimeInterval:3]; - sessionStartsPaused.paused = YES; - sessionStartsPaused.toSend = NO; - sessionStartsPaused.foregroundTimerStarts = NO; - sessionStartsPaused.foregroundTimerAlreadyStarted = NO; + aVerbose(@"Subsession start"); - // check session that is paused - [self checkStartInternal:sessionStartsPaused]; + [self checkStartDisable]; [self stopActivity:activityHandler]; [NSThread sleepForTimeInterval:1.0]; + ADJEndSessionState * endState = [[ADJEndSessionState alloc] init]; + endState.updateActivityState = NO; // test end session of disable - [self checkEndSession:YES updateActivityState:YES eventBufferingEnabled:NO]; - - // try to do activities while SDK disabled - [activityHandler applicationDidBecomeActive]; - [activityHandler trackEvent:[ADJEvent eventWithEventToken:@"event1"]]; - - [NSThread sleepForTimeInterval:3]; - - [self checkStartDisable]; + [self checkEndSession:endState]; // only the first session package should be sent aiEquals(1, (int)[self.packageHandlerMock.packageQueue count]); @@ -723,7 +801,7 @@ - (void)testDisable [activityHandler setOfflineMode:YES]; // pausing due to offline mode - aInfo(@"Pausing package and attribution handler to put SDK offline mode"); + aInfo(@"Pausing handlers to put SDK offline mode"); // wait to update status [NSThread sleepForTimeInterval:5.0]; @@ -739,27 +817,27 @@ - (void)testDisable aTrue([activityHandler isEnabled]); // check message of SDK still paused - aInfo(@"Package and attribution handler remain paused due to SDK being offline"); + aInfo(@"Handlers remain paused"); [NSThread sleepForTimeInterval:1.0]; - // due to the fact it will remained paused, - // there is no need to try to update the status - [self checkHandlerStatusNotCalled]; + // even though it will remained paused, + // it will update the status to paused + [self checkHandlerStatus:YES]; // start the sdk // foreground timer does not start because it's offline - [self startActivity:activityHandler]; + [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:1.0]; ADJSessionState * secondPausedSession = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; secondPausedSession.toSend = NO; - secondPausedSession.paused = YES; secondPausedSession.sessionCount = 2; secondPausedSession.foregroundTimerStarts = NO; - sessionStartsPaused.foregroundTimerAlreadyStarted = NO; + secondPausedSession.foregroundTimerAlreadyStarted = NO; + [self checkStartInternal:secondPausedSession]; // track an event @@ -810,7 +888,7 @@ - (void)testDisable [activityHandler setOfflineMode:NO]; // message that is finally resuming - aInfo(@"Resuming package handler and attribution handler to put SDK in online mode"); + aInfo(@"Resuming handlers to put SDK in online mode"); [NSThread sleepForTimeInterval:1.0]; @@ -818,7 +896,7 @@ - (void)testDisable // it is still paused because it's on the background [self checkHandlerStatus:YES]; - [self startActivity:activityHandler]; + [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:1.0]; @@ -827,6 +905,7 @@ - (void)testDisable thirdSessionStarting.sessionCount = 3; thirdSessionStarting.eventCount = 1; thirdSessionStarting.timerAlreadyStarted = NO; + thirdSessionStarting.toSend = YES; [self checkStartInternal:thirdSessionStarting]; } @@ -837,11 +916,10 @@ - (void)testAppWillOpenUrl [self reset]; // create the config to start the session - ADJConfig * config = [self getConfig:ADJLogLevelAssert]; + ADJConfig * config = [self getConfig]; // start activity handler with config - id activityHandler = [self startAndCheckFirstSession:config - logLevel:ADJLogLevelAssert]; + id activityHandler = [self startAndCheckFirstSession:config]; NSURL* attributions = [NSURL URLWithString:@"AdjustTests://example.com/path/inApp?adjust_tracker=trackerValue&other=stuff&adjust_campaign=campaignValue&adjust_adgroup=adgroupValue&adjust_creative=creativeValue"]; NSURL* extraParams = [NSURL URLWithString:@"AdjustTests://example.com/path/inApp?adjust_foo=bar&other=stuff&adjust_key=value"]; @@ -992,7 +1070,7 @@ - (void)testIadDates ADJConfig * config = [self getConfig]; // create handler and start the first session - id activityHandler =[self startAndCheckFirstSession:config]; + id activityHandler = [self startAndCheckFirstSession:config]; // should be ignored [activityHandler setIadDate:nil withPurchaseDate:nil]; @@ -1241,26 +1319,10 @@ - (void)testLaunchDeepLink [self reset]; // create the config to start the session - ADJConfig * config = [self getConfig:@"production" logLevel:ADJLogLevelVerbose appToken:@"qwerty123456"]; + ADJConfig * config = [self getConfig]; // start the session - id activityHandler = [self - getActivityHandler:config - logLevel:ADJLogLevelVerbose - isProductionEnvironment:YES - readActivityState:nil - readAttribution:nil - startEnabled:YES]; - - [NSThread sleepForTimeInterval:2.0]; - - [self checkInitTests:NO defaultTracker:nil startsSending:NO]; - - [self startActivity:activityHandler]; - - [NSThread sleepForTimeInterval:2.0]; - - [self checkFirstSession]; + id activityHandler = [self startAndCheckFirstSession:config]; [activityHandler finishedTracking:nil]; @@ -1275,25 +1337,36 @@ - (void)testLaunchDeepLink ADJActivityPackage * sessionPackage = self.packageHandlerMock.packageQueue[0]; ADJSessionResponseData * sessionResponseData = [ADJResponseData buildResponseData:sessionPackage]; - sessionResponseData.jsonResponse = [self getDeeplinkDictionary]; [activityHandler launchSessionResponseTasks:sessionResponseData]; [NSThread sleepForTimeInterval:2.0]; + // does not launch deeplink from session responses anymore + anInfo(@"Open deep link (wrongDeeplink://)"); + + // test attribution response + ADJActivityPackage * attributionPackage = self.attributionHandlerMock.attributionPackage; + ADJAttributionResponseData * attributionResponseData = [ADJResponseData buildResponseData:attributionPackage]; + attributionResponseData.deeplink = [NSURL URLWithString:@"wrongDeeplink://"]; + + [activityHandler launchAttributionResponseTasks:attributionResponseData]; + [NSThread sleepForTimeInterval:2.0]; + aInfo(@"Open deep link (wrongDeeplink://)"); // checking the default values of the first session package // should only have one package aiEquals(1, (int)[self.packageHandlerMock.packageQueue count]); - ADJActivityPackage *activityPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[0]; + //ADJActivityPackage *activityPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[0]; // create activity package test - ADJPackageFields * fields = [ADJPackageFields fields]; + //ADJPackageFields * fields = [ADJPackageFields fields]; - fields.environment = @"production"; + //fields.environment = @"production"; // set first session - [self testPackageSession:activityPackage fields:fields sessionCount:@"1"]; + //[self testPackageSession:activityPackage fields:fields sessionCount:@"1"]; + } - (void)testNotLaunchDeeplinkCallback { @@ -1310,14 +1383,14 @@ - (void)testNotLaunchDeeplinkCallback { // start activity handler with config id activityHandler = [self startAndCheckFirstSession:config]; - // get session response data - ADJActivityPackage * sessionPackage = self.packageHandlerMock.packageQueue[0]; + // get attribution response data + ADJActivityPackage * attributionPackage = self.attributionHandlerMock.attributionPackage; - // set package handler to respond with a valid attribution - ADJSessionResponseData * sessionResponseData = [ADJResponseData buildResponseData:sessionPackage]; - sessionResponseData.jsonResponse = [self getDeeplinkDictionary]; + // try to open deeplink + ADJAttributionResponseData * attributionResponseData = [ADJResponseData buildResponseData:attributionPackage]; + attributionResponseData.deeplink = [NSURL URLWithString:@"wrongDeeplink://"]; - [activityHandler launchSessionResponseTasks:sessionResponseData]; + [activityHandler launchAttributionResponseTasks:attributionResponseData]; [NSThread sleepForTimeInterval:2.0]; @@ -1349,14 +1422,14 @@ - (void)testDeeplinkCallback // start activity handler with config id activityHandler = [self startAndCheckFirstSession:config]; - // get session response data - ADJActivityPackage * sessionPackage = self.packageHandlerMock.packageQueue[0]; + // get attribution response data + ADJActivityPackage * attributionPackage = self.attributionHandlerMock.attributionPackage; - // set package handler to respond with a valid attribution - ADJSessionResponseData * sessionResponseData = [ADJResponseData buildResponseData:sessionPackage]; - sessionResponseData.jsonResponse = [self getDeeplinkDictionary]; + // try to open deeplink + ADJAttributionResponseData * attributionResponseData = [ADJResponseData buildResponseData:attributionPackage]; + attributionResponseData.deeplink = [NSURL URLWithString:@"wrongDeeplink://"]; - [activityHandler launchSessionResponseTasks:sessionResponseData]; + [activityHandler launchAttributionResponseTasks:attributionResponseData]; [NSThread sleepForTimeInterval:2.0]; @@ -1395,14 +1468,14 @@ - (void)testUpdateAttribution aNil(nilAttribution); // check it does not update a nil attribution - aFalse([activityHandler updateAttribution:nilAttribution]); + aFalse([activityHandler updateAttributionI:activityHandler attribution:nilAttribution]); // create an empty attribution NSMutableDictionary * emptyJsonDictionary = [[NSMutableDictionary alloc] init]; ADJAttribution * emptyAttribution = [[ADJAttribution alloc] initWithJsonDict:emptyJsonDictionary]; // check that updates attribution - aTrue([activityHandler updateAttribution:emptyAttribution]); + aTrue([activityHandler updateAttributionI:activityHandler attribution:emptyAttribution]); aDebug(@"Wrote Attribution: tt:(null) tn:(null) net:(null) cam:(null) adg:(null) cre:(null) cl:(null)"); emptyAttribution = [[ADJAttribution alloc] initWithJsonDict:emptyJsonDictionary]; @@ -1431,30 +1504,23 @@ - (void)testUpdateAttribution // set delegate to see attribution launched [config setDelegate:attributionChangedDelegate]; - id restartActivityHandler = [self getActivityHandler:config - logLevel:ADJLogLevelInfo - isProductionEnvironment:NO - readActivityState:@"ec:0 sc:1 ssc:1" - readAttribution:@"tt:(null) tn:(null) net:(null) cam:(null) adg:(null) cre:(null) cl:(null)" - startEnabled:YES]; - - [NSThread sleepForTimeInterval:2]; - - // test init values - [self checkInitTests]; - - [self startActivity:restartActivityHandler]; + ADJActivityHandlerConstructorState * restartCState = [[ADJActivityHandlerConstructorState alloc] initWithConfig:config]; + restartCState.readActivityState = @"ec:0 sc:1 ssc:1"; + restartCState.readAttribution = @"tt:(null) tn:(null) net:(null) cam:(null) adg:(null) cre:(null) cl:(null)"; + id restartActivityHandler = [self getActivityHandler:restartCState]; [NSThread sleepForTimeInterval:2]; - ADJSessionState * firstRestart = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; firstRestart.subsessionCount = 2; firstRestart.timerAlreadyStarted = NO; - [self checkStartInternal:firstRestart]; + firstRestart.toSend = NO; + + // test init values + [self checkInitAndStartTestsWithHandler:restartActivityHandler sessionState:firstRestart]; // check that it does not update the attribution after the restart - aFalse([restartActivityHandler updateAttribution:emptyAttribution]); + aFalse([restartActivityHandler updateAttributionI:activityHandler attribution:emptyAttribution]); anDebug(@"Wrote Attribution"); // new attribution @@ -1511,28 +1577,23 @@ - (void)testUpdateAttribution // set delegate to see attribution launched [config setDelegate:attributionChangedDelegate]; - id secondRestartActivityHandler = [self getActivityHandler:config - logLevel:ADJLogLevelInfo - isProductionEnvironment:NO - readActivityState:@"ec:0 sc:1 ssc:2" - readAttribution:@"tt:ttValue tn:tnValue net:nValue cam:cpValue adg:aValue cre:ctValue cl:clValue" - startEnabled:YES]; - - [NSThread sleepForTimeInterval:2]; - - [self checkInitTests]; + ADJActivityHandlerConstructorState * secondRestartCState = [[ADJActivityHandlerConstructorState alloc] initWithConfig:config]; + secondRestartCState.readActivityState = @"ec:0 sc:1 ssc:2"; + secondRestartCState.readAttribution = @"tt:ttValue tn:tnValue net:nValue cam:cpValue adg:aValue cre:ctValue cl:clValue"; - [self startActivity:secondRestartActivityHandler]; + id secondRestartActivityHandler = [self getActivityHandler:secondRestartCState]; [NSThread sleepForTimeInterval:2]; ADJSessionState * secondRestart = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; secondRestart.subsessionCount = 3; secondRestart.timerAlreadyStarted = NO; - [self checkStartInternal:secondRestart]; + secondRestart.toSend = NO; + + [self checkInitAndStartTestsWithHandler:secondRestartActivityHandler sessionState:secondRestart]; // check that it does not update the attribution after the restart - aFalse([secondRestartActivityHandler updateAttribution:firstAttribution]); + aFalse([secondRestartActivityHandler updateAttributionI:secondRestartActivityHandler attribution:firstAttribution]); anDebug(@"Wrote Attribution"); // new attribution @@ -1563,11 +1624,10 @@ - (void)testUpdateAttribution aTest(@"ADJAttributionChangedDelegate adjustAttributionChanged, tt:ttValue2 tn:tnValue2 net:nValue2 cam:cpValue2 adg:aValue2 cre:ctValue2 cl:clValue2"); // check that it does not update the attribution - aFalse([secondRestartActivityHandler updateAttribution:secondAttribution]); + aFalse([secondRestartActivityHandler updateAttributionI:secondRestartActivityHandler attribution:secondAttribution]); anDebug(@"Wrote Attribution"); } - - (void)testOfflineMode { // reseting to make the test order independent @@ -1583,50 +1643,52 @@ - (void)testOfflineMode // start activity handler with config id activityHandler = [self getFirstActivityHandler:config]; + ADJInternalState * internalState = [activityHandler internalState]; + + // check that it is online + aTrue([internalState isOnline]); + // put SDK offline [activityHandler setOfflineMode:YES]; - ADJInternalState * internalState = [activityHandler internalState]; - aTrue([internalState isOffline]); - [NSThread sleepForTimeInterval:2]; - // not writing activity state because it set enable does not start the sdk anDebug(@"Wrote Activity state"); // check if message the disable of the SDK - aInfo(@"Package handler and attribution handler will start paused due to SDK being offline"); + aInfo(@"Handlers will start paused due to SDK being offline"); + + [NSThread sleepForTimeInterval:3.0]; // test init values - [self checkInitTests:NO]; + [self checkInitAndStartTestsWithHandler:activityHandler]; + // offline runs after start [self checkHandlerStatus:YES]; - // start the sdk - // foreground timer does not start because it's paused - [self startActivity:activityHandler]; + // start the second session + [activityHandler applicationDidBecomeActive]; - [NSThread sleepForTimeInterval:2]; + [NSThread sleepForTimeInterval:1]; - // test first session start - ADJSessionState * firstSessionStartPaused = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; - firstSessionStartPaused.paused = YES; - firstSessionStartPaused.toSend = NO; - firstSessionStartPaused.foregroundTimerStarts = NO; - firstSessionStartPaused.foregroundTimerAlreadyStarted = NO; + // test second session start + ADJSessionState * secondSessionStartPaused = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; + + secondSessionStartPaused.sessionCount = 2; + secondSessionStartPaused.toSend = NO; + secondSessionStartPaused.foregroundTimerStarts = NO; + secondSessionStartPaused.foregroundTimerAlreadyStarted = NO; // check session that is paused - [self checkStartInternal:firstSessionStartPaused]; + [self checkStartInternal:secondSessionStartPaused]; [self stopActivity:activityHandler]; [NSThread sleepForTimeInterval:1]; // test end session of disable - [self checkEndSession:YES - updateActivityState:NO - eventBufferingEnabled:NO]; + [self checkEndSession]; // disable the SDK [activityHandler setEnabled:NO]; @@ -1635,10 +1697,10 @@ - (void)testOfflineMode aFalse([activityHandler isEnabled]); // writing activity state after disabling - aDebug(@"Wrote Activity state: ec:0 sc:1 ssc:1"); + aDebug(@"Wrote Activity state: ec:0 sc:2 ssc:1"); // check if message the disable of the SDK - aInfo(@"Pausing package handler and attribution handler due to SDK being disabled"); + aInfo(@"Pausing handlers due to SDK being disabled"); [NSThread sleepForTimeInterval:1]; @@ -1647,12 +1709,13 @@ - (void)testOfflineMode // put SDK back online [activityHandler setOfflineMode:NO]; - aInfo(@"Package and attribution handler remain paused due to SDK being disabled"); + aInfo(@"Handlers remain paused"); [NSThread sleepForTimeInterval:1]; - // test the update status, still paused - [self checkHandlerStatusNotCalled]; + // even though it will remained paused, + // it will update the status to paused + [self checkHandlerStatus:YES]; // try to do activities while SDK disabled [activityHandler applicationDidBecomeActive]; @@ -1674,7 +1737,10 @@ - (void)testOfflineMode [NSThread sleepForTimeInterval:1]; - [self checkEndSession:NO]; + ADJEndSessionState * endStateDoNotPause = [[ADJEndSessionState alloc] init]; + endStateDoNotPause.updateActivityState = NO; + + [self checkEndSession:endStateDoNotPause]; // enable the SDK again [activityHandler setEnabled:YES]; @@ -1682,27 +1748,26 @@ - (void)testOfflineMode // check that is enabled aTrue([activityHandler isEnabled]); - [NSThread sleepForTimeInterval:1]; + [NSThread sleepForTimeInterval:3]; aDebug(@"Wrote Activity state"); // check that it re-enabled - aInfo(@"Resuming package handler and attribution handler due to SDK being enabled"); - - [NSThread sleepForTimeInterval:1]; + aInfo(@"Resuming handlers due to SDK being enabled"); // it is still paused because it's on the background [self checkHandlerStatus:YES]; - [self startActivity:activityHandler]; + [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:1]; - ADJSessionState * secondSessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; - secondSessionState.sessionCount = 2; + ADJSessionState * thirdSessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; + thirdSessionState.sessionCount = 3; + thirdSessionState.toSend = YES; // test that is not paused anymore - [self checkStartInternal:secondSessionState]; + [self checkStartInternal:thirdSessionState]; } - (void)testGetAttribution @@ -1726,20 +1791,13 @@ - (void)testGetAttribution [NSThread sleepForTimeInterval:2.0]; - // test init values - [self checkInitTests]; - - [self startActivity:activityHandler]; - - [NSThread sleepForTimeInterval:2.0]; - /*** - * // if it' a new session + * if it' a new session * if (self.activityState.subsessionCount <= 1) { * return; * } * - * // if there is already an attribution saved and there was no attribution being asked + * if there is already an attribution saved and there was no attribution being asked * if (self.attribution != nil && !self.activityState.askingAttribution) { * return; * } @@ -1755,7 +1813,9 @@ - (void)testGetAttribution // test first session start ADJSessionState * newSessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; newSessionState.getAttributionIsCalled = [NSNumber numberWithBool:NO]; - [self checkStartInternal:newSessionState]; + + // test init values + [self checkInitAndStartTestsWithHandler:activityHandler sessionState:newSessionState]; // subsession count increased to 2 // attribution is still null, @@ -1778,7 +1838,7 @@ - (void)testGetAttribution aDebug(@"Wrote Activity state: ec:0 sc:1 ssc:2"); // trigger a new session - [self startActivity:activityHandler]; + [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:2.0]; [self checkSubSession:1 subsessionCount:3 getAttributionIsCalled:YES]; @@ -1818,7 +1878,7 @@ - (void)testGetAttribution ADJAttribution * attribution = [[ADJAttribution alloc] initWithJsonDict:attributionDictionary]; // update the attribution - [activityHandler updateAttribution:attribution]; + [activityHandler updateAttributionI:activityHandler attribution:attribution]; // attribution was updated aDebug(@"Wrote Attribution: tt:ttValue tn:tnValue net:nValue cam:cpValue adg:aValue cre:ctValue cl:clValue"); @@ -1878,12 +1938,28 @@ - (void)testForegroundTimer // create the config to start the session ADJConfig * config = [self getConfig]; - // create handler and start the first session - id activityHandler = [self startAndCheckFirstSession:config]; + // create handler and start the first session + id activityHandler = [self getFirstActivityHandler:config]; - // wait enough to fire the first cycle - [NSThread sleepForTimeInterval:1.0]; + [NSThread sleepForTimeInterval:2.0]; + + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + initState.foregroundTimerCycle = 4; + initState.foregroundTimerStart = 4; + [self checkInitTests:initState]; + + [self checkFirstSession]; + [activityHandler applicationDidBecomeActive]; + [NSThread sleepForTimeInterval:5.0]; + + ADJSessionState * subSessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; + subSessionState.subsessionCount = 2; + subSessionState.toSend = YES; + + [self checkStartInternal:subSessionState]; + + // wait enough to fire the first cycle [self checkForegroundTimerFired:YES]; // end subsession to stop timer @@ -1898,8 +1974,12 @@ - (void)testForegroundTimer [NSThread sleepForTimeInterval:1]; // check that not enough time passed to fire again - [self checkForegroundTimerFired:NO]; + //[self checkForegroundTimerFired:NO]; + + // enough time passed since it was suspended + [self checkForegroundTimerFired:YES]; +/* // end subsession to stop timer [activityHandler applicationWillResignActive]; @@ -1913,6 +1993,7 @@ - (void)testForegroundTimer // check that enough time passed to fire again [self checkForegroundTimerFired:YES]; + */ } - (void)testSendBackground { @@ -1929,18 +2010,27 @@ - (void)testSendBackground { // create activity handler without starting id activityHandler = [self getFirstActivityHandler:config]; + [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:2.0]; // handlers start sending - [self checkInitTests:NO defaultTracker:nil startsSending:YES]; + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + initState.startsSending = YES; + initState.sendInBackgroundConfigured = YES; + initState.foregroundTimerCycle = 4; - [self startActivity:activityHandler]; + // test session + ADJSessionState * sesssionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; + sesssionState.sendInBackgroundConfigured = YES; + sesssionState.toSend = YES; - [NSThread sleepForTimeInterval:2.0]; + [self checkInitAndStart:initState sessionState:sesssionState]; - // test session - [self checkFirstSession]; + ADJSessionState * nonSessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeNonSession]; + //subSessionState.subsessionCount = 2; + nonSessionState.toSend = YES; + [self checkStartInternal:nonSessionState]; // end subsession // background timer starts @@ -1949,12 +2039,12 @@ - (void)testSendBackground { [NSThread sleepForTimeInterval:1.0]; // session end does not pause the handlers - [self checkEndSession:NO - updateActivityState:YES - eventBufferingEnabled:NO - checkOnPause:YES -forgroundAlreadySuspended:NO - backgroundTimerStarts:YES]; + ADJEndSessionState * endSession1 = [[ADJEndSessionState alloc] init]; + endSession1.pausing = NO; + endSession1.checkOnPause = YES; + endSession1.backgroundTimerStarts = YES; + + [self checkEndSession:endSession1]; // end subsession again // to test if background timer starts again @@ -1962,13 +2052,13 @@ - (void)testSendBackground { [NSThread sleepForTimeInterval:1.0]; + ADJEndSessionState * endSession2 = [[ADJEndSessionState alloc] init]; + endSession2.pausing = NO; + endSession2.checkOnPause = YES; + endSession2.forgroundAlreadySuspended = YES; + // session end does not pause the handlers - [self checkEndSession:NO - updateActivityState:YES - eventBufferingEnabled:NO - checkOnPause:YES -forgroundAlreadySuspended:YES - backgroundTimerStarts:NO]; + [self checkEndSession:endSession2]; // wait for background timer launch [NSThread sleepForTimeInterval:3.0]; @@ -2008,7 +2098,7 @@ - (void)testSendBackground { aFalse([activityHandler isEnabled]); // check if message the disable of the SDK - aInfo(@"Pausing package handler and attribution handler due to SDK being disabled"); + aInfo(@"Pausing handlers due to SDK being disabled"); [NSThread sleepForTimeInterval:1.0]; @@ -2021,7 +2111,7 @@ - (void)testSendBackground { aTrue([activityHandler isEnabled]); // check if message the enable of the SDK - aInfo(@"Resuming package handler and attribution handler due to SDK being enabled"); + aInfo(@"Resuming handlers due to SDK being enabled"); [NSThread sleepForTimeInterval:1.0]; @@ -2038,7 +2128,7 @@ - (void)testSendBackground { aTrue([internalState isOffline]); // check if message the offline of the SDK - aInfo(@"Pausing package and attribution handler to put SDK offline mode"); + aInfo(@"Pausing handlers to put SDK offline mode"); [NSThread sleepForTimeInterval:1.0]; @@ -2051,7 +2141,7 @@ - (void)testSendBackground { aTrue([internalState isOnline]); // check if message the online of the SDK - aInfo(@"Resuming package handler and attribution handler to put SDK in online mode"); + aInfo(@"Resuming handlers to put SDK in online mode"); [NSThread sleepForTimeInterval:1.0]; @@ -2060,7 +2150,6 @@ - (void)testSendBackground { [self checkHandlerStatus:NO]; } - - (void)testConvertUniversalLink { // reseting to make the test order independent @@ -2068,10 +2157,8 @@ - (void)testConvertUniversalLink // nil url aNil([ADJUtil convertUniversalLink:nil scheme:nil]); - aWarn(@"Non-empty scheme required, using the scheme \"AdjustUniversalScheme\""); aError(@"Received universal link is nil"); - #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnonnull" NSURL* nilStringUrl = [NSURL URLWithString:nil]; @@ -2079,7 +2166,6 @@ - (void)testConvertUniversalLink // empty url aNil([ADJUtil convertUniversalLink:nilStringUrl scheme:nil]); - aWarn(@"Non-empty scheme required, using the scheme \"AdjustUniversalScheme\""); aError(@"Received universal link is nil"); // nil scheme @@ -2105,7 +2191,7 @@ - (void)testConvertUniversalLink // non Universal Url NSURL * nonUniversalUrl = [NSURL URLWithString:@"AdjustTestScheme://nonUniversalUrl"]; aNil([ADJUtil convertUniversalLink:nonUniversalUrl scheme:adjustScheme]); - aError(@"Url doesn't match as universal link with format https://[hash].ulink.adjust.com/ulink/..."); + aError(@"Url doesn't match as universal link or short version"); // path / anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/"] scheme:adjustScheme]); @@ -2176,119 +2262,722 @@ - (void)testConvertUniversalLink aInfo(@"Converted deeplink from universal link AdjustTestScheme://yourpath?key=value&foo=bar#fragment"); } -- (NSURL*)getUniversalLinkUrl:(NSString*)path +- (void)testRemoveRedirect { - return [NSURL URLWithString:[NSString - stringWithFormat:@"https://[hash].ulink.adjust.com/ulink%@", path]]; -} + // reseting to make the test order independent + [self reset]; -- (NSURL*)getUniversalLinkUrl:(NSString*)path - query:(NSString*)query - fragment:(NSString*)fragment -{ - return [NSURL URLWithString:[NSString - stringWithFormat:@"https://[hash].ulink.adjust.com/ulink%@%@%@", path, query, fragment]]; -} + // custom scheme empty path + NSString * adjustScheme = @"AdjustTestScheme"; -- (void)checkForegroundTimerFired:(BOOL)timerFired -{ - // timer fired - if (timerFired) { - aVerbose(@"Foreground timer fired"); - } else { - anVerbose(@"Foreground timer fired"); - } + // path / query ?key=value&foo=bar&adjust_redirect=test + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?key=value&foo=bar&adjust_redirect=test"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://?key=value&foo=bar"); + + // path / query ?key=value&adjust_redirect=test&foo=bar + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?key=value&adjust_redirect=test&foo=bar"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://?key=value&foo=bar"); + + // path / query ?adjust_redirect=test&key=value&foo=bar + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?adjust_redirect=test&key=value&foo=bar"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://?key=value&foo=bar"); + + // path / query ?adjust_redirect=test + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?adjust_redirect=test"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://"); + + // path / query ?key=value&foo=bar&adjust_redirect=test#fragment + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?key=value&foo=bar&adjust_redirect=test#fragment"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://?key=value&foo=bar#fragment"); + + // path / query ?adjust_redirect=test#fragment + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?adjust_redirect=test#fragment"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://#fragment"); + + // path / query ?adjust_redirect=test&foo=bar#fragment + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?adjust_redirect=test&foo=bar#fragment"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://?foo=bar#fragment"); + + // path / query ?foo=bar&adjust_redirect=test#fragment + anNil([ADJUtil convertUniversalLink:[self getUniversalLinkUrl:@"/?foo=bar&adjust_redirect=test#fragment"] scheme:adjustScheme]); + aInfo(@"Converted deeplink from universal link AdjustTestScheme://?foo=bar#fragment"); +} + +- (void)testSessionParameters { + // reseting to make the test order independent + [self reset]; + + // create the config to start the session + ADJConfig * config = [self getConfig]; + + // create handler and start the first session + ADJActivityHandlerConstructorState * cState = [[ADJActivityHandlerConstructorState alloc] initWithConfig:config]; + cState.sessionParametersActionsArray = @[^(ADJActivityHandler * activityHandler) + { + // + [activityHandler addSessionCallbackParameterI:activityHandler key:@"cKey" value:@"cValue"]; + [activityHandler addSessionCallbackParameterI:activityHandler key:@"cFoo" value:@"cBar"]; + + [activityHandler addSessionCallbackParameterI:activityHandler key:@"cKey" value:@"cValue2"]; + [activityHandler resetSessionCallbackParametersI:activityHandler]; + + [activityHandler addSessionCallbackParameterI:activityHandler key:@"cKey" value:@"cValue"]; + [activityHandler addSessionCallbackParameterI:activityHandler key:@"cFoo" value:@"cBar"]; + [activityHandler removeSessionCallbackParameterI:activityHandler key:@"cKey"]; + + // + [activityHandler addSessionPartnerParameterI:activityHandler key:@"pKey" value:@"pValue"]; + [activityHandler addSessionPartnerParameterI:activityHandler key:@"pFoo" value:@"pBar"]; + + [activityHandler addSessionPartnerParameterI:activityHandler key:@"pKey" value:@"pValue2"]; + [activityHandler resetSessionPartnerParametersI:activityHandler]; + + [activityHandler addSessionPartnerParameterI:activityHandler key:@"pKey" value:@"pValue"]; + [activityHandler addSessionPartnerParameterI:activityHandler key:@"pFoo" value:@"pBar"]; + [activityHandler removeSessionPartnerParameterI:activityHandler key:@"pKey"]; + }]; + + ADJEvent * firstEvent = [ADJEvent eventWithEventToken:@"abc123"]; + + id activityHandler = [self getActivityHandler:cState]; + + // track event + [activityHandler trackEvent:firstEvent]; + + [NSThread sleepForTimeInterval:2.0]; + + // + aDebug(@"Wrote Session Callback parameters: {\n cKey = cValue;\n}"); + aDebug(@"Wrote Session Callback parameters: {\n cFoo = cBar;\n cKey = cValue;\n}"); + + aWarn(@"Key cKey will be overwritten"); + aDebug(@"Wrote Session Callback parameters: {\n cFoo = cBar;\n cKey = cValue2;\n}"); + + aDebug(@"Wrote Session Callback parameters: (null)"); + + anWarn(@"Key cKey will be overwritten"); // XXX + aDebug(@"Wrote Session Callback parameters: {\n cKey = cValue;\n}"); + aDebug(@"Wrote Session Callback parameters: {\n cFoo = cBar;\n cKey = cValue;\n}"); + + aDebug(@"Key cKey will be removed"); + aDebug(@"Wrote Session Callback parameters: {\n cFoo = cBar;\n}"); + + // + aDebug(@"Wrote Session Partner parameters: {\n pKey = pValue;\n}"); + aDebug(@"Wrote Session Partner parameters: {\n pFoo = pBar;\n pKey = pValue;\n}"); + + aWarn(@"Key pKey will be overwritten"); + aDebug(@"Wrote Session Partner parameters: {\n pFoo = pBar;\n pKey = pValue2;\n}"); + + aDebug(@"Wrote Session Partner parameters: (null)"); + + anWarn(@"Key pKey will be overwritten"); // XXX + aDebug(@"Wrote Session Partner parameters: {\n pKey = pValue;\n}"); + aDebug(@"Wrote Session Partner parameters: {\n pFoo = pBar;\n pKey = pValue;\n}"); + + aDebug(@"Key pKey will be removed"); + aDebug(@"Wrote Session Partner parameters: {\n pFoo = pBar;\n}"); + + [self checkInitAndStartTestsWithHandler:activityHandler]; + + // check that event package was added + aTest(@"PackageHandler addPackage"); + + // check that event was sent to package handler + aTest(@"PackageHandler sendFirstPackage"); + + // after tracking the event it should write the activity state + aDebug(@"Wrote Activity state: ec:1 sc:1 ssc:1"); + + // 1 session + 1 event + aiEquals(2, (int)[self.packageHandlerMock.packageQueue count]); + + // get the session package + ADJActivityPackage * sessionPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[0]; + + // create event package test + ADJPackageFields * sessionPackageFields = [ADJPackageFields fields]; + + // set event test parameters + sessionPackageFields.callbackParameters = @"{\"cFoo\":\"cBar\"}"; + sessionPackageFields.partnerParameters = @"{\"pFoo\":\"pBar\"}"; + + [self testPackageSession:sessionPackage fields:sessionPackageFields sessionCount:@"1"]; + + // get the event + ADJActivityPackage * eventPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[1]; + + // create event package test + ADJPackageFields * eventPackageFields = [ADJPackageFields fields]; + + // set event test parameters + eventPackageFields.eventCount = @"1"; + eventPackageFields.suffix = @"'abc123'"; + eventPackageFields.callbackParameters = @"{\"cFoo\":\"cBar\"}"; + eventPackageFields.partnerParameters = @"{\"pFoo\":\"pBar\"}"; + + [self testEventPackage:eventPackage fields:eventPackageFields eventToken:@"abc123"]; + + // end current session + [activityHandler applicationWillResignActive]; + [NSThread sleepForTimeInterval:1.0]; + + [self checkEndSession]; + [activityHandler teardown:NO]; + activityHandler = nil; + [NSThread sleepForTimeInterval:1.0]; + + // start new one + ADJActivityHandlerConstructorState * cRestartState = [[ADJActivityHandlerConstructorState alloc] initWithConfig:config]; + cRestartState.readActivityState = @""; + + id restartActivityHandler = [self getActivityHandler:cRestartState]; + [NSThread sleepForTimeInterval:1.0]; + + // test init values + ADJInitState * restartInitState = [[ADJInitState alloc] initWithActivityHandler:restartActivityHandler]; + + // delay start not configured because activity state is already created + restartInitState.activityStateAlreadyCreated = YES; + restartInitState.readCallbackParameters = @"{\n cFoo = cBar;\n}"; + restartInitState.readPartnerParameters = @"{\n pFoo = pBar;\n}"; + + ADJSessionState * restartSessionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; + restartSessionState.subsessionCount = 2; + restartSessionState.eventCount = 1; + + [self checkInitAndStart:restartInitState sessionState:restartSessionState]; + + ADJEvent * event1 = [ADJEvent eventWithEventToken:@"abc123"]; + [event1 addCallbackParameter:@"ceFoo" value:@"ceBar"]; + [event1 addPartnerParameter:@"peFoo" value:@"peBar"]; + + [restartActivityHandler trackEvent:event1]; + + ADJEvent * event2 = [ADJEvent eventWithEventToken:@"abc123"]; + [event2 addCallbackParameter:@"cFoo" value:@"ceBar"]; + [event2 addPartnerParameter:@"pFoo" value:@"peBar"]; + + [restartActivityHandler trackEvent:event2]; + + [NSThread sleepForTimeInterval:2.0]; + + // 2 events + aiEquals(2, (int)[self.packageHandlerMock.packageQueue count]); + + // get the event + ADJActivityPackage * firstEventPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[0]; + + // create event package test + ADJPackageFields * firstEventPackageFields = [ADJPackageFields fields]; + + // set event test parameters + firstEventPackageFields.eventCount = @"2"; + firstEventPackageFields.suffix = @"'abc123'"; + firstEventPackageFields.callbackParameters = @"{\"cFoo\":\"cBar\",\"ceFoo\":\"ceBar\"}"; + firstEventPackageFields.partnerParameters = @"{\"pFoo\":\"pBar\",\"peFoo\":\"peBar\"}"; + + [self testEventPackage:firstEventPackage fields:firstEventPackageFields eventToken:@"abc123"]; + + // get the event + ADJActivityPackage * secondEventPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[1]; + + // create event package test + ADJPackageFields * secondEventPackageFields = [ADJPackageFields fields]; + + // set event test parameters + secondEventPackageFields.eventCount = @"3"; + secondEventPackageFields.suffix = @"'abc123'"; + secondEventPackageFields.callbackParameters = @"{\"cFoo\":\"ceBar\"}"; + secondEventPackageFields.partnerParameters = @"{\"pFoo\":\"peBar\"}"; + + [self testEventPackage:secondEventPackage fields:secondEventPackageFields eventToken:@"abc123"]; +} + +- (void)testDelayStartTimerFirst { + // reseting to make the test order independent + [self reset]; + + // create the config to start the session + ADJConfig * config = [self getConfig]; + + [config setDelayStart:4]; + + ADJActivityHandlerConstructorState * cState = [[ADJActivityHandlerConstructorState alloc] initWithConfig:config]; + + cState.sessionParametersActionsArray = @[^(ADJActivityHandler * activityHandler) + { + [activityHandler addSessionCallbackParameter:@"scpKey" value:@"scpValue"]; + [activityHandler addSessionPartnerParameter:@"sppKey" value:@"sppValue"]; + }]; + // create handler and start the first session + // start activity handler with config + id activityHandler = [self getActivityHandler:cState]; + + [NSThread sleepForTimeInterval:2.0]; + + // test init values + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + initState.delayStartConfigured = YES; + + [self checkInitAndStart:initState]; + + [activityHandler applicationDidBecomeActive]; + [activityHandler applicationDidBecomeActive]; + + // create the first Event object with callback and partner parameters + ADJEvent * firstEvent = [ADJEvent eventWithEventToken:@"event1"]; + + [firstEvent addCallbackParameter:@"keyCall" value:@"valueCall"]; + [firstEvent addPartnerParameter:@"keyPartner" value:@"valuePartner"]; + + [activityHandler trackEvent:firstEvent]; + + [NSThread sleepForTimeInterval:1.0]; + + // test session + ADJSessionState * subSesssionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; + // foreground timer does not start XXX change so that fTimer does not pause + subSesssionState.foregroundTimerStarts = NO; + // delay start means it starts paused + subSesssionState.toSend = NO; + // sdk click handler does not start paused + subSesssionState.sdkClickHandlerAlsoPauses = NO; + // delay configured + subSesssionState.delayStart = @"4.0"; + subSesssionState.subsessionCount = 2; + + [self checkStartInternal:subSesssionState]; + + subSesssionState.delayStart = nil; + subSesssionState.sessionType = ADJSessionTypeNonSession; + + [self checkStartInternal:subSesssionState]; + + // check that event package was added and tried to send + aTest(@"PackageHandler addPackage"); + aTest(@"PackageHandler sendFirstPackage"); + + [NSThread sleepForTimeInterval:4.0]; + + aVerbose(@"Delay Start timer fired"); + + [self checkSendFirstPackages:YES internalState:[activityHandler internalState] activityStateCreated:YES pausing:NO]; + + [activityHandler sendFirstPackages]; + [NSThread sleepForTimeInterval:1.0]; + + [self checkSendFirstPackages:NO internalState:[activityHandler internalState] activityStateCreated:YES pausing:NO]; + + // 1 session + 1 event + aiEquals(2, (int)[self.packageHandlerMock.packageQueue count]); + + // get the first event + ADJActivityPackage * firstEventPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[1]; + + // create event package test + ADJPackageFields * firstPackageFields = [ADJPackageFields fields]; + + // set event test parameters + firstPackageFields.eventCount = @"1"; + firstPackageFields.savedCallbackParameters = @{@"keyCall":@"valueCall"}; + firstPackageFields.savedPartnerParameters = @{@"keyPartner":@"valuePartner"}; + firstPackageFields.suffix = @"'event1'"; + + // test first event + [self testEventPackage:firstEventPackage fields:firstPackageFields eventToken:@"event1"]; +} + +- (void)testDelayStartSendFirst { + // reseting to make the test order independent + [self reset]; + + // create the config to start the session + ADJConfig * config = [self getConfig]; + + [config setDelayStart:5]; + + // create handler and start the first session + // start activity handler with config + id activityHandler = [self getFirstActivityHandler:config]; + + [NSThread sleepForTimeInterval:2.0]; + + // test init values + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + initState.delayStartConfigured = YES; + + [self checkInitAndStart:initState]; + + [activityHandler applicationDidBecomeActive]; + [activityHandler applicationDidBecomeActive]; + + [NSThread sleepForTimeInterval:1.0]; + + // test first subSession + ADJSessionState * subSesssionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; + // foreground timer does not start + subSesssionState.foregroundTimerStarts = NO; + // delay start means it starts paused + subSesssionState.toSend = NO; + // sdk click handler does not start paused + subSesssionState.sdkClickHandlerAlsoPauses = NO; + // delay configured + subSesssionState.delayStart = @"5.0"; + subSesssionState.subsessionCount = 2; + + [self checkStartInternal:subSesssionState]; + + subSesssionState.delayStart = nil; + subSesssionState.sessionType = ADJSessionTypeNonSession; + + [self checkStartInternal:subSesssionState]; + + [activityHandler sendFirstPackages]; + + [NSThread sleepForTimeInterval:3.0]; + + anVerbose(@"Delay Start timer fired"); + + [self checkSendFirstPackages:YES internalState:[activityHandler internalState] activityStateCreated:YES pausing:NO]; + + [activityHandler sendFirstPackages]; + [NSThread sleepForTimeInterval:1.0]; + + [self checkSendFirstPackages:NO internalState:[activityHandler internalState] activityStateCreated:YES pausing:NO]; +} + +- (void)testUpdateStart { + // reseting to make the test order independent + [self reset]; + + // create the config to start the session + ADJConfig * config = [self getConfig]; + + [config setDelayStart:10.1]; + + // create handler and start the first session + // start activity handler with config + id activityHandler = [self getFirstActivityHandler:config]; + + [NSThread sleepForTimeInterval:2.0]; + + // test init values + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + initState.delayStartConfigured = YES; + [self checkInitAndStart:initState]; + //[self checkInitTests:initState]; + + [activityHandler applicationDidBecomeActive]; + + [NSThread sleepForTimeInterval:1.0]; + + // test session + ADJSessionState * subSesssionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; + // foreground timer does not start + subSesssionState.foregroundTimerStarts = NO; + // delay start means it starts paused + subSesssionState.toSend = NO; + // sdk click handler does not start paused + subSesssionState.sdkClickHandlerAlsoPauses = NO; + // delay configured + subSesssionState.delayStart = @"10.1"; + subSesssionState.subsessionCount = 2; + + [self checkStartInternal:subSesssionState]; + + //[self checkSendFirstPackages:YES internalState:[activityHandler internalState] activityStateCreated:YES pausing:NO]; + // did not update and send packages + anTest(@"PackageHandler updatePackages"); + + [activityHandler applicationWillResignActive]; + [NSThread sleepForTimeInterval:1.0]; + + [self checkEndSession]; + [activityHandler teardown:NO]; + activityHandler = nil; + [NSThread sleepForTimeInterval:1.0]; + + ADJActivityHandlerConstructorState * cState = [[ADJActivityHandlerConstructorState alloc] initWithConfig:config]; + cState.readActivityState = @""; + cState.isToUpdatePackages = YES; + id restartActivityHandler = [self getActivityHandler:cState]; + [NSThread sleepForTimeInterval:1.0]; + + // test init values + ADJInitState * restartInitState = [[ADJInitState alloc] initWithActivityHandler:restartActivityHandler]; + + // delay start not configured because activity state is already created + restartInitState.updatePackages = YES; + restartInitState.activityStateAlreadyCreated = YES; + //restartInitState.readSessionParameters = @""; + + ADJSessionState * restartSubSesssionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSubSession]; + restartSubSesssionState.subsessionCount = 3; + restartSubSesssionState.toSend = NO; + + [self checkInitAndStart:restartInitState sessionState:restartSubSesssionState]; +} + +- (void)testLogLevel { + // reseting to make the test order independent + [self reset]; + + // create the config to start the session + ADJConfig * config = [self getConfig]; + + config.logLevel = ADJLogLevelVerbose; + config.logLevel = ADJLogLevelDebug; + config.logLevel = ADJLogLevelInfo; + config.logLevel = ADJLogLevelWarn; + config.logLevel = ADJLogLevelError; + config.logLevel = ADJLogLevelAssert; + + aTest(@"ADJLogger setLogLevel: 1"); + aTest(@"ADJLogger setLogLevel: 2"); + aTest(@"ADJLogger setLogLevel: 3"); + aTest(@"ADJLogger setLogLevel: 4"); + aTest(@"ADJLogger setLogLevel: 5"); + aTest(@"ADJLogger setLogLevel: 6"); + + config.logLevel = ADJLogLevelSuppress; + // chooses Assert because config object was not configured to allow suppress + aTest(@"ADJLogger setLogLevel: 6"); + + // init log level with assert because it was not configured to allow suppress + config = [self getConfig:@"production" appToken:@"qwerty123456" allowSuppressLogLevel:NO initLogLevel:@"6"]; + + config.logLevel = ADJLogLevelSuppress; + // chooses Assert because config object was not configured to allow suppress + aTest(@"ADJLogger setLogLevel: 6"); + + // init with info because it's sandbox + config = [self getConfig:@"sandbox" appToken:@"qwerty123456" allowSuppressLogLevel:YES initLogLevel:@"3"]; + + config.logLevel = ADJLogLevelSuppress; + // chooses Suppress because config object was configured to allow suppress + aTest(@"ADJLogger setLogLevel: 7"); + + // init with info because it's sandbox + config = [self getConfig:@"production" appToken:@"qwerty123456" allowSuppressLogLevel:YES initLogLevel:@"7"]; + + config.logLevel = ADJLogLevelAssert; + // chooses Suppress because config object was configured to allow suppress + aTest(@"ADJLogger setLogLevel: 7"); +} + +- (void)testTeardown { + // reseting to make the test order independent + [self reset]; + + // change the timer defaults + [ADJAdjustFactory setTimerInterval:4]; + //[ADJAdjustFactory setTimerStart:4]; + + // create the config to start the session + ADJConfig * config = [self getConfig]; + + [config setDelayStart:4]; + [config setSendInBackground:YES]; + + // create handler and start the first session + // start activity handler with config + id activityHandler = [self getFirstActivityHandler:config]; + + [NSThread sleepForTimeInterval:2.0]; + + // test init values + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + initState.delayStartConfigured = YES; + initState.sendInBackgroundConfigured = YES; + initState.startsSending = NO; + initState.sdkClickHandlerAlsoStartsPaused = NO; + initState.foregroundTimerCycle = 4; + + // test session + ADJSessionState * sesssionState = [ADJSessionState sessionStateWithSessionType:ADJSessionTypeSession]; + sesssionState.sendInBackgroundConfigured = YES; + sesssionState.foregroundTimerStarts = NO; + sesssionState.toSend = NO; + sesssionState.sdkClickHandlerAlsoPauses = NO; + + [self checkInitAndStart:initState sessionState:sesssionState]; + + //[NSThread sleepForTimeInterval:1.0]; + + [activityHandler teardown:NO]; + aVerbose(@"ADJActivityHandler teardown"); + + aTest(@"AttributionHandler teardown"); + aTest(@"PackageHandler teardown, deleteState: 0"); + aTest(@"SdkClickHandler teardown"); + + // when timer is cancel, it tries to resume what was halted + //aVerbose(@"Foreground timer dealloc"); + + [NSThread sleepForTimeInterval:5.0]; + + //[self checkEndSession]; + //[NSThread sleepForTimeInterval:5.0]; +} + +- (NSURL*)getUniversalLinkUrl:(NSString*)path +{ + return [NSURL URLWithString:[NSString + stringWithFormat:@"https://[hash].ulink.adjust.com/ulink%@", path]]; +} + +- (NSURL*)getUniversalLinkUrl:(NSString*)path + query:(NSString*)query + fragment:(NSString*)fragment +{ + return [NSURL URLWithString:[NSString + stringWithFormat:@"https://[hash].ulink.adjust.com/ulink%@%@%@", path, query, fragment]]; +} + +- (void)checkForegroundTimerFired:(BOOL)timerFired +{ + // timer fired + if (timerFired) { + aVerbose(@"Foreground timer fired"); + } else { + anVerbose(@"Foreground timer fired"); + } +} + +- (void)checkInitAndStart:(ADJInitState *)initState { + [self checkInitTests:initState]; + + [self checkFirstSession]; +} + +- (void)checkInitAndStartTestsWithHandler:(ADJActivityHandler *)activityHandler { + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + [self checkInitTests:initState]; + + [self checkFirstSession]; } -- (void)checkInitTests { - [self checkInitTests:NO]; +- (void)checkInitAndStart:(ADJInitState *)initState + sessionState:(ADJSessionState *)sessionState +{ + [self checkInitTests:initState]; + + [self checkStartInternal:sessionState]; } -- (void)checkInitTests:(BOOL)startsSending { - [self checkInitTests:NO defaultTracker:nil startsSending:startsSending]; +- (void)checkInitAndStartTestsWithHandler:(ADJActivityHandler *)activityHandler + sessionState:(ADJSessionState *)sessionState +{ + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + [self checkInitTests:initState]; + + [self checkStartInternal:sessionState]; } -- (void)checkInitTests:(BOOL)eventBuffering - defaultTracker:(NSString *) defaultTracker - startsSending:(BOOL)startsSending + +- (void)checkInitTestsWithHandler:(ADJActivityHandler *)activityHandler { + ADJInitState * initState = [[ADJInitState alloc] initWithActivityHandler:activityHandler]; + [self checkInitTests:initState]; +} + +- (void)checkInitTests:(ADJInitState *)initState { + if (initState.readCallbackParameters == nil) { + aVerbose(@"Session Callback parameters file not found"); + } else { + aDebug([@"Read Session Callback parameters: " stringByAppendingString:initState.readCallbackParameters]); + } + if (initState.readPartnerParameters == nil) { + aVerbose(@"Session Partner parameters file not found"); + } else { + aDebug([@"Read Session Partner parameters: " stringByAppendingString:initState.readPartnerParameters]); + } + // check event buffering - if (eventBuffering) { + if (initState.eventBufferingIsEnabled) { aInfo(@"Event buffering is enabled"); } else { anInfo(@"Event buffering is enabled"); } // check default tracker - if (defaultTracker != nil) { - NSString * defaultTrackerLog = [NSString stringWithFormat:@"Default tracker: '%@'", defaultTracker]; + if (initState.defaultTracker != nil) { + NSString * defaultTrackerLog = [NSString stringWithFormat:@"Default tracker: '%@'", initState.defaultTracker]; aInfo(defaultTrackerLog); } - if (startsSending) { + NSString * foregroundLog = [NSString stringWithFormat:@"Foreground timer configured to fire after %d.0 seconds of starting and cycles every %d.0 seconds", initState.foregroundTimerStart, initState.foregroundTimerCycle]; + aVerbose(foregroundLog); + + if (initState.sendInBackgroundConfigured) { + aInfo(@"Send in background configured"); + } else { + anInfo(@"Send in background configured"); + } + + if (initState.delayStartConfigured) { + aInfo(@"Delay start configured"); + aTrue(initState.internalState.delayStart); + } else { + anInfo(@"Delay start configured"); + aFalse(initState.internalState.delayStart); + } + + if (initState.startsSending) { aTest(@"PackageHandler initWithActivityHandler, startsSending: 1"); + } else { + aTest(@"PackageHandler initWithActivityHandler, startsSending: 0"); + } + + if (initState.updatePackages) { + [self checkUpdatePackages:initState.internalState activityStateCreated:initState.activityStateAlreadyCreated]; + } + + if (initState.startsSending) { aTest(@"AttributionHandler initWithActivityHandler, startsSending: 1"); aTest(@"SdkClickHandler initWithStartsSending, startsSending: 1"); } else { - aTest(@"PackageHandler initWithActivityHandler, startsSending: 0"); aTest(@"AttributionHandler initWithActivityHandler, startsSending: 0"); - aTest(@"SdkClickHandler initWithStartsSending, startsSending: 0"); + if (initState.sdkClickHandlerAlsoStartsPaused) { + aTest(@"SdkClickHandler initWithStartsSending, startsSending: 0"); + } else { + aTest(@"SdkClickHandler initWithStartsSending, startsSending: 1"); + } } } -- (void)checkEndSession { - [self checkEndSession:YES]; -} - -- (void)checkEndSession:(BOOL)updateActivityState { - [self checkEndSession:YES - updateActivityState:updateActivityState - eventBufferingEnabled:NO - checkOnPause:NO -forgroundAlreadySuspended:NO - backgroundTimerStarts:NO]; +- (void)checkEndSession +{ + ADJEndSessionState * endState = [[ADJEndSessionState alloc] init]; + [self checkEndSession:endState]; } -- (void)checkEndSession:(BOOL)pausing - updateActivityState:(BOOL)updateActivityState - eventBufferingEnabled:(BOOL)eventBufferingEnabled -{ - [self checkEndSession:pausing - updateActivityState:updateActivityState - eventBufferingEnabled:eventBufferingEnabled - checkOnPause:NO -forgroundAlreadySuspended:NO - backgroundTimerStarts:NO]; -} - -- (void)checkEndSession:(BOOL)pausing - updateActivityState:(BOOL)updateActivityState - eventBufferingEnabled:(BOOL)eventBufferingEnabled - checkOnPause:(BOOL)checkOnPause -forgroundAlreadySuspended:(BOOL)forgroundAlreadySuspended - backgroundTimerStarts:(BOOL)backgroundTimerStarts +- (void)checkEndSession:(ADJEndSessionState *)endState { - if (checkOnPause) { - [self checkOnPause:forgroundAlreadySuspended - backgroundTimerStarts:backgroundTimerStarts]; + if (endState.checkOnPause) { + [self checkOnPause:endState.forgroundAlreadySuspended + backgroundTimerStarts:endState.backgroundTimerStarts]; } - if (pausing) { - [self checkHandlerStatus:YES eventBufferingIsEnabled:eventBufferingEnabled]; + if (endState.pausing) { + [self checkHandlerStatus:endState.pausing + eventBufferingIsEnabled:endState.eventBufferingEnabled + sdkClickHandlerAlsoPauses:YES]; } - if (updateActivityState) { + if (endState.updateActivityState) { aDebug(@"Wrote Activity state: "); } else { anDebug(@"Wrote Activity state: "); } } -- (void) checkOnPause:(BOOL)forgroundAlreadySuspended +- (void) checkOnPause:(BOOL)foregroundAlreadySuspended backgroundTimerStarts:(BOOL)backgroundTimerStarts { // stop foreground timer - if (forgroundAlreadySuspended) { + if (foregroundAlreadySuspended) { aVerbose(@"Foreground timer is already suspended"); } else { aVerbose(@"Foreground timer suspended"); @@ -2322,20 +3011,26 @@ - (void)checkReadFiles:(NSString *)readActivityState } - (ADJConfig *)getConfig { - return [self getConfig:0]; -} -- (ADJConfig *)getConfig:(ADJLogLevel)logLevel -{ - return [self getConfig:@"sandbox" logLevel:logLevel appToken:@"qwerty123456"]; + return [self getConfig:@"sandbox" appToken:@"qwerty123456" allowSuppressLogLevel:NO initLogLevel:@"3"]; } - (ADJConfig *)getConfig:(NSString *)environment - logLevel:(ADJLogLevel)logLevel appToken:(NSString *)appToken + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel + initLogLevel:(NSString *)initLogLevel { - ADJConfig * config = [ADJConfig configWithAppToken:appToken environment:environment]; + ADJConfig * config = nil; + + if (allowSuppressLogLevel) { + config = [ADJConfig configWithAppToken:appToken environment:environment allowSuppressLogLevel:YES]; + } else { + config = [ADJConfig configWithAppToken:appToken environment:environment]; + } if (config != nil) { + if (initLogLevel != nil) { + aTest([@"ADJLogger setLogLevel: " stringByAppendingString:initLogLevel]); + } if ([environment isEqualToString:ADJEnvironmentSandbox]) { aAssert(@"SANDBOX: Adjust is running in Sandbox mode. Use this setting for testing. Don't forget to set the environment to `production` before publishing"); } else if ([environment isEqualToString:ADJEnvironmentProduction]) { @@ -2343,50 +3038,23 @@ - (ADJConfig *)getConfig:(NSString *)environment } else { aFail(); } - - if (logLevel != 0) { - [config setLogLevel:logLevel]; - } } return config; } -- (id) startAndCheckFirstSession:(ADJConfig *)config -{ - return [self startAndCheckFirstSession:config logLevel:ADJLogLevelInfo]; -} -- (id) startAndCheckFirstSession:(ADJConfig *)config - logLevel:(ADJLogLevel)logLevel +- (id)startAndCheckFirstSession:(ADJConfig *)config { // start activity handler with config - id activityHandler = [self getFirstActivityHandler:config logLevel:logLevel]; - - [NSThread sleepForTimeInterval:2.0]; - - // test init values - [self checkInitTests]; - - [self startActivity:activityHandler]; + id activityHandler = [self getFirstActivityHandler:config]; [NSThread sleepForTimeInterval:2.0]; - // test session - [self checkFirstSession]; + [self checkInitAndStartTestsWithHandler:activityHandler]; return activityHandler; } -- (void)startActivity:(id)activityHandler { - // start activity - [activityHandler applicationDidBecomeActive]; - - ADJInternalState * internalState = [activityHandler internalState]; - - // comes to the foreground - aTrue([internalState isForeground]); -} - - (void)stopActivity:(id)activityHandler { // stop activity [activityHandler applicationWillResignActive]; @@ -2397,49 +3065,30 @@ - (void)stopActivity:(id)activityHandler { aTrue([internalState isBackground]); } -- (id) getFirstActivityHandler:(ADJConfig *)config +- (id)getFirstActivityHandler:(ADJConfig *)config { - return [self getFirstActivityHandler:config logLevel:ADJLogLevelInfo]; + ADJActivityHandlerConstructorState * cState = [[ADJActivityHandlerConstructorState alloc] initWithConfig:config]; + return [self getActivityHandler:cState]; } -- (id) getFirstActivityHandler:(ADJConfig *)config - logLevel:(ADJLogLevel)logLevel +- (id)getActivityHandler:(ADJActivityHandlerConstructorState *)cState { - return [self getActivityHandler:config - logLevel:logLevel - isProductionEnvironment:NO - readActivityState:nil - readAttribution:nil - startEnabled:YES]; -} - -- (id) getActivityHandler:(ADJConfig *)config - logLevel:(ADJLogLevel)logLevel - isProductionEnvironment:(BOOL)isProductionEnvironment - readActivityState:(NSString *)readActivityState - readAttribution:(NSString *)readAttribution - startEnabled:(BOOL)startEnabled -{ - id activityHandler = [ADJActivityHandler handlerWithConfig:config]; + id activityHandler = [ADJActivityHandler handlerWithConfig:cState.config + sessionParametersActionsArray:cState.sessionParametersActionsArray]; if (activityHandler != nil) { - // check log level - NSString * logMessage; - if (isProductionEnvironment) { - logMessage = [NSString stringWithFormat:@"ADJLogger setLogLevel: %d", ADJLogLevelAssert]; - } else { - logMessage = [NSString stringWithFormat:@"ADJLogger setLogLevel: %d", logLevel]; - } - aTest(logMessage); + aTest(@"ADJLogger lockLogLevel"); // check if files are read in constructor - [self checkReadFiles:readActivityState readAttribution:readAttribution]; + [self checkReadFiles:cState.readActivityState readAttribution:cState.readAttribution]; ADJInternalState * internalState = [activityHandler internalState]; // test default values - aiEquals(startEnabled, [internalState isEnabled]); + aiEquals(cState.startEnabled, [internalState isEnabled]); aTrue([internalState isOnline]); aTrue([internalState isBackground]); + aTrue([internalState isToStartNow]); + aiEquals(cState.isToUpdatePackages, [internalState isToUpdatePackages]); } return activityHandler; @@ -2477,8 +3126,8 @@ - (void)checkSubSession:(NSInteger)sessionCount subSessionState.subsessionCount = subsessionCount; subSessionState.getAttributionIsCalled = [NSNumber numberWithBool:getAttributionIsCalled]; subSessionState.foregroundTimerAlreadyStarted = YES; + subSessionState.toSend = YES; [self checkStartInternal:subSessionState]; - } - (void)checkFurtherSessions:(NSInteger)sessionCount @@ -2490,18 +3139,25 @@ - (void)checkFurtherSessions:(NSInteger)sessionCount furtherSessionState.timerAlreadyStarted = YES; furtherSessionState.getAttributionIsCalled = [NSNumber numberWithBool:getAttributionIsCalled]; furtherSessionState.foregroundTimerAlreadyStarted = YES; + furtherSessionState.toSend = YES; [self checkStartInternal:furtherSessionState]; } +- (void)checkAppBecomeActive:(ADJSessionState *)sessionState { + [self checkDelayStart:sessionState]; -- (void)checkStartInternal:(ADJSessionState *)sessionState { // check applicationDidBecomeActive [self checkApplicationDidBecomeActive:sessionState]; + [self checkStartInternal:sessionState]; +} + +- (void)checkStartInternal:(ADJSessionState *)sessionState { // update Handlers Status [self checkHandlerStatus:!sessionState.toSend - eventBufferingIsEnabled:sessionState.eventBufferingIsEnabled]; + eventBufferingIsEnabled:sessionState.eventBufferingIsEnabled + sdkClickHandlerAlsoPauses:sessionState.sdkClickHandlerAlsoPauses]; // process Session switch (sessionState.sessionType) { @@ -2553,7 +3209,11 @@ - (void)checkStartInternal:(ADJSessionState *)sessionState { - (void)checkApplicationDidBecomeActive:(ADJSessionState *)sessionState { // stops background timer - aVerbose(@"Background timer canceled"); + if (sessionState.sendInBackgroundConfigured) { + aVerbose(@"Background timer canceled"); + } else { + anVerbose(@"Background timer canceled"); + } // start foreground timer if (sessionState.foregroundTimerStarts) { @@ -2568,21 +3228,38 @@ - (void)checkApplicationDidBecomeActive:(ADJSessionState *)sessionState { } // starts the subsession - aVerbose(@"Subsession start"); + if (sessionState.startSubSession) { + aVerbose(@"Subsession start"); + } else { + anVerbose(@"Subsession start"); + } +} + +- (void)checkHandlerStatus:(BOOL)pausing +{ + [self checkHandlerStatus:pausing eventBufferingIsEnabled:NO sdkClickHandlerAlsoPauses:YES]; } - (void)checkHandlerStatus:(BOOL)pausing + sdkClickHandlerAlsoPauses:(BOOL)sdkClickHandlerAlsoPauses + { - [self checkHandlerStatus:pausing eventBufferingIsEnabled:NO]; + [self checkHandlerStatus:pausing eventBufferingIsEnabled:NO sdkClickHandlerAlsoPauses:sdkClickHandlerAlsoPauses]; } + - (void)checkHandlerStatus:(BOOL)pausing eventBufferingIsEnabled:(BOOL)eventBufferingIsEnabled + sdkClickHandlerAlsoPauses:(BOOL)sdkClickHandlerAlsoPauses { if (pausing) { aTest(@"AttributionHandler pauseSending"); aTest(@"PackageHandler pauseSending"); - aTest(@"SdkClickHandler pauseSending"); + if (sdkClickHandlerAlsoPauses) { + aTest(@"SdkClickHandler pauseSending"); + } else { + aTest(@"SdkClickHandler resumeSending"); + } } else { aTest(@"AttributionHandler resumeSending"); aTest(@"PackageHandler resumeSending"); @@ -2776,17 +3453,65 @@ - (void)checkFinishTasks:(NSObject *)delegateTest anDebug(@"Launching failed event tracking delegate"); } -- (NSDictionary *)getDeeplinkDictionary { - // set package handler to respond with a valid attribution - NSString * deeplinkString = @"{\"deeplink\":\"wrongDeeplink://\"}"; - NSData * deeplinkData = [deeplinkString dataUsingEncoding:NSUTF8StringEncoding]; - NSError *error = nil; - NSException *exception = nil; +- (void)checkDelayStart:(ADJSessionState *)sessionState { + if (sessionState.delayStart == nil) { + anWarn(@"Waiting"); + return; + } + + if ([sessionState.delayStart isEqualToString:@"10.1"]) { + aWarn(@"Delay start of 10.1 seconds bigger than max allowed value of 10.0 seconds"); + sessionState.delayStart = @"10.0"; + } + + NSString * waitingLog = [NSString stringWithFormat:@"Waiting %@ seconds before starting first session", sessionState.delayStart]; + aInfo(waitingLog); + + NSString * delayStartLog = [NSString stringWithFormat:@"Delay Start timer starting. Launching in %@ seconds", sessionState.delayStart]; - NSDictionary * deeplinkDictionary = [ADJUtil buildJsonDict:deeplinkData exceptionPtr:&exception errorPtr:&error]; + aVerbose(delayStartLog); - anNil(deeplinkDictionary); + if (sessionState.activityStateCreated) { + aDebug(@"Wrote Activity state"); + } +} + +- (void)checkSendFirstPackages:(BOOL)delayStart + internalState:(ADJInternalState *)internalState + activityStateCreated:(BOOL)activityStateCreated + pausing:(BOOL)pausing +{ + if (!delayStart) { + aInfo(@"Start delay expired or never configured"); + anTest(@"PackageHandler updatePackages"); + return; + } + anInfo(@"Start delay expired or never configured"); + + // update packages + aTest(@"PackageHandler updatePackages"); + aFalse(internalState.updatePackages); + if (activityStateCreated) { + aDebug(@"Wrote Activity state"); + } + // no longer is in delay start + aFalse(internalState.delayStart); - return deeplinkDictionary; + // cancel timer + aVerbose(@"Delay Start timer canceled"); + + [self checkHandlerStatus:pausing sdkClickHandlerAlsoPauses:NO]; +} + +- (void)checkUpdatePackages:(ADJInternalState *)internalState + activityStateCreated:(BOOL)activityStateCreated +{ + aTest(@"PackageHandler updatePackages"); + aFalse(internalState.updatePackages); + if (activityStateCreated) { + aDebug(@"Wrote Activity state"); + } else { + anDebug(@"Wrote Activity state"); + } } @end diff --git a/AdjustTests/ADJAttributionHandlerMock.m b/AdjustTests/ADJAttributionHandlerMock.m index 32f4d95d4..fb7fddb3a 100644 --- a/AdjustTests/ADJAttributionHandlerMock.m +++ b/AdjustTests/ADJAttributionHandlerMock.m @@ -61,4 +61,8 @@ - (void)resumeSending { [self.loggerMock test:[prefix stringByAppendingFormat:@"resumeSending"]]; } +- (void)teardown { + [self.loggerMock test:[prefix stringByAppendingFormat:@"teardown"]]; +} + @end diff --git a/AdjustTests/ADJAttributionHandlerTests.m b/AdjustTests/ADJAttributionHandlerTests.m index d79337882..1ad69aaa5 100644 --- a/AdjustTests/ADJAttributionHandlerTests.m +++ b/AdjustTests/ADJAttributionHandlerTests.m @@ -54,7 +54,8 @@ - (void)reset { ADJConfig * config = [ADJConfig configWithAppToken:@"qwerty123456" environment:ADJEnvironmentSandbox]; - self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config]; + self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config + sessionParametersActionsArray:nil]; [self savePackages:config]; [NSURLConnection reset]; } @@ -74,7 +75,7 @@ - (void)savePackages:(ADJConfig *)config { [ADJTestsUtil deleteFile:@"AdjustIoActivityState" logger:self.loggerMock]; [ADJTestsUtil deleteFile:@"AdjustIoAttribution" logger:self.loggerMock]; - id activityHandler = [ADJActivityHandler handlerWithConfig:config]; + id activityHandler = [ADJActivityHandler handlerWithConfig:config sessionParametersActionsArray:nil]; [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:5.0]; @@ -130,7 +131,7 @@ - (void)testGetAttribution aTest(@"ActivityHandler setAskingAttribution, 0"); // check attribution was called without ask_in - aTest(@"ActivityHandler launchAttributionResponseTasks, message:(null) timestamp:(null) adid:(null) success:1 willRetry:0 attribution:(null) json:{\n}"); + aTest(@"ActivityHandler launchAttributionResponseTasks, message:(null) timestamp:(null) adid:(null) success:1 willRetry:0 attribution:(null) deeplink:(null) json:{\n}"); // test server error [self checkGetAttributionResponse:attributionHandler responseType:ADJSessionResponseTypeServerError]; @@ -144,7 +145,7 @@ - (void)testGetAttribution aTest(@"ActivityHandler setAskingAttribution, 0"); // check attribution was called without ask_in - aTest(@"ActivityHandler launchAttributionResponseTasks, message:testResponseError timestamp:(null) adid:(null) success:0 willRetry:0 attribution:(null) json:{\n message = testResponseError;\n}"); + aTest(@"ActivityHandler launchAttributionResponseTasks, message:testResponseError timestamp:(null) adid:(null) success:0 willRetry:0 attribution:(null) deeplink:(null) json:{\n message = testResponseError;\n}"); // test ok response with message [self checkGetAttributionResponse:attributionHandler responseType:ADJSessionResponseTypeMessage]; @@ -298,6 +299,41 @@ - (void)testWithoutListener anTest(@"NSURLSession dataTaskWithRequest"); } +- (void)testDeeplink { + // reseting to make the test order independent + [self reset]; + + id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES hasAttributionChangedDelegate:YES]; + + NSMutableDictionary * attributionDictionary = [[NSMutableDictionary alloc] init]; + [attributionDictionary setObject:@"testDeeplinkAttribution://" forKey:@"deeplink"]; + + NSMutableDictionary * jsonDictionary = [[NSMutableDictionary alloc] init]; + [jsonDictionary setObject:attributionDictionary forKey:@"attribution"]; + [jsonDictionary setObject:@"testDeeplinkRoot://" forKey:@"deeplink"]; + + ADJSessionResponseData * sessionResponseData = [ADJResponseData buildResponseData:self.firstSessionPackage]; + sessionResponseData.jsonResponse = jsonDictionary; + + [attributionHandler checkSessionResponse:sessionResponseData]; + [NSThread sleepForTimeInterval:2.0]; + + aTest(@"ActivityHandler setAskingAttribution, 0"); + + aTest(@"ActivityHandler launchSessionResponseTasks, message:(null) timestamp:(null) adid:(null) success:0 willRetry:0 attribution:tt:(null) tn:(null) net:(null) cam:(null) adg:(null) cre:(null) cl:(null) json:{\n attribution = {\n deeplink = \"testDeeplinkAttribution://\";\n };\n deeplink = \"testDeeplinkRoot://\";\n}"); + + ADJAttributionResponseData * attributionResponseData = [ADJResponseData buildResponseData:self.attributionPackage]; + attributionResponseData.jsonResponse = jsonDictionary; + [attributionHandler checkAttributionResponse:attributionResponseData]; + [NSThread sleepForTimeInterval:2.0]; + + aTest(@"ActivityHandler setAskingAttribution, 0"); + + aTest(@"ActivityHandler launchAttributionResponseTasks, message:(null) timestamp:(null) adid:(null) success:0 willRetry:0 attribution:tt:(null) tn:(null) net:(null) cam:(null) adg:(null) cre:(null) cl:(null) deeplink:testDeeplinkAttribution:// json:{\n attribution = {\n deeplink = \"testDeeplinkAttribution://\";\n };\n deeplink = \"testDeeplinkRoot://\";\n}"); + + aEquals([attributionResponseData.deeplink absoluteString], @"testDeeplinkAttribution://"); +} + - (void)checkOkMessageGetAttributionResponse { // the response logged @@ -309,7 +345,7 @@ - (void)checkOkMessageGetAttributionResponse // check attribution was called without ask_in aTest(@"ActivityHandler setAskingAttribution, 0"); - aTest(@"ActivityHandler launchAttributionResponseTasks, message:response OK timestamp:(null) adid:(null) success:1 willRetry:0 attribution:(null) json:{\n message = \"response OK\";\n}"); + aTest(@"ActivityHandler launchAttributionResponseTasks, message:response OK timestamp:(null) adid:(null) success:1 willRetry:0 attribution:(null) deeplink:(null) json:{\n message = \"response OK\";\n}"); } - (void)checkGetAttributionResponse:(id) attributionHandler diff --git a/AdjustTests/ADJEndSessionState.h b/AdjustTests/ADJEndSessionState.h new file mode 100644 index 000000000..f391f730c --- /dev/null +++ b/AdjustTests/ADJEndSessionState.h @@ -0,0 +1,19 @@ +// +// ADJEndSessionState.h +// Adjust +// +// Created by Pedro Filipe on 30/06/2016. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEndSessionState : NSObject + +@property (nonatomic, assign) BOOL pausing; +@property (nonatomic, assign) BOOL updateActivityState; +@property (nonatomic, assign) BOOL eventBufferingEnabled; +@property (nonatomic, assign) BOOL checkOnPause; +@property (nonatomic, assign) BOOL forgroundAlreadySuspended; +@property (nonatomic, assign) BOOL backgroundTimerStarts; +@end diff --git a/AdjustTests/ADJEndSessionState.m b/AdjustTests/ADJEndSessionState.m new file mode 100644 index 000000000..df5780111 --- /dev/null +++ b/AdjustTests/ADJEndSessionState.m @@ -0,0 +1,27 @@ +// +// ADJEndSessionState.m +// Adjust +// +// Created by Pedro Filipe on 30/06/2016. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import "ADJEndSessionState.h" + +@implementation ADJEndSessionState + +- (id)init { + self = [super init]; + if (self == nil) return nil; + + // default values + self.pausing = YES; + self.updateActivityState = YES; + self.eventBufferingEnabled = NO; + self.checkOnPause = NO; + self.forgroundAlreadySuspended = NO; + self.backgroundTimerStarts = NO; + + return self; +} +@end diff --git a/AdjustTests/ADJInitState.h b/AdjustTests/ADJInitState.h new file mode 100644 index 000000000..5696c82f5 --- /dev/null +++ b/AdjustTests/ADJInitState.h @@ -0,0 +1,30 @@ +// +// ADJInitState.h +// Adjust +// +// Created by Pedro Filipe on 01/07/2016. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import +#import "ADJActivityHandler.h" + +@interface ADJInitState : NSObject + +@property (nonatomic, strong) ADJInternalState * internalState; +@property (nonatomic, assign) BOOL startsSending; +@property (nonatomic, assign) BOOL sdkClickHandlerAlsoStartsPaused; +@property (nonatomic, copy) NSString * defaultTracker; +@property (nonatomic, assign) BOOL eventBufferingIsEnabled; +@property (nonatomic, assign) BOOL sendInBackgroundConfigured; +@property (nonatomic, assign) BOOL delayStartConfigured; +@property (nonatomic, assign) BOOL updatePackages; +@property (nonatomic, assign) BOOL activityStateAlreadyCreated; +@property (nonatomic, copy) NSString * readCallbackParameters; +@property (nonatomic, copy) NSString * readPartnerParameters; +@property (nonatomic, assign) int foregroundTimerStart; +@property (nonatomic, assign) int foregroundTimerCycle; + +- (id)initWithActivityHandler:(ADJActivityHandler *)activityHandler; + +@end diff --git a/AdjustTests/ADJInitState.m b/AdjustTests/ADJInitState.m new file mode 100644 index 000000000..34294f8c1 --- /dev/null +++ b/AdjustTests/ADJInitState.m @@ -0,0 +1,36 @@ +// +// ADJInitState.m +// Adjust +// +// Created by Pedro Filipe on 01/07/2016. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import "ADJInitState.h" + +@implementation ADJInitState + +- (id)initWithActivityHandler:(ADJActivityHandler *)activityHandler { + self = [super init]; + if (self == nil) return nil; + + self.internalState = [activityHandler internalState]; + + // default values + self.startsSending = NO; + self.sdkClickHandlerAlsoStartsPaused = YES; + self.defaultTracker = nil; + self.eventBufferingIsEnabled = NO; + self.sendInBackgroundConfigured = NO; + self.delayStartConfigured = NO; + self.updatePackages = NO; + self.activityStateAlreadyCreated = NO; + self.readCallbackParameters = nil; + self.readPartnerParameters = nil; + self.foregroundTimerStart = 60; + self.foregroundTimerCycle = 60; + + return self; +} + +@end diff --git a/AdjustTests/ADJLoggerMock.m b/AdjustTests/ADJLoggerMock.m index 13de15588..8d399192c 100644 --- a/AdjustTests/ADJLoggerMock.m +++ b/AdjustTests/ADJLoggerMock.m @@ -72,6 +72,10 @@ - (void)setLogLevel:(ADJLogLevel)logLevel { [self test:@"ADJLogger setLogLevel: %d", logLevel]; } +- (void)lockLogLevel { + [self test:@"ADJLogger lockLogLevel"]; +} + - (void)check:(NSString *)format, ... { va_list parameters; va_start(parameters, format); [self logLevel:ADJLogLevelCheck logPrefix:@"c" format:format parameters:parameters]; diff --git a/AdjustTests/ADJPackageFields.h b/AdjustTests/ADJPackageFields.h index 11e35ddf1..93752fe1e 100644 --- a/AdjustTests/ADJPackageFields.h +++ b/AdjustTests/ADJPackageFields.h @@ -37,6 +37,8 @@ @property (nonatomic, copy) NSString* currency; @property (nonatomic, copy) NSString* receipt; @property (nonatomic, copy) NSString* emptyReceipt; +@property (nonatomic, copy) NSDictionary* savedCallbackParameters; +@property (nonatomic, copy) NSDictionary* savedPartnerParameters; // ADJActivityState @property (nonatomic, copy) NSString* sessionCount; @property (nonatomic, copy) NSString* subSessionCount; diff --git a/AdjustTests/ADJPackageFields.m b/AdjustTests/ADJPackageFields.m index a1ae6e2af..37e47b51a 100644 --- a/AdjustTests/ADJPackageFields.m +++ b/AdjustTests/ADJPackageFields.m @@ -16,7 +16,7 @@ - (id) init { // default values self.appToken = @"qwerty123456"; - self.clientSdk = @"ios4.8.5"; + self.clientSdk = @"ios4.9.0"; self.suffix = @""; self.environment = @"sandbox"; diff --git a/AdjustTests/ADJPackageHandlerMock.m b/AdjustTests/ADJPackageHandlerMock.m index fd01f7b18..16ef0f5b9 100644 --- a/AdjustTests/ADJPackageHandlerMock.m +++ b/AdjustTests/ADJPackageHandlerMock.m @@ -73,9 +73,13 @@ - (void)resumeSending { [self.loggerMock test:[prefix stringByAppendingString:@"resumeSending"]]; } -- (void)finishedTracking:(NSDictionary *)jsonDict { - [self.loggerMock test:[prefix stringByAppendingFormat:@"finishedTracking, %@", jsonDict.descriptionInStringsFileFormat]]; - self.jsonDict = jsonDict; +- (void)updatePackages:(ADJSessionParameters *)sessionParameters { + [self.loggerMock test:[prefix stringByAppendingFormat:@"updatePackages, sessionParameters: %@", sessionParameters]]; + +} + +- (void)teardown:(BOOL)deleteState { + [self.loggerMock test:[prefix stringByAppendingFormat:@"teardown, deleteState: %d", deleteState]]; } @end diff --git a/AdjustTests/ADJPackageHandlerTests.m b/AdjustTests/ADJPackageHandlerTests.m index abd64527b..7ae1811ac 100644 --- a/AdjustTests/ADJPackageHandlerTests.m +++ b/AdjustTests/ADJPackageHandlerTests.m @@ -16,6 +16,10 @@ #import "ADJResponseData.h" #import "ADJBackoffStrategy.h" #import "ADJPackageHandler.h" +#import "ADJAttributionHandlerMock.h" +#import "ADJPackageHandlerMock.h" +#import "ADJSdkClickHandlerMock.h" +#import "ADJSessionParameters.h" typedef enum { ADJSendFirstEmptyQueue = 0, @@ -56,7 +60,7 @@ - (void)reset { [ADJAdjustFactory setRequestHandler:self.requestHandlerMock]; ADJConfig * config = [ADJConfig configWithAppToken:@"123456789012" environment:ADJEnvironmentSandbox]; - self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config]; + self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config sessionParametersActionsArray:nil]; // delete previously created Package queue file to make a new queue XCTAssert([ADJTestsUtil deleteFile:@"AdjustIoPackageQueue" logger:self.loggerMock], @"%@", self.loggerMock); @@ -228,7 +232,7 @@ - (void) testBackoffJitter ADJResponseData * responseData = [ADJResponseData buildResponseData:activityPackage]; //Pattern pattern = Pattern.compile("Sleeping for (\\d+\\.\\d) seconds before retrying the (\\d+) time"); - NSString * sleepingLogPattern = @"Sleeping for (\\d+\\.\\d) seconds before retrying the (\\d+) time"; + NSString * sleepingLogPattern = @"Waiting for (\\d+\\.\\d) seconds before retrying the (\\d+) time"; NSError *error = NULL; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:sleepingLogPattern @@ -244,7 +248,7 @@ - (void) testBackoffJitter [packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; [NSThread sleepForTimeInterval:1.5]; - NSString * sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Sleeping for"]; + NSString * sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Waiting for"]; anNil(sleepingLogMessage); // Sleeping for 0.1 seconds before retrying the 1 time @@ -260,7 +264,7 @@ - (void) testBackoffJitter [packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; [NSThread sleepForTimeInterval:1.5]; - sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Sleeping for"]; + sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Waiting for"]; anNil(sleepingLogMessage); [self checkSleeping:regex @@ -275,7 +279,7 @@ - (void) testBackoffJitter [packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; [NSThread sleepForTimeInterval:1.5]; - sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Sleeping for"]; + sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Waiting for"]; anNil(sleepingLogMessage); [self checkSleeping:regex @@ -290,7 +294,7 @@ - (void) testBackoffJitter [packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; [NSThread sleepForTimeInterval:1.5]; - sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Sleeping for"]; + sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Waiting for"]; anNil(sleepingLogMessage); [self checkSleeping:regex @@ -305,7 +309,7 @@ - (void) testBackoffJitter [packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; [NSThread sleepForTimeInterval:1.5]; - sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Sleeping for"]; + sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Waiting for"]; anNil(sleepingLogMessage); [self checkSleeping:regex @@ -320,7 +324,7 @@ - (void) testBackoffJitter [packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; [NSThread sleepForTimeInterval:1.5]; - sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Sleeping for"]; + sleepingLogMessage = [self.loggerMock containsMessage:ADJLogLevelVerbose beginsWith:@"Waiting for"]; anNil(sleepingLogMessage); [self checkSleeping:regex @@ -332,6 +336,166 @@ - (void) testBackoffJitter numberRetries:6]; } +- (void)testUpdate +{ + // reseting to make the test order independent + [self reset]; + + NSArray * delayPackages = [self createDelayPackages]; + + ADJActivityPackage * firstSessionPackage = delayPackages[0]; + ADJActivityPackage * firstEventPackage = delayPackages[1]; + ADJActivityPackage * secondEventPackage = delayPackages[2]; + + // create event package test + ADJPackageFields * sessionPackageFields = [ADJPackageFields fields]; + + [self testPackageSession:firstSessionPackage fields:sessionPackageFields sessionCount:@"1"]; + + // create event package test + ADJPackageFields * firstEventPackageFields = [ADJPackageFields fields]; + + // set event test parameters + firstEventPackageFields.eventCount = @"1"; + firstEventPackageFields.savedCallbackParameters = @{@"ceFoo":@"ceBar"}; + firstEventPackageFields.savedPartnerParameters = @{@"peFoo":@"peBar"}; + firstEventPackageFields.suffix = @"'event1'"; + + // test first event + [self testEventPackage:firstEventPackage fields:firstEventPackageFields eventToken:@"event1"]; + + // create event package test + ADJPackageFields * secondEventPackageFields = [ADJPackageFields fields]; + + // set event test parameters + secondEventPackageFields.eventCount = @"2"; + secondEventPackageFields.savedCallbackParameters = @{@"scpKey":@"ceBar"}; + secondEventPackageFields.savedPartnerParameters = @{@"sppKey":@"peBar"}; + secondEventPackageFields.suffix = @"'event2'"; + + // test second event + [self testEventPackage:secondEventPackage fields:secondEventPackageFields eventToken:@"event2"]; + + // initialize Package Handler + id packageHandler = [self createFirstPackageHandler:NO]; + + [self checkSendFirst:ADJSendFirstEmptyQueue]; + + [packageHandler addPackage:firstSessionPackage]; + + [packageHandler addPackage:firstEventPackage]; + + [packageHandler addPackage:secondEventPackage]; + + [NSThread sleepForTimeInterval:1]; + + [self checkAddPackage:1 packageString:@"session"]; + + [self checkAddPackage:2 packageString:@"event'event1'"]; + + [self checkAddPackage:3 packageString:@"event'event2'"]; + + [packageHandler updatePackages:nil]; + + [NSThread sleepForTimeInterval:1]; + + aDebug(@"Updating package handler queue"); + + aVerbose(@"Session callback parameters: (null)"); + aVerbose(@"Session partner parameters: (null)"); + + ADJSessionParameters * sessionParameters = [[ADJSessionParameters alloc] init]; + + sessionParameters.callbackParameters = [NSMutableDictionary dictionary]; + [sessionParameters.callbackParameters setObject:@"scpValue" forKey:@"scpKey"]; + + sessionParameters.partnerParameters = [NSMutableDictionary dictionary]; + [sessionParameters.partnerParameters setObject:@"sppValue" forKey:@"sppKey"]; + + + [packageHandler updatePackages:sessionParameters]; + + [NSThread sleepForTimeInterval:2]; + + aDebug(@"Updating package handler queue"); + + aVerbose(@"Session callback parameters: {\n scpKey = scpValue;\n}"); + aVerbose(@"Session partner parameters: {\n sppKey = sppValue;\n}"); + + aWarn(@"Key scpKey with value scpValue from Callback parameter was replaced by value ceBar"); + aWarn(@"Key sppKey with value sppValue from Partner parameter was replaced by value peBar"); + aDebug(@"Package handler wrote 3 packages"); + + sessionPackageFields.callbackParameters = @"{\"scpKey\":\"scpValue\"}"; + sessionPackageFields.partnerParameters = @"{\"sppKey\":\"sppValue\"}"; + + [self testPackageSession:firstSessionPackage fields:sessionPackageFields sessionCount:@"1"]; + + firstEventPackageFields.callbackParameters = @"{\"scpKey\":\"scpValue\",\"ceFoo\":\"ceBar\"}"; + firstEventPackageFields.partnerParameters = @"{\"peFoo\":\"peBar\",\"sppKey\":\"sppValue\"}"; + + [self testEventPackage:firstEventPackage fields:firstEventPackageFields eventToken:@"event1"]; + + secondEventPackageFields.callbackParameters = @"{\"scpKey\":\"ceBar\"}"; + secondEventPackageFields.partnerParameters = @"{\"sppKey\":\"peBar\"}"; + + [self testEventPackage:secondEventPackage fields:secondEventPackageFields eventToken:@"event2"]; +} + +- (NSArray *)createDelayPackages { + ADJPackageHandlerMock * packageHandlerMock = [ADJPackageHandlerMock alloc]; + [ADJAdjustFactory setPackageHandler:packageHandlerMock]; + + ADJSdkClickHandlerMock * sdkClickHandlerMock = [ADJSdkClickHandlerMock alloc]; + [ADJAdjustFactory setSdkClickHandler:sdkClickHandlerMock]; + + ADJAttributionHandlerMock * attributionHandlerMock = [ADJAttributionHandlerMock alloc]; + [ADJAdjustFactory setAttributionHandler:attributionHandlerMock]; + + [ADJAdjustFactory setSessionInterval:-1]; + [ADJAdjustFactory setSubsessionInterval:-1]; + [ADJAdjustFactory setTimerInterval:-1]; + [ADJAdjustFactory setTimerStart:-1]; + + [ADJTestsUtil deleteFile:@"AdjustIoActivityState" logger:self.loggerMock]; + [ADJTestsUtil deleteFile:@"AdjustIoAttribution" logger:self.loggerMock]; + [ADJTestsUtil deleteFile:@"AdjustSessionParameters" logger:self.loggerMock]; + [ADJTestsUtil deleteFile:@"AdjustSessionCallbackParameters" logger:self.loggerMock]; + [ADJTestsUtil deleteFile:@"AdjustSessionPartnerParameters" logger:self.loggerMock]; + + ADJConfig * config = [ADJConfig configWithAppToken:@"qwerty123456" environment:ADJEnvironmentSandbox]; + + [config setDelayStart:4]; + + id activityHandler = [ADJActivityHandler handlerWithConfig:config sessionParametersActionsArray:nil]; + + [activityHandler addSessionCallbackParameter:@"scpKey" value:@"scpValue"]; + [activityHandler addSessionPartnerParameter:@"sppKey" value:@"sppValue"]; + + [activityHandler applicationDidBecomeActive]; + + ADJEvent * event1 = [ADJEvent eventWithEventToken:@"event1"]; + [event1 addCallbackParameter:@"ceFoo" value:@"ceBar"]; + [event1 addPartnerParameter:@"peFoo" value:@"peBar"]; + [activityHandler trackEvent:event1]; + + ADJEvent * event2 = [ADJEvent eventWithEventToken:@"event2"]; + [event2 addCallbackParameter:@"scpKey" value:@"ceBar"]; + [event2 addPartnerParameter:@"sppKey" value:@"peBar"]; + [activityHandler trackEvent:event2]; + + [NSThread sleepForTimeInterval:3.0]; + + ADJActivityPackage * firstSessionPackage = packageHandlerMock.packageQueue[0]; + + ADJActivityPackage * firstEventPackage = packageHandlerMock.packageQueue[1]; + ADJActivityPackage * secondEventPackage = packageHandlerMock.packageQueue[2]; + + [self.loggerMock reset]; + + return @[firstSessionPackage, firstEventPackage, secondEventPackage]; +} + - (void)checkSleeping:(NSRegularExpression *)regex sleepingLog:(NSString *)sleepingLog minRange:(double)minRange diff --git a/AdjustTests/ADJRequestHandlerMock.m b/AdjustTests/ADJRequestHandlerMock.m index ae4eeeeb2..e5a9c4e8e 100644 --- a/AdjustTests/ADJRequestHandlerMock.m +++ b/AdjustTests/ADJRequestHandlerMock.m @@ -60,4 +60,8 @@ - (void)sendPackage:(ADJActivityPackage *)activityPackage */ } +- (void)teardown { + [self.loggerMock test:[prefix stringByAppendingString:@"teardown"]]; +} + @end diff --git a/AdjustTests/ADJSdkClickHandlerMock.m b/AdjustTests/ADJSdkClickHandlerMock.m index 6715cf96b..65422e758 100644 --- a/AdjustTests/ADJSdkClickHandlerMock.m +++ b/AdjustTests/ADJSdkClickHandlerMock.m @@ -47,4 +47,8 @@ - (void)sendSdkClick:(ADJActivityPackage *)sdkClickPackage { [self.packageQueue addObject:sdkClickPackage]; } +- (void)teardown { + [self.loggerMock test:[prefix stringByAppendingString:@"teardown"]]; +} + @end diff --git a/AdjustTests/ADJSdkClickHandlerTests.m b/AdjustTests/ADJSdkClickHandlerTests.m index 9a7a594dd..f42f88a8d 100644 --- a/AdjustTests/ADJSdkClickHandlerTests.m +++ b/AdjustTests/ADJSdkClickHandlerTests.m @@ -53,7 +53,7 @@ - (void)reset { ADJConfig * config = [ADJConfig configWithAppToken:@"qwerty123456" environment:ADJEnvironmentSandbox]; - self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config]; + self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config sessionParametersActionsArray:nil]; self.sdkClickPackage = [self getClickPackage]; [NSURLSession reset]; @@ -134,7 +134,7 @@ - (void)testNullResponse { aDebug(@"Added sdk_click 1"); // waiting to try again - aVerbose(@"Sleeping for"); + aVerbose(@"Waiting for"); } - (void)testClientException { @@ -162,7 +162,7 @@ - (void)testClientException { aDebug(@"Added sdk_click 1"); // waiting to try again - aVerbose(@"Sleeping for"); + aVerbose(@"Waiting for"); } - (void)testServerError { @@ -292,7 +292,7 @@ - (ADJActivityPackage *) getClickPackage { ADJConfig * config = [ADJConfig configWithAppToken:@"qwerty123456" environment:@"sandbox"]; // start activity handler with config - id activityHandler = [ADJActivityHandler handlerWithConfig:config]; + id activityHandler = [ADJActivityHandler handlerWithConfig:config sessionParametersActionsArray:nil]; [activityHandler applicationDidBecomeActive]; [activityHandler appWillOpenUrl:[NSURL URLWithString:@"AdjustTests://"]]; [NSThread sleepForTimeInterval:2.0]; diff --git a/AdjustTests/ADJSessionState.h b/AdjustTests/ADJSessionState.h index 0d14bd1e7..7698fa1cf 100644 --- a/AdjustTests/ADJSessionState.h +++ b/AdjustTests/ADJSessionState.h @@ -18,7 +18,7 @@ typedef enum { @interface ADJSessionState : NSObject @property (nonatomic, assign) BOOL toSend; -@property (nonatomic, assign) BOOL paused; +//@property (nonatomic, assign) BOOL paused; @property (nonatomic, assign) NSInteger sessionCount; @property (nonatomic, assign) NSInteger subsessionCount; @property (nonatomic, assign) ADJSessionType sessionType; @@ -28,6 +28,13 @@ typedef enum { @property (nonatomic, assign) BOOL eventBufferingIsEnabled; @property (nonatomic, assign) BOOL foregroundTimerStarts; @property (nonatomic, assign) BOOL foregroundTimerAlreadyStarted; +@property (nonatomic, assign) BOOL sendInBackgroundConfigured; +@property (nonatomic, assign) BOOL sdkClickHandlerAlsoPauses; +@property (nonatomic, copy) NSString * delayStart; +@property (nonatomic, assign) BOOL activityStateCreated; +@property (nonatomic, assign) BOOL startSubSession; + + /* boolean toSend = true; boolean paused = false; diff --git a/AdjustTests/ADJSessionState.m b/AdjustTests/ADJSessionState.m index 15cab592b..7c4dd20b2 100644 --- a/AdjustTests/ADJSessionState.m +++ b/AdjustTests/ADJSessionState.m @@ -10,13 +10,13 @@ @implementation ADJSessionState + - (id)initWithSessionType:(ADJSessionType)sessionType { self = [super init]; if (self == nil) return nil; // default values - self.toSend = YES; - self.paused = NO; + self.toSend = NO; self.sessionCount = 1; self.subsessionCount = 1; self.eventCount = 0; @@ -25,12 +25,18 @@ - (id)initWithSessionType:(ADJSessionType)sessionType { self.eventBufferingIsEnabled = NO; self.foregroundTimerStarts = YES; self.foregroundTimerAlreadyStarted = NO; - + self.sdkClickHandlerAlsoPauses = YES; + self.delayStart = nil; + self.activityStateCreated = NO; + self.startSubSession = YES; +/* if (sessionType == ADJSessionTypeSubSession || sessionType == ADJSessionTypeNonSession) { self.timerAlreadyStarted = YES; + self.toSend = YES; } +*/ self.sessionType = sessionType; return self; diff --git a/AdjustTests/ADJTestActivityPackage.m b/AdjustTests/ADJTestActivityPackage.m index 00b3ff49b..ea3f174dd 100644 --- a/AdjustTests/ADJTestActivityPackage.m +++ b/AdjustTests/ADJTestActivityPackage.m @@ -72,8 +72,6 @@ - (void)testPackageSession:(ADJActivityPackage *)package [self testDefaultParameters:package fields:fields]; - // session parameters - // last_interval if ([@"1" isEqualToString:fields.sessionCount]) { appNil(@"last_interval"); @@ -82,6 +80,11 @@ - (void)testPackageSession:(ADJActivityPackage *)package } // default_tracker apspEquals(@"default_tracker", fields.defaultTracker); + + // callback_params + [self assertJsonParameters:package parameterName:@"callback_params" value:fields.callbackParameters]; + // partner_params + [self assertJsonParameters:package parameterName:@"partner_params" value:fields.partnerParameters]; } - (void)testEventPackage:(ADJActivityPackage *)package @@ -123,10 +126,25 @@ - (void)testEventPackage:(ADJActivityPackage *)package apspEquals(@"revenue", fields.revenue); // currency apspEquals(@"currency", fields.currency); + // callback_params [self assertJsonParameters:package parameterName:@"callback_params" value:fields.callbackParameters]; // partner_params [self assertJsonParameters:package parameterName:@"partner_params" value:fields.partnerParameters]; + + // saved callback parameters + if (fields.savedCallbackParameters == nil) { + alNil(package.callbackParameters, package.extendedString); + } else { + alTrue([fields.savedCallbackParameters isEqualToDictionary:package.callbackParameters], package.extendedString); + } + + // saved partner parameters + if (fields.savedPartnerParameters == nil) { + alNil(package.partnerParameters, package.extendedString); + } else { + alTrue([fields.savedPartnerParameters isEqualToDictionary:package.partnerParameters], package.extendedString); + } } - (void)testClickPackage:(ADJActivityPackage *)package @@ -329,14 +347,15 @@ - (void)testActivityState:(ADJActivityPackage *)package appnNil(@"ios_uuid"); } -- (BOOL)assertJsonParameters:(ADJActivityPackage *)package +- (void)assertJsonParameters:(ADJActivityPackage *)package parameterName:(NSString *)parameterName value:(NSString *)value { NSString * parameterValue = (NSString *)package.parameters[parameterName]; if (parameterValue == nil) { - return value == nil; + alNil(value, package.extendedString); + return; } // value not nil diff --git a/CHANGELOG.md b/CHANGELOG.md index bea8de737..92ac9384e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +### Version 4.9.0 (7th September 2016) +#### Added +- Added `ADJLogLevelSuppress` to disable all log output messages. +- Added possibility to delay the start of the first session. +- Added support for session parameters which are going to be sent with each session/event: + - Callback parameters + - Partner parameters +- Added sending of install receipt. +- Added iOS 10 compatibility. +- Added `AdjustSdkTv.framework` to releases page. + +#### Changed +- Deferred deep link info is now delivered as part of the `attribution` answer from the backend. +- Removed optional `adjust_redirect` parameter from resulting URL string when using `convertUniversalLink:scheme` method. +- Normalized properties attributes. +- Changed naming of background blocks. +- Using `weakself strongself` pattern for background blocks. +- Moving log level to the ADJConfig object. +- Accessing private properties directly when copying. +- Removed static framework build with no Bitcode support from releases page. +- Updated docs. + +#### Fixed +- Allow foreground/background timer to work in offline mode. +- Use `synchronized` blocks to prevent write deadlock/contention. +- Don't create/use background timer if the option is not configured. +- Replace strong references with weak when possible. +- Use background session configuration for `NSURLSession` when the option is set. + +-- + ### Version 4.8.5 (30th August 2016) #### Fixed - Not using `SFSafariViewController` on iOS devices with iOS version lower than 9. diff --git a/README.md b/README.md index c44d54bb0..ae34433da 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ If your app is an app which uses web views you would like to use adjust tracking * [In-App Purchase verification](#iap-verification) * [Callback parameters](#callback-parameters) * [Partner parameters](#partner-parameters) + * [Session parameters](#session-parameters) + * [Session callback parameters](#session-callback-parameters) + * [Session partner parameters](#session-partner-parameters) + * [Delay start](#delay-start) * [Attribution callback](#attribution-callback) * [Event and session callbacks](#event-session-callbacks) * [Disable tracking](#disable-tracking) @@ -33,12 +37,12 @@ If your app is an app which uses web views you would like to use adjust tracking * [Push token](#push-token) * [AdWords Search and Mobile Web tracking](#adwords) * [Pre-installed trackers](#pre-installed-trackers) - * [Deeplink reattributions](#deeplink-reattributions) - * [Universal links](#universal-links) - * [Enable universal links in the dashboard](#ulinks-dashboard) - * [Enable your iOS app to handle universal links](#ulinks-ios-app) - * [Support deeplinks for all iOS versions supported by the adjust SDK](#ulinks-support-all) - * [Deferred deeplink callback](#deferred-deeplink-callback) + * [Deep linking](#deeplinking) + * [Standard deep linking scenario](#deeplinking-standard) + * [Deep linking on iOS 8 and earlier](#deeplinking-setup-old) + * [Deep linking on iOS 9 and later](#deeplinking-setup-new) + * [Deferred deep linking scenario](#deeplinking-deferred) + * [Reattribution via deep links](#deeplinking-reattribution) * [Troubleshooting](#troubleshooting) * [Issues with delayed SDK initialisation](#ts-delayed-init) * [I'm seeing "Adjust requires ARC" error](#ts-arc) @@ -51,80 +55,96 @@ If your app is an app which uses web views you would like to use adjust tracking ## Example apps -There are example apps inside the [`examples` directory][examples] for [`iOS (Objective-C)`][example-ios-objc], -[`iOS (Swift)`][example-ios-swift], [`tvOS`][example-tvos] and [`Apple Watch`][example-iwatch]. You can open any of the -Xcode projects to see an example of how the adjust SDK can be integrated. +There are example apps inside the [`examples` directory][examples] for [`iOS (Objective-C)`][example-ios-objc], +[`iOS (Swift)`][example-ios-swift], [`tvOS`][example-tvos] and [`Apple Watch`][example-iwatch]. You can open any of these +Xcode projects to see an example of how the adjust SDK can be integrated. ## Basic integration -We will describe the steps to integrate the adjust SDK into your iOS project. We are going to assume that you use Xcode for -your iOS development. +We will describe the steps to integrate the adjust SDK into your iOS project. We are going to assume that you are using +Xcode for your iOS development. -If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue with +### Get the SDK + +Download the latest adjust SDK version from our [releases page][releases]. Extract the archive into a directory of your +choice. + +### Add the SDK to your project + +You can add the adjust SDK by adding all of it's source files direcly into your app. In Xcode's Project Navigator locate +the `Supporting Files` group (or any other group of your choice). From Finder, drag the `Adjust` subdirectory into Xcode's +`Supporting Files` group. + +![][drag] + +In the dialog `Choose options for adding these files` make sure to check the checkbox for `Copy items if needed` and select +the radio button to `Create groups`. + +![][add] + +-- + +If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue from [this step](#sdk-integrate): ```ruby -pod 'Adjust', '~> 4.8.5' +pod 'Adjust', '~> 4.9.0' ``` or: ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.8.5' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.9.0' ``` -If you're using [Carthage][carthage], you can add following line to your `Cartfile` and continue with +-- + +If you're using [Carthage][carthage], you can add following line to your `Cartfile` and continue from [this step](#sdk-frameworks): ```ruby github "adjust/ios_sdk" ``` -You can also choose to integrate the adjust SDK by adding it to your project as a framework. On the -[releases page][releases] you can find three archives: +-- + +You can also choose to integrate the adjust SDK by adding it to your project as a framework. On the +[releases page][releases] you can find the following archives: * `AdjustSdkStatic.framework.zip` * `AdjustSdkDynamic.framework.zip` -* `AdjustSdkStaticNoBitcode.framework.zip` +* `AdjustSdkTv.framework.zip` -Since the release of iOS 8, Apple has introduced dynamic frameworks (also known as embedded frameworks). If your app is +Since the release of iOS 8, Apple has introduced dynamic frameworks (also known as embedded frameworks). If your app is targeting iOS 8 or higher, you can use the adjust SDK dynamic framework. Choose which framework you want to use – static or dynamic – and add it to your project. -In case you want to use the static adjust SDK framework without Bitcode support added to it, you can choose -`AdjustSdkStaticNoBitcode.framework.zip` file and add it to your project. - -If you have chosen one of these ways of integrating the adjust SDK, you may continue with [this step](#sdk-frameworks). If -you want to add the adjust SDK by adding its source files to your project, you can continue with [this step](#sdk-get). - -### Get the SDK - -Download the latest version from our [releases page][releases]. Extract the archive into a directory of your choice. - -### Add the SDK to your project - -In Xcode's Project Navigator locate the `Supporting Files` group (or any other group of your choice). From Finder, drag the -`Adjust` subdirectory into Xcode's `Supporting Files` group. - -![][drag] - -In the dialog `Choose options for adding these files` make sure to check the checkbox to `Copy items if needed` and select -the radio button to `Create groups`. +If you are having `tvOS` app, you can use the adjust SDK with it as well with usage of our tvOS framework which you can +extract from `AdjustSdkTv.framework.zip` archive. -![][add] +If you have chosen one of these ways to integrate the adjust SDK, you may continue from [this step](#sdk-frameworks). If +you want to add the adjust SDK by adding its source files to your project, you can continue from [this step](#sdk-get). ### Add the AdSupport and iAd framework -Select your project in the Project Navigator. In the left hand side of the main view, select your target. In the tab -`Build Phases`, expand the group `Link Binary with Libraries`. On the bottom of that section click on the `+` button. -Select the `AdSupport.framework` and click the `Add` button. Repeat the same steps to add the `iAd.framework`, unless you -are using tvOS. Change the `Status` of both frameworks to `Optional`. +Select your project in the Project Navigator. In the left hand side of the main view, select your target. In the tab +`Build Phases`, expand the group `Link Binary with Libraries`. On the bottom of that section click on the `+` button. +Select the `AdSupport.framework` and click the `Add` button. Unless you +are using tvOS, repeat the same steps to add the `iAd.framework`. Change the `Status` of both frameworks to `Optional`. ![][framework] ### Integrate the SDK into your app -If you added the adjust SDK from the source or via a Pod repository, you should use one of the following import statement: +If you added the adjust SDK from the source, you should use the following import statement: + +```objc +#import "Adjust.h" +``` + +-- + +If you added the adjust SDK via a Pod repository, you should use one of the following import statements: ```objc #import "Adjust.h" @@ -136,24 +156,35 @@ or #import ``` -If you added the adjust SDK as a framework or via Carthage, you should use following import statement: +-- + +If you added the adjust SDK as a static/dynamic framework or via Carthage, you should use the following import statement: ```objc #import ``` -To begin, we'll set up basic session tracking. +-- + +If you are are using the adjust SDK with your tvOS app, you should use the following import statement: + +```objc +#import +``` + +Next, we'll set up basic session tracking. ### Basic setup -In the Project Navigator, open the source file of your application delegate. Add the `import` statement at the top of the -file, then add the following call to `Adjust` in the `didFinishLaunching` or `didFinishLaunchingWithOptions` method of your +In the Project Navigator, open the source file of your application delegate. Add the `import` statement at the top of the +file, then add the following call to `Adjust` in the `didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate: ```objc #import "Adjust.h" // or #import // or #import +// or #import // ... @@ -161,12 +192,14 @@ NSString *yourAppToken = @"{YourAppToken}"; NSString *environment = ADJEnvironmentSandbox; ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; + [Adjust appDidLaunch:adjustConfig]; ``` + ![][delegate] -**Note**: Initialising the adjust SDK like this is `very important`. Otherwise, you may encounter different kinds of -[issues](#ts-delayed-init) described in our troubleshooting section. +**Note**: Initialising the adjust SDK like this is `very important`. Otherwise, you may encounter different kinds of +issues as described in our [troubleshooting section](#ts-delayed-init). Replace `{YourAppToken}` with your app token. You can find this in your [dashboard]. @@ -177,31 +210,53 @@ NSString *environment = ADJEnvironmentSandbox; NSString *environment = ADJEnvironmentProduction; ``` -**Important:** This value should be set to `ADJEnvironmentSandbox` if and only if you or someone else is testing your app. -Make sure to set the environment to `ADJEnvironmentProduction` just before you publish the app. Set it back to +**Important:** This value should be set to `ADJEnvironmentSandbox` if and only if you or someone else is testing your app. +Make sure to set the environment to `ADJEnvironmentProduction` just before you publish the app. Set it back to `ADJEnvironmentSandbox` when you start developing and testing it again. -We use this environment to distinguish between real traffic and test traffic from test devices. It is very important that +We use this environment to distinguish between real traffic and test traffic from test devices. It is very important that you keep this value meaningful at all times! This is especially important if you are tracking revenue. ### Adjust logging -You can increase or decrease the amount of logs you see in tests by calling `setLogLevel:` on your `ADJConfig` instance with -one of the following parameters: +You can increase or decrease the amount of logs that you see during testing by calling `setLogLevel:` on your `ADJConfig` +instance with one of the following parameters: + +```objc +[adjustConfig setLogLevel:ADJLogLevelVerbose]; // enable all logging +[adjustConfig setLogLevel:ADJLogLevelDebug]; // enable more logging +[adjustConfig setLogLevel:ADJLogLevelInfo]; // the default +[adjustConfig setLogLevel:ADJLogLevelWarn]; // disable info logging +[adjustConfig setLogLevel:ADJLogLevelError]; // disable warnings as well +[adjustConfig setLogLevel:ADJLogLevelAssert]; // disable errors as well +[adjustConfig setLogLevel:ADJLogLevelSuppress]; // disable all logging +``` + +If you don't want your app in production to display any logs coming from the adjust SDK, then you should select +`ADJLogLevelSuppress` and in addition to that, initialise `ADJConfig` object with another constructor where you should +enable suppress log level mode: ```objc -[adjustConfig setLogLevel:ADJLogLevelVerbose]; // enable all logging -[adjustConfig setLogLevel:ADJLogLevelDebug]; // enable more logging -[adjustConfig setLogLevel:ADJLogLevelInfo]; // the default -[adjustConfig setLogLevel:ADJLogLevelWarn]; // disable info logging -[adjustConfig setLogLevel:ADJLogLevelError]; // disable warnings as well -[adjustConfig setLogLevel:ADJLogLevelAssert]; // disable errors as well +#import "Adjust.h" +// or #import +// or #import +// or #import + +// ... + +NSString *yourAppToken = @"{YourAppToken}"; +NSString *environment = ADJEnvironmentSandbox; +ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken + environment:environment]; + allowSupressLogLevel:YES]; + +[Adjust appDidLaunch:adjustConfig]; ``` ### Build your app -Build and run your app. If the build succeeds, you should carefully read the SDK logs in the console. After the app launches -for the first time, you should see the info log `Install tracked`. +Build and run your app. If the build succeeds, you should carefully read the SDK logs in the console. After the app +launches for the first time, you should see the info log `Install tracked`. ![][run] @@ -211,8 +266,8 @@ Once you integrate the adjust SDK into your project, you can take advantage of t ### Event tracking -You can use adjust to track events. Lets say you want to track every tap on a particular button. You would create a new -event token in your [dashboard], which has an associated event token - looking something like `abc123`. In your button's +You can use adjust to track events. Lets say you want to track every tap on a particular button. You would create a new +event token in your [dashboard], which has an associated event token - looking something like `abc123`. In your button's `buttonDown` method you would then add the following lines to track the tap: ```objc @@ -222,35 +277,37 @@ ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; When tapping the button you should now see `Event tracked` in the logs. -The event instance can be used to configure the event even more before tracking it. +The event instance can be used to configure the event further before tracking it: -#### Revenue tracking +### Revenue tracking -If your users can generate revenue by tapping on advertisements or making in-app purchases you can track those revenues with -events. Lets say a tap is worth one Euro cent. You could then track the revenue event like this: +If your users can generate revenue by tapping on advertisements or making in-app purchases you can track those revenues +with events. Lets say a tap is worth one Euro cent. You could then track the revenue event like this: ```objc ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; + [event setRevenue:0.01 currency:@"EUR"]; + [Adjust trackEvent:event]; ``` This can be combined with callback parameters of course. -When you set a currency token, adjust will automatically convert the incoming revenues into a reporting revenue of your +When you set a currency token, adjust will automatically convert the incoming revenues into a reporting revenue of your choice. Read more about [currency conversion here.][currency-conversion] You can read more about revenue and event tracking in the [event tracking guide] (https://docs.adjust.com/en/event-tracking/#reference-tracking-purchases-and-revenues). -#### Revenue deduplication +### Revenue deduplication -You can also pass in an optional transaction ID to avoid tracking duplicate revenues. The last ten transaction IDs are -remembered and revenue events with duplicate transaction IDs are skipped. This is especially useful for in-app purchase +You can also pass in an optional transaction ID to avoid tracking duplicate revenues. The last ten transaction IDs are +remembered and revenue events with duplicate transaction IDs are skipped. This is especially useful for in-app purchase tracking. See an example below. -If you want to track in-app purchases, please make sure to call `trackEvent` after `finishTransaction` in -`paymentQueue:updatedTransaction` only if the state changed to `SKPaymentTransactionStatePurchased`. That way you can avoid +If you want to track in-app purchases, please make sure to call `trackEvent` after `finishTransaction` in +`paymentQueue:updatedTransaction` only if the state changed to `SKPaymentTransactionStatePurchased`. That way you can avoid tracking revenue that is not actually being generated. ```objc @@ -272,24 +329,25 @@ tracking revenue that is not actually being generated. } ``` -#### In-App Purchase verification +### In-App Purchase verification -If you want to check the validity of In-App Purchases made in your app using Purchase Verification, adjust's server side +If you want to check the validity of In-App Purchases made in your app using Purchase Verification, adjust's server side receipt verification tool, then check out our iOS purchase SDK and read more about it [here][ios-purchase-verification]. -#### Callback parameters +### Callback parameters -You can register a callback URL for your events in your [dashboard]. We will send a GET request to that URL whenever the -event gets tracked. You can add callback parameters to that event by calling `addCallbackParameter` on the event before +You can register a callback URL for your events in your [dashboard]. We will send a GET request to that URL whenever the +event is tracked. You can add callback parameters to that event by calling `addCallbackParameter` to the event before tracking it. We will then append these parameters to your callback URL. -For example, suppose you have registered the URL -`http://www.mydomain.com/callback` then track an event like this: +For example, suppose you have registered the URL `http://www.mydomain.com/callback` then track an event like this: ```objc ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; + [event addCallbackParameter:@"key" value:@"value"]; [event addCallbackParameter:@"foo" value:@"bar"]; + [Adjust trackEvent:event]; ``` @@ -297,34 +355,126 @@ In that case we would track the event and send a request to: http://www.mydomain.com/callback?key=value&foo=bar -It should be mentioned that we support a variety of placeholders like `{idfa}` that can be used as parameter values. In the -resulting callback this placeholder would be replaced with the ID for Advertisers of the current device. Also note that we -don't store any of your custom parameters, but only append them to your callbacks, thus without a callback they will not be +It should be mentioned that we support a variety of placeholders like `{idfa}` that can be used as parameter values. In the +resulting callback this placeholder would be replaced with the ID for Advertisers of the current device. Also note that we +don't store any of your custom parameters, but only append them to your callbacks, thus without a callback they will not be saved nor sent to you. -You can read more about using URL callbacks, including a full list of available values, in our +You can read more about using URL callbacks, including a full list of available values, in our [callbacks guide][callbacks-guide]. -#### Partner parameters +### Partner parameters -You can also add parameters to be transmitted to network partners, for the integrations that have been activated in your -adjust dashboard. +You can also add parameters to be transmitted to network partners, which have been activated in youradjust dashboard. -This works similarly to the callback parameters mentioned above, but can be added by calling the `addPartnerParameter` +This works similarly to the callback parameters mentioned above, but can be added by calling the `addPartnerParameter` method on your `ADJEvent` instance. ```objc ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; + [event addPartnerParameter:@"key" value:@"value"]; +[event addPartnerParameter:@"foo" value:@"bar"]; + [Adjust trackEvent:event]; ``` You can read more about special partners and these integrations in our [guide to special partners][special-partners]. +### Session parameters + +Some parameters are saved to be sent in every event and session of the adjust SDK. Once you have added any of these +parameters, you don't need to add them every time, since they will be saved locally. If you add the same parameter twice, +there will be no effect. + +These session parameters can be called before the adjust SDK is launched to make sure they are sent even on install. If you +need to send them with an install, but can only obtain the needed values after launch, it's possible to +[delay](#delay-start) the first launch of the adjust SDK to allow this behaviour. + +### Session callback parameters + +The same callback parameters that are registered for [events](#callback-parameters) can be also saved to be sent in every +event or session of the adjust SDK. + +The session callback parameters have a similar interface of the event callback parameters. Instead of adding the key and +it's value to an event, it's added through a call to `Adjust` method `addSessionCallbackParameter:value:`: + +```objc +[Adjust addSessionCallbackParameter:@"foo" value:@"bar"]; +``` + +The session callback parameters will be merged with the callback parameters added to an event. The callback parameters +added to an event have precedence over the session callback parameters. Meaning that, when adding a callback parameter to +an event with the same key to one added from the session, the value that prevails is the callback parameter added to the +event. + +It's possible to remove a specific session callback parameter by passing the desiring key to the method +`removeSessionCallbackParameter`. + +```objc +[Adjust removeSessionCallbackParameter:@"foo"]; +``` + +If you wish to remove all key and values from the session callback parameters, you can reset it with the method +`resetSessionCallbackParameters`. + +```objc +[Adjust resetSessionCallbackParameters]; +``` + +### Session partner parameters + +In the same way that there is [session callback parameters](#session-callback-parameters) that are sent every in event or +session of the adjust SDK, there is also session partner parameters. + +These will be transmitted to network partners, for the integrations that have been activated in your adjust [dashboard]. + +The session partner parameters have a similar interface to the event partner parameters. Instead of adding the key and it's +value to an event, it's added through a call to `Adjust` method `addSessionPartnerParameter:value:`: + +```objc +[Adjust addSessionPartnerParameter:@"foo" value:@"bar"]; +``` + +The session partner parameters will be merged with the partner parameters added to an event. The partner parameters added +to an event have precedence over the session partner parameters. Meaning that, when adding a partner parameter to an event +with the same key to one added from the session, the value that prevails is the partner parameter added to the event. + +It's possible to remove a specific session partner parameter by passing the desiring key to the method +`removeSessionPartnerParameter`. + +```objc +[Adjust removeSessionPartnerParameter:@"foo"]; +``` + +If you wish to remove all key and values from the session partner parameters, you can reset it with the method +`resetSessionPartnerParameters`. + +```objc +[Adjust resetSessionPartnerParameters]; +``` + +### Delay start + +Delaying the start of the adjust SDK allows your app some time to obtain session parameters, such as unique identifiers, to +be send on install. + +Set the initial delay time in seconds with the method `setDelayStart` in the `ADJConfig` instance: + +```objc +[adjustConfig setDelayStart:5.5]; +``` + +In this case this will make the adjust SDK not send the initial install session and any event created for 5.5 seconds. +After this time is expired or if you call `[Adjust sendFirstPackages]` in the meanwhile, every session parameter will be +added to the delayed install session and events and the adjust SDK will resume as usual. + +**The maximum delay start time of the adjust SDK is 10 seconds**. + ### Attribution callback -You can register a delegate callback to be notified of tracker attribution changes. Due to the different sources considered -for attribution, this information can not be provided synchronously. Follow these steps to implement the optional delegate +You can register a delegate callback to be notified of tracker attribution changes. Due to the different sources considered +for attribution, this information can not be provided synchronously. Follow these steps to implement the optional delegate protocol in your app delegate: Please make sure to consider our [applicable attribution data policies.][attribution-data] @@ -332,10 +482,6 @@ Please make sure to consider our [applicable attribution data policies.][attribu 1. Open `AppDelegate.h` and add the import and the `AdjustDelegate` declaration. ```objc - #import "Adjust.h" - // or #import - // or #import - @interface AppDelegate : UIResponder ``` @@ -351,12 +497,12 @@ Please make sure to consider our [applicable attribution data policies.][attribu ```objc [adjustConfig setDelegate:self]; ``` - -As the delegate callback is configured using the `ADJConfig` instance, you should call `setDelegate` before calling + +As the delegate callback is configured using the `ADJConfig` instance, you should call `setDelegate` before calling `[Adjust appDidLaunch:adjustConfig]`. -The delegate function will get when the SDK receives final attribution data. Within the delegate function you have access to -the `attribution` parameter. Here is a quick summary of its properties: +The delegate function will be called after the SDK receives the final attribution data. Within the delegate function you +have access to the `attribution` parameter. Here is a quick summary of its properties: - `NSString trackerToken` the tracker token of the current install. - `NSString trackerName` the tracker name of the current install. @@ -368,9 +514,8 @@ the `attribution` parameter. Here is a quick summary of its properties: ### Event and session callbacks -You can register a delegate callback to be notified of successful and failed tracked events and/or sessions. - -The same optional protocol `AdjustDelegate` used for the [attribution callback](#attribution-callback) is used. +You can register a delegate callback to be notified of successful and failed tracked events and/or sessions. The same +optional protocol `AdjustDelegate` used for the [attribution callback](#attribution-callback) is used. Follow the same steps and implement the following delegate callback function for successful tracked events: @@ -400,8 +545,8 @@ And for failed tracked sessions: } ``` -The delegate functions will be called after the SDK tries to send a package to the server. Within the delegate callback you -have access to a response data object specifically for the delegate callback. Here is a quick summary of the session +The delegate functions will be called after the SDK tries to send a package to the server. Within the delegate callback you +have access to a response data object specifically for the delegate callback. Here is a quick summary of the session response data properties: - `NSString message` the message from the server or the error logged by the SDK. @@ -415,24 +560,24 @@ Both event response data objects contain: And both event and session failed objects also contain: -- `BOOL willRetry` indicates there will be an attempt to resend the package at a later time. +- `BOOL willRetry` indicates that there will be an attempt to resend the package at a later time. ### Disable tracking -You can disable the adjust SDK from tracking any activities of the current device by calling `setEnabled` with parameter +You can disable the adjust SDK from tracking any activities of the current device by calling `setEnabled` with parameter `NO`. **This setting is remembered between sessions**, but it can only be activated after the first session. ```objc [Adjust setEnabled:NO]; ``` -You can check if the adjust SDK is currently enabled by calling the function `isEnabled`. It is always +You can check if the adjust SDK is currently enabled by calling the function `isEnabled`. It is always possible to activate the adjust SDK by invoking `setEnabled` with the enabled parameter as `YES`. ### Offline mode -You can put the adjust SDK in offline mode to suspend transmission to our servers while retaining tracked data to be sent -later. While in offline mode, all information is saved in a file, so be careful not to trigger too many events while in +You can put the adjust SDK in offline mode to suspend transmission to our servers while retaining tracked data to be sent +later. While in offline mode, all information is saved in a file, so be careful not to trigger too many events while in offline mode. You can activate offline mode by calling `setOfflineMode` with the parameter `YES`. @@ -441,33 +586,37 @@ You can activate offline mode by calling `setOfflineMode` with the parameter `YE [Adjust setOfflineMode:YES]; ``` -Conversely, you can deactivate offline mode by calling `setOfflineMode` with `NO`. When the adjust SDK is put back in online -mode, all saved information is send to our servers with the correct time information. +Conversely, you can deactivate offline mode by calling `setOfflineMode` with `NO`. When the adjust SDK is put back in +online mode, all saved information is sent to our servers with the correct time information. -Unlike disabling tracking, this setting is **not remembered** bettween sessions. This means that the SDK is in online mode +Unlike disabling tracking, this setting is **not remembered** bettween sessions. This means that the SDK is in online mode whenever it is started, even if the app was terminated in offline mode. ### Event buffering -If your app makes heavy use of event tracking, you might want to delay some HTTP requests in order to send them in one batch -every minute. You can enable event buffering with your `ADJConfig` instance: +If your app makes heavy use of event tracking, you might want to delay some HTTP requests in order to send them in one +batch every minute. You can enable event buffering with your `ADJConfig` instance: ```objc [adjustConfig setEventBufferingEnabled:YES]; ``` +If nothing is set, event buffering is **disabled by default**. + ### Background tracking -The default behaviour of the adjust SDK is to pause sending HTTP requests while the app is in the background. You can change -this in your `AdjustConfig` instance: +The default behaviour of the adjust SDK is to pause sending HTTP requests while the app is in the background. You can +change this in your `AdjustConfig` instance: ```objc [adjustConfig setSendInBackground:YES]; ``` +If nothing is set, sending in background is **disabled by default**. + ### Device IDs -Certain services (such as Google Analytics) require you to coordinate device and client IDs in order to prevent duplicate +Certain services (such as Google Analytics) require you to coordinate device and client IDs in order to prevent duplicate reporting. To obtain the device identifier IDFA, call the function `idfa`: @@ -478,7 +627,7 @@ NSString *idfa = [Adjust idfa]; ### Push token -To send us the push notification token, then add the following call to `Adjust` in the +To send us the push notification token, add the following call to `Adjust` in the `didRegisterForRemoteNotificationsWithDeviceToken` of your app delegate: ```objc @@ -489,29 +638,29 @@ To send us the push notification token, then add the following call to `Adjust` ### AdWords Search and Mobile Web tracking -To support deterministic tracking for all AdWords web inventories, you just need to call the `sendAdWordsRequest` on the +To support deterministic tracking for all AdWords web inventories, you simply need to call the `sendAdWordsRequest` on the adjust instance **before** initialising the SDK. ```objc #import "Adjust.h" // or #import // or #import +// or #import // ... +[Adjust sendAdWordsRequest]; NSString *yourAppToken = @"{YourAppToken}"; NSString *environment = ADJEnvironmentSandbox; ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; - -[Adjust sendAdWordsRequest]; + [Adjust appDidLaunch:adjustConfig]; ``` ### Pre-installed trackers -If you want to use the Adjust SDK to recognize users that found your app -pre-installed on their device, follow these steps. +If you want to use the Adjust SDK to recognize users that found your app pre-installed on their device, follow these steps. 1. Create a new tracker in your [dashboard]. 2. Open your app delegate and add set the default tracker of your `ADJConfig`: @@ -522,10 +671,9 @@ pre-installed on their device, follow these steps. [Adjust appDidLaunch:adjustConfig]; ``` - Replace `{TrackerToken}` with the tracker token you created in step 2. - Please note that the dashboard displays a tracker URL (including - `http://app.adjust.com/`). In your source code, you should specify only the - six-character token and not the entire URL. + Replace `{TrackerToken}` with the tracker token you created in step 2. Please note that the dashboard displays a tracker + URL (including `http://app.adjust.com/`). In your source code, you should specify only the six-character token and not + the entire URL. 3. Build and run your app. You should see a line like the following in XCode: @@ -533,262 +681,296 @@ pre-installed on their device, follow these steps. Default tracker: 'abc123' ``` -### Deeplink reattributions +### Deep linking + +If you are using the adjust tracker URL with an option to deep link into your app from the URL, there is the possibility to +get info about the deep link URL and its content. Hitting the URL can happen when the user has your app already installed +(standard deep linking scenario) or if they don't have the app on their device (deferred deep linking scenario). Both of +these scenarios are supported by the adjust SDK and in both cases the deep link URL will be provided to you after you app +has been started after hitting the tracker URL. In order to use this feature in your app, you need to set it up properly. + +### Standard deep linking scenario + +If your user already has the app installed and hits the tracker URL with deep link information in it, your application will +be opened and the content of the deep link will be sent to your app so that you can parse it and decide what to do next. +With introduction of iOS 9, Apple has changed the way how deep linking should be handled in the app. Depending on which +scenario you want to use for your app (or if you want to use them both to support wide range of devices), you need to set +up your app to handle one or both of the following scenarios. -You can set up the adjust SDK to handle deeplinks that are used to open your app via a custom URL scheme. We will only read -certain adjust specific parameters. This is essential if you are planning to run retargeting or re-engagement campaigns with -deeplinks. +### Deep linking on iOS 8 and earlier -If you are planning to run retargeting or re-engagement campaigns with deep links, you should put the adjust campaign -specific parameter into your deep link. For more information on how to run retargeting or re-engagement campaigns with deep -links, check our [official docs][reattribution-deeplinks]. +Deep linking on iOS 8 and earlier devices is being done with usage of a custom URL scheme setting. You need to pick a +custom URL scheme name which your app will be in charge for opening. This scheme name will also be used in the adjust +tracker URL as part of the `deep_link` parameter. In order to set this in your app, open your `Info.plist` file and add new +`URL types` row to it. In there, as `URL identifier` write you app's bundle ID and under `URL schemes` add scheme name(s) +which you want your app to handle. In the example below, we have chosen that our app should handle the `adjustExample` scheme +name. -In the Project Navigator open the source file your Application Delegate. Find or add the method `openURL` and add the -following call to adjust: +![][custom-url-scheme] + +After this has been set up, your app will be opened after you click the adjust tracker URL with `deep_link` parameter +which contains the scheme name which you have chosen. After app is opened, `openURL` method of your `AppDelegate` class will +be triggered and the place where the content of the `deep_link` parameter from the tracker URL will be delivered. If you +want to access the content of the deep link, override this method. ```objc - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - [Adjust appWillOpenUrl:url]; - - // Your code goes here - BOOL canHandle = [self someLogic:url]; - return canHandle; + // url object contains your deep link content + + // Apply your logic to determine the return value of this method + return YES; + // or + // return NO; } ``` -**Important**: Tracker URLs with `deep_link` parameter and your custom URL scheme in it are no longer supported in -`iOS 9 and higher` and clicks on them will not cause your app to be opened nor `openURL` method to get triggered. Apple -dropped support for this way of deeplinking into the app in favour of `universal links`. However, this approach will -`still works for devices with iOS 8 and lower`. - -#### Universal links +With this setup, you have successfully set up deep linking handling for iOS devices with iOS 8 and earlier versions. -**Note**: Universal links are supported `since iOS 9`. +### Deep linking on iOS 9 and later -If you want to support [universal links][universal-links], then follow these next steps. +In order to set deep linking support for iOS 9 and later devices, you need to enable your app to handle Apple universal +links. To find out more about universal links and how their setup looks like, you can check [here][universal-links]. -#### Enable universal links in the dashboard +Adjust is taking care of lots of things to do with universal links behind the scenes. But, in order to support +universal links with the adjust, you need to perform small setup for universal links in the adjust dashboard. For more +information on that should be done, please consult our official [docs][universal-links-guide]. -In order to enable universal links for your app, go to the adjust dashboard and select `Universal Linking` option in your -`Platform Settings` for iOS. +Once you have successfully enabled the universal links feature in the dashboard, you need to do this in your app as well: -![][universal-links-dashboard] +After enabling `Associated Domains` for your app in Apple Developer Portal, you need to do the same thing in your app's +Xcode project. After enabling `Assciated Domains`, add the universal link which was generated for you in the adjust +dashboard in the `Domains` section by prefixing it with `applinks:` and make sure that you also remove the `http(s)` part of the +universal link. -You will need to fill in your `iOS Bundle ID` and `iOS Team ID`. +![][associated-domains-applinks] -![][universal-links-dashboard-values] +After this has been set up, your app will be opened after you click the adjust tracker universal link. After app is +opened, `continueUserActivity` method of your `AppDelegate` class will be triggered and the place where the content of the +universal link URL will be delivered. If you want to access the content of the deep link, override this method. -You can find your iOS Team ID in the `Apple Developer Center`. - -![][adc-ios-team-id] +``` objc +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + NSURL url = [userActivity webpageURL]; -After you entered these two values, a universal link for your app will be generated and will look like this: + // url object contains your universal link content + } -``` -applinks:[hash].ulink.adjust.com + // Apply your logic to determine the return value of this method + return YES; + // or + // return NO; +} ``` -#### Enable your iOS app to handle universal links +With this setup, you have successfully set up deep linking handling for iOS devices with iOS 9 and later versions. -In Apple Developer Center, you should enable `Associated Domains` for your app. - -![][adc-associated-domains] - -**Important**: Usually, `iOS Team ID` is the same as the `Prefix` value (above picture) for your app. In some cases, it can -happen that these two values differ. If this is the case, please go back to this [step](#ulinks-setup) and use `Prefix` -value for `iOS Team ID` field in the adjust dashboard. - -Once you have done this, you should enable `Associated Domains` in your app's Xcode project settings, and copy the generated -universal link from the dashboard into the `Domains` section. - -![][xcode-associated-domains] - -Next, find or add the method `application:continueUserActivity:restorationHandler:` in your Application Delegate. In that -method, add the following call to adjust: +We provide a helper function that allows you to convert a universal link to an old style deep link URL, in case you had +some custom logic in your code which was always expecting deep link info to arrive in old style custom URL scheme format. +You can call this method with universal link and the custom URL scheme name which you would like to see your deep link +prefixed with and we will generate the custom URL scheme deep link for you: ``` objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - [Adjust appWillOpenUrl:[userActivity webpageURL]]; + NSURL url = [userActivity webpageURL]; + + NSURL *oldStyleDeeplink = [Adjust convertUniversalLink:url scheme:@"adjustExample"]; } - // Your code goes here - BOOL canHandle = [self someLogic:[userActivity webpageURL]]; - return canHandle; + // Apply your logic to determine the return value of this method + return YES; + // or + // return NO; } ``` -For example, if you were setting your `deep_link` parameter like this: +### Deferred deep linking scenario -``` -example://path/?key=foo&value=bar -``` - -the adjust backend will convert it to a universal link, which looks like this: +You can register a delegate callback to be notified before a deferred deep link is opened and decide if the adjust SDK will +try to open it. The same optional protocol `AdjustDelegate` used for the [attribution callback](#attribution-callback) and +for [event and session callbacks](#event-session-callbacks) is used. -``` -https://[hash].ulink.adjust.com/ulink/path/?key=foo&value=bar -``` - -We provide a helper function that allows you to convert a universal link to a deeplink url. +Follow the same steps and implement the following delegate callback function for deferred deep links: ```objc -NSURL *deeplink = [Adjust convertUniversalLink:[userActivity webpageURL] scheme:@"example"]; +- (void)adjustDeeplinkResponse:(NSURL *)deeplink { + // deeplink object contains information about deferred deep link content + + // Apply your logic to determine whether the adjust SDK should try to open the deep link + return YES; + // or + // return NO; +} ``` -You can read more about implementing universal links in our [guide to universal links][universal-links-guide]. +The callback function will be called after the SDK receives a deffered deep link from our server and before opening it. +Within the callback function you have access to the deep link. The returned boolean value determines if the SDK will launch +the deep link. You could, for example, not allow the SDK to open the deep link at the current moment, save it, and open it +yourself later. -#### Support deeplinks for all iOS versions supported by the adjust SDK +If this callback is not implemented, **the adjust SDK will always try to open the deep link by default**. -If you are aiming iOS 9 and higher with your app, universal links are all you need in order to enable deeplinking for your -app. But, in case you want to support deeplinking on iOS 8 and lower devices as well, you need to build adjust style -universal link like described in [here][adjust-universal-links]. +### Reattribution via deep links -Also, you should have both methods implemented in your Application Delegate class - `openURL` and -`application:continueUserActivity:restorationHandler:` because based on device iOS version, one (`iOS 8 and lower`) or -another (`iOS 9 and higher`) method will be triggered and deeplink content delivered in your app for you to parse it and -decide where to navigate the user. +Adjust enables you to run re-engagement campaigns with usage of deep links. For more information on how to do that, please +check our [official docs][reattribution-with-deeplinks]. -For instructions how to test your implementation, please read our [guide][universal-links-testing]. +If you are using this feature, in order for your user to be properly reattributed, you need to make one additional call to +the adjust SDK in your app. -#### Deferred deeplink callback +Once you have received deep link content information in your app, add a call to the `appWillOpenUrl` method. By making +this call, the adjust SDK will try to find if there is any new attribution info inside of the deep link and if any, it will +be sent to the adjust backend. If your user should be reattributed due to a click on the adjust tracker URL with deep link +content in it, you will see the [attribution callback](#attribution-callback) in your app being triggered with new +attribution info for this user. -You can register a delegate callback to be notified before a deferred deeplink is opened and decide if the adjust SDK will -open it. +The call to `appWillOpenUrl` should be done like this to support deep linking reattributions in all iOS versions: -The same optional protocol `AdjustDelegate` used for the [attribution callback](#attribution-callback) and for -[event and session callbacks](#event-session-callbacks) is used. +``` objc +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + NSURL url = [userActivity webpageURL]; -Follow the same steps and implement the following delegate callback function for deferred deeplinks: + // url object contains your universal link content -```objc -// evaluate deeplink to be launched -- (void)adjustDeeplinkResponse:(NSURL *)deeplink { - // ... - if ([self allowAdjustSDKToOpenDeeplink:deeplink]) { - return YES; - } else { - return NO; - } + [Adjust appWillOpenUrl:url]; + } + + // Apply your logic to determine the return value of this method + return YES; + // or + // return NO; } ``` -The callback function will be called after the SDK receives a deffered deeplink from our server and before opening it. -Within the callback function you have access to the deeplink. The returned boolean value determines if the SDK will launch -the deeplink. You could, for example, not allow the SDK open the deeplink at the moment, save it, and open it yourself -later. +``` objc +- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity + restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { + if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { + NSURL url = [userActivity webpageURL]; + + [Adjust appWillOpenUrl:url]; + } + + // Apply your logic to determine the return value of this method + return YES; + // or + // return NO; +} +``` ## Troubleshooting -#### Issues with delayed SDK initialisation +### Issues with delayed SDK initialisation -As described in [basic setup step](#basic-setup), we strongly advise you to initialise the adjust SDK in the -`didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate. It is really important to initialise -the adjust SDK in this moment (basically, as soon as possible) so that you can use all the features of the SDK. +As described in the [basic setup step](#basic-setup), we strongly advise you to initialise the adjust SDK in the +`didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate. It is imperative to initialise the +adjust SDK in as soon as possible so that you can use all the features of the SDK. -Deciding not to initialise the adjust SDK at this moment can have all kinds of impacts to tracking in your app if you are -unaware of this thing: **In order to perform any kind of tracking in your app, the adjust SDK *must* be initialised.** +Deciding not to initialise the adjust SDK immediately can have all kinds of impacts on the tracking in your app: +**In order to perform any kind of tracking in your app, the adjust SDK *must* be initialised.** If you decide to perform any of these actions: * [Event tracking](#event-tracking) -* [Deeplink reattributions](#deeplink-reattributions) +* [Reattribution via deep links](#deeplinking-reattribution) * [Disable tracking](#disable-tracking) * [Offline mode](#offline-mode) before initialising the SDK, `they won't be performed`. -If you want all the actions, which you wanted to do with the adjust SDK before its actual initialisation, still to happen, -the only way to do this is to build `custom actions queueing mechanism` inside your app. +If you want any of these actions to be tracked with the adjust SDK before its actual initialisation, you must build a +`custom actions queueing mechanism` inside your app. You need to queue all the actions you want our SDK to perform and +perform them once the SDK is initialised. -Offline mode state won't be changed, tracking enabled/disabled state won't be changed, deeplink reattributions will not be +Offline mode state won't be changed, tracking enabled/disabled state won't be changed, deep link reattributions will not be possible to happen, any of tracked events will be `dropped`. -One more thing which might be affected with delayed SDK is session tracking. The adjust SDK can't start to collect any -session length info before it is actually initialised. This can affect your DAU numbers in the dashboard which might not be -tracked properly. +Another thing which might be affected by delayed SDK initialisation is session tracking. The adjust SDK can't start to +collect any session length info before it is actually initialised. This can affect your DAU numbers in the dashboard which +might not be tracked properly. -As an example, let's assume this scenario: You are starting the adjust SDK when some specific view or view controller is -loaded and let's say that this is not splash nor first screen in your app, but user has to navigate to it from the home -screen. If user downloads your app and opens it, home screen will be displayed. In this moment, this user has made an -install which should be tracked, maybe user came from some specific campaign, he started the app, so he made a session from -his device and was in fact a daily active user of your app. The adjust SDK doesn't know anything about this, because user -needs to navigate to some screen where you decided to initialise it. If user, for some reason, decides that he/she doesn't -like the app and to uninstall it right after seeing home screen, all informations mentioned above will never be tracked by -our SDK, nor displayed in the dashboard. +As an example, let's assume this scenario: You are initialising the adjust SDK when some specific view or view controller +is loaded and let's say that this is not the splash nor the first screen in your app, but user has to navigate to it from +the home screen. If user downloads your app and opens it, the home screen will be displayed. At this moment, this user has +made an install which should be tracked. However, the adjust SDK doesn't know anything about this, because the user needs +to navigate to the screen mentioned previously where you decided to initialise the adjust SDK. Further, if the user decides +that he/she doesn't like the app and uninstalls it right after seeing home screen, all the information mentioned above will +never be tracked by our SDK, nor displayed in the dashboard. -You need to queue all the actions you want our SDK to perform and perform them once the SDK is initialised. +#### Event tracking -##### Event tracking +For the events you want to track, queue them with some internal queueing mechanism and track them after SDK is initialised. +Tracking events before initialising SDK will cause the events to be `dropped` and `permanently lost`, so make sure you are +tracking them once SDK is `initialised` and [`enabled`](#is-enabled). -For the events you wanted to track, queue them with some internal queueing mechanism and track them after SDK is -initialised. Tracking events before initialising SDK will cause the events to be `dropped` and `permanently lost`, so make -sure you are tracking them once SDK is `initialised` and [`enabled`](#is-enabled). +#### Offline mode and enable/disable tracking -##### Offline mode and enable/disable tracking - -Offline mode is not the feature which is persisted between SDK initialisations, so it is set to `false` by default. If you +Offline mode is not the feature which is persisted between SDK initialisations, so it is set to `false` by default. If you try to enable offline mode before initialising SDK, it will still be set to `false` when you eventually initialise the SDK. -Enabling/disabling tracking is the setting which is persisted between the SDK initialisations. If you try to toggle this -value before initialising the SDK, toggle attempt will be ignored. Once initialised, SDK will be in the state (enabled or +Enabling/disabling tracking is the setting which is persisted between the SDK initialisations. If you try to toggle this +value before initialising the SDK, toggle attempt will be ignored. Once initialised, SDK will be in the state (enabled or disabled) like before this toggle attempt. -##### Deeplink reattributions +#### Reattribution via deep links -Like described in [this paragraph](#deeplink-reattributions), when handling deeplink reattributions, in some way (deppending -on deeplinking mechanism you are using - old style vs. universal links) you will obtain `NSURL` object after which you need -to make following call: +As described [above](#deeplinking-reattribution), when handling deep link reattributions, depending on deep linking +mechanism you are using (old style vs. universal links), you will obtain `NSURL` object after which you need to make +following call: ```objc [Adjust appWillOpenUrl:url] ``` -If you make this call before SDK was initialised, information about deeplink information from the URL which your user -clicked and was supposed to be reattributed will be permanetly lost. If you want the adjust SDK to successfully reattribute -your user, you would need to queue this `NSURL` object information and trigger `appWillOpenUrl` method once the SDK is -initialised. - -##### Session tracking +If you make this call before the SDK has been initialised, information about the attribution information from the deep link +URL will be permanetly lost. If you want the adjust SDK to successfully reattribute your user, you would need to queue this +`NSURL` object information and trigger `appWillOpenUrl` method once the SDK has been initialised. -Session tracking is something what the adjust SDK performs automatically and is beyond reach of an app developer. For proper -session tracking it is crucial to have the adjust SDK initialised like advised in this README. Not doing this can have -unpredicted influence to proper session tracking and DAU numbers in the dashboard. Erroneous scenarios can be different and -here are some of them: +#### Session tracking -* User deleting your app before the SDK was even inialised, causing install and session never to be tracked, thus never -reported in the dashboard. -* If user downloads and opens your app before midnight and the adjust SDK gets initialised after midnight, causing install -and session to be reported on another day. +Session tracking is something what the adjust SDK performs automatically and is beyond reach of an app developer. For +proper session tracking it is crucial to have the adjust SDK initialised as advised in this README. Not doing so can have +unpredicted influences on proper session tracking and DAU numbers in the dashboard. +For example: +* A user opens but then deletes your app before the SDK was even inialised, causing the install and session to have never +been tracked, thus never reported in the dashboard. +* If a user downloads and opens your app before midnight, and the adjust SDK gets initialised after midnight, all queued +install and session data will be reported on wrong day. +* If a user didn't use your app on some day but opens it shortly after midnight and the SDK gets initialised after +midnight, causing DAU to be reported on another day from the day of the app opening. -For all these reasons, please follow the advices from this document and initialise the adjust SDK in the +For all these reasons, please follow the instructions in this document and initialise the adjust SDK in the `didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate. -#### I'm seeing "Adjust requires ARC" error +### I'm seeing "Adjust requires ARC" error -If your build failed with the error `Adjust requires ARC`, it looks like your project is not using [ARC][arc]. In that case -we recommend [transitioning your project to use ARC][transition]. If you don't want to use ARC, you have to enable ARC for -all source files of adjust in the target's Build Phases: +If your build failed with the error `Adjust requires ARC`, it looks like your project is not using [ARC][arc]. In that case +we recommend [transitioning your project][transition] so that it does use ARC. If you don't want to use ARC, you have to +enable ARC for all source files of adjust in the target's Build Phases: -Expand the `Compile Sources` group, select all adjust files and change the `Compiler Flags` to `-fobjc-arc` (Select all and +Expand the `Compile Sources` group, select all adjust files and change the `Compiler Flags` to `-fobjc-arc` (Select all and press the `Return` key to change all at once). -#### I'm seeing "[UIDevice adjTrackingEnabled]: unrecognized selector sent to instance" error +### I'm seeing "[UIDevice adjTrackingEnabled]: unrecognized selector sent to instance" error -This error can occur if you are adding the adjust SDK framework to your app. The adjust SDK contains `categories` among it's -source files and because of that, if you have chosen this SDK integration approach, you need to add `-ObjC` flag to `Other -Linker Flags` in your Xcode project settings. Adding this flag fill fix this error. +This error can occur when you are adding the adjust SDK framework to your app. The adjust SDK contains `categories` among +it's source files and for this reason, if you have chosen this SDK integration approach, you need to add `-ObjC` flags to +`Other Linker Flags` in your Xcode project settings. Adding this flag will fix this error. -#### I'm seeing the "Session failed (Ignoring too frequent session.)" error +### I'm seeing the "Session failed (Ignoring too frequent session.)" error -This error typically occurs when testing installs. Uninstalling and reinstalling the app is not enough to trigger a new -install. The servers will determine that the SDK has lost its locally aggregated session data and ignore the erroneous +This error typically occurs when testing installs. Uninstalling and reinstalling the app is not enough to trigger a new +install. The servers will determine that the SDK has lost its locally aggregated session data and ignore the erroneous message, given the information available on the servers about the device. -This behaviour can be cumbersome during tests, but is necessary in order to have the sandbox behaviour match production as +This behaviour can be cumbersome during tests, but is necessary in order to have the sandbox behaviour match production as much as possible. You can reset the session data of the device in our servers. Check the error message in the logs: @@ -797,7 +979,8 @@ You can reset the session data of the device in our servers. Check the error mes Session failed (Ignoring too frequent session. Last session: YYYY-MM-DDTHH:mm:ss, this session: YYYY-MM-DDTHH:mm:ss, interval: XXs, min interval: 20m) (app_token: {yourAppToken}, adid: {adidValue}) ``` -With the `{yourAppToken}` and `{adidValue}` or `{idfaValue}` values filled in below, open either of the the following links: +With the `{yourAppToken}` and either `{adidValue}` or `{idfaValue}` values filled in below, open one +of the following links: ``` http://app.adjust.com/forget_device?app_token={yourAppToken}&adid={adidValue} @@ -807,37 +990,37 @@ http://app.adjust.com/forget_device?app_token={yourAppToken}&adid={adidValue} http://app.adjust.com/forget_device?app_token={yourAppToken}&idfa={idfaValue} ``` -When the device is forgotten, the link just returns `Forgot device`. If the device was already forgotten or the values were +When the device is forgotten, the link just returns `Forgot device`. If the device was already forgotten or the values were incorrect, the link returns `Device not found`. -#### I'm not seeing "Install tracked" in the logs +### I'm not seeing "Install tracked" in the logs -If you want to simulate installation scenario of your app on your test device, it is not enough if you just re-run the app -from the Xcode on your test device which already has an app installed. Re-running the app from the Xcode doesn't cause app -data to be wiped out and all internal files our SDK is keeping inside your app will still be there, so upon re-run, our SDK -will see those files and think of your app as being already installed (and that SDK was already launched in it) but just -opened for another time rather than being opened for the first time. +If you want to simulate the installation scenario of your app on your test device, it is not enough if you just re-run the +app from the Xcode on your test device. Re-running the app from the Xcode doesn't cause app data to be wiped out and all +internal files that our SDK is keeping inside your app will still be there, so upon re-run, our SDK will see those files +and think of your app was already installed (and that SDK was already launched in it) but just opened for another time +rather than being opened for the first time. -In order to run app installation scenario, you need to do following: +In order to run app the installation scenario, you need to do following: * Uninstall app from your device (completely remove it) * Forget your test device from the adjust backend like explained in the issue [above](#forget-device) * Run your app from the Xcode on the test device and you will see log message "Install tracked" -#### I'm seeing "Unattributable SDK click ignored" message +### I'm seeing the "Unattributable SDK click ignored" message -You may notice this message while testing your app in `sandbox` envoronment. It is related to some changes Apple introduced -in `iAd.framework` version 3. User can be navigated to your app from a click on iAd banner and this will cause our SDK to -send `sdk_click` package to the adjust backend informing it about the content of the clicked URL. For some reason, Apple -decided that if app was opened without clicking on iAd banner, they will artificially generate iAd banner URL click with -some random values. Our SDK won't be able to distinguish if iAd banner click was genuine or artificially generated and will -send `sdk_click` package anyway to the adjust backend. If you have your log level set to `verbose` level, you will see this -`sdk_click` package looking something like this: +You may notice this message while testing your app in `sandbox` envoronment. It is related to some changes Apple introduced +in `iAd.framework` version 3. With this, a user can be directed to your app from a click on iAd banner and this will cause +our SDK to send an `sdk_click` package to the adjust backend informing it about the content of the clicked URL. For some +reason, Apple decided that if the app was opened without clicking on iAd banner, they will artificially generate an iAd +banner URL click with some random values. Our SDK won't be able to distinguish if the iAd banner click was genuine or +artificially generated and will send an `sdk_click` package regardless to the adjust backend. If you have your log level +set to `verbose` level, you will see this `sdk_click` package looking something like this: ``` [Adjust]d: Added package 1 (click) [Adjust]v: Path: /sdk_click -[Adjust]v: ClientSdk: ios4.8.5 +[Adjust]v: ClientSdk: ios4.9.0 [Adjust]v: Parameters: [Adjust]v: app_token {YourAppToken} [Adjust]v: created_at 2016-04-15T14:25:51.676Z+0200 @@ -849,44 +1032,43 @@ send `sdk_click` package anyway to the adjust backend. If you have your log leve [Adjust]v: source iad3 ``` -If for some reason this false `sdk_click` would be taken in consideration, event though a user may have opened your app -by clicking on some other campaign URL or even as an organic user, he will get attributed to this unexisting iAd source. - -This is the reason why our backend ignores it and informs you with this message: +If for some reason this `sdk_click` would be accepted, it would mean that a user who has opened your app by clicking on +some other campaign URL or even as an organic user, will get attributed to this unexisting iAd source. This is the reason +why our backend ignores it and informs you with this message: ``` [Adjust]v: Response: {"message":"Unattributable SDK click ignored."} [Adjust]i: Unattributable SDK click ignored. ``` -So, this message doesn't indicate any issue with your SDK integration but it's simply informing you that our backend ignored -artificially created `sdk_click` which could have lead to your user being wrongly attributed/reattributed. +So, this message doesn't indicate any issue with your SDK integration but it's simply informing you that our backend has +ignored this artificially created `sdk_click` which could have lead to your user being wrongly attributed/reattributed. -#### I'm seeing wrong revenue data in the adjust dashboard +### I'm seeing incorrect revenue data in the adjust dashboard -The adjust SDK tracks what you tell it to track. If you are attaching revenue to your event, number you write as an amount -is the only amount which will reach the adjust backend and be displayed in the dashboard. Our SDK does not manipulate your -amount value, nor does our backend. So, if you see wrong amount being tracked, it's because our SDK was told to track that -amount. +The adjust SDK tracks what you tell it to track. If you are attaching revenue to your event, the number you write as an +amount is the only amount which will reach the adjust backend and be displayed in the dashboard. Our SDK does not +manipulate your amount value, nor does our backend. So, if you see wrong amount being tracked, it's because our SDK was +told to track that amount. -Usually, user's code for tracking revenue event looks something like this: +Usually, a user's code for tracking revenue event looks something like this: ```objc // ... - (double)someLogicForGettingRevenueAmount { - // This method somehow handles how user determines + // This method somehow handles how user determines // what's the revenue value which should be tracked. - + // It is maybe making some calculations to determine it. - + // Or maybe extracting the info from In-App purchase which // was successfully finished. - + // Or maybe returns some predefined double value. - + double amount; // double amount = some double value - + return amount; } @@ -894,7 +1076,7 @@ Usually, user's code for tracking revenue event looks something like this: - (void)someRandomMethodInTheApp { double amount = [self someLogicForGettingRevenueAmount]; - + ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; [event setRevenue:amount currency:@"EUR"]; [Adjust trackEvent:event]; @@ -902,9 +1084,10 @@ Usually, user's code for tracking revenue event looks something like this: ``` -If you are seing any value in the dashboard other than what you expected to be tracked, **please, check your logic for +If you are seing any value in the dashboard other than what you expected to be tracked, **please, check your logic for determining amount value**. + [dashboard]: http://adjust.com [adjust.com]: http://adjust.com @@ -935,6 +1118,8 @@ determining amount value**. [reattribution-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link [ios-purchase-verification]: https://github.com/adjust/ios_purchase_sdk +[reattribution-with-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link + [run]: https://raw.github.com/adjust/sdks/master/Resources/ios/run5.png [add]: https://raw.github.com/adjust/sdks/master/Resources/ios/add5.png [drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag5.png @@ -942,9 +1127,12 @@ determining amount value**. [framework]: https://raw.github.com/adjust/sdks/master/Resources/ios/framework5.png [adc-ios-team-id]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-ios-team-id5.png +[custom-url-scheme]: https://raw.github.com/adjust/sdks/master/Resources/ios/custom-url-scheme.png [adc-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-associated-domains5.png [xcode-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/xcode-associated-domains5.png [universal-links-dashboard]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard5.png + +[associated-domains-applinks]: https://raw.github.com/adjust/sdks/master/Resources/ios/associated-domains-applinks.png [universal-links-dashboard-values]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard-values5.png ## License diff --git a/Scripts/adjust_build.sh b/Scripts/adjust_build.sh index 0d7b30cba..207786efa 100755 --- a/Scripts/adjust_build.sh +++ b/Scripts/adjust_build.sh @@ -9,19 +9,52 @@ cd .. # Clean the folders rm -rf Frameworks/Static rm -rf Frameworks/Dynamic +rm -rf Frameworks/tvOS # Create needed folders mkdir -p Frameworks/Static mkdir -p Frameworks/Dynamic +mkdir -p Frameworks/tvOS # Build static AdjustSdk.framework -xcodebuild -target AdjustStatic -configuration Release +xcodebuild -target AdjustStatic -configuration Release clean build # Build dynamic AdjustSdk.framework -xcodebuild -target AdjustSdk -configuration Release +xcodebuild -target AdjustSdk -configuration Release clean build + +# Build tvOS AdjustSdkTV.framework +# Build it for simulator and device +xcodebuild -configuration Release -target AdjustSdkTv -arch x86_64 -sdk appletvsimulator clean build +xcodebuild -configuration Release -target AdjustSdkTv -arch arm64 -sdk appletvos clean build + +# Copy tvOS framework to destination +cp -R build/Release-appletvos/AdjustSdkTv.framework Frameworks/tvOS + +# Create universal tvOS framework +lipo -create -output Frameworks/tvOS/AdjustSdkTv.framework/AdjustSdkTv build/Release-appletvos/AdjustSdkTv.framework/AdjustSdkTv build/Release-appletvsimulator/AdjustSdkTv.framework/AdjustSdkTv # Build Carthage AdjustSdk.framework carthage build --no-skip-current # Copy build Carthage framework to Frameworks folder cp -R Carthage/Build/iOS/* Frameworks/Dynamic/ + +# Copy static framework into example iOS app +rm -rf examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework +cp -R Frameworks/Static/AdjustSdk.framework examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/ + +# Copy static framework into example Swift app +rm -rf examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework +cp -R Frameworks/Static/AdjustSdk.framework examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/ + +# Copy static framework into example WebView app +rm -rf examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework +cp -R Frameworks/Static/AdjustSdk.framework examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/ + +# Copy static framework into example iWatch app +rm -rf examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework +cp -R Frameworks/Static/AdjustSdk.framework examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/ + +# Copy static framework into example tvOS app +rm -rf examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTv.framework +cp -R Frameworks/tvOS/AdjustSdkTv.framework examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/ diff --git a/VERSION b/VERSION index bb6ebd31d..6ed7776bf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.8.5 +4.9.0 diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj/project.pbxproj b/examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj/project.pbxproj index 1f474cfc7..4dab0284d 100644 --- a/examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj/project.pbxproj @@ -7,53 +7,18 @@ objects = { /* Begin PBXBuildFile section */ - 96164DAF1CCA4E73009431AB /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164DAA1CCA4E73009431AB /* ADJBackoffStrategy.m */; }; - 96164DB01CCA4E73009431AB /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164DAC1CCA4E73009431AB /* ADJSdkClickHandler.m */; }; - 96164DB11CCA4E73009431AB /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164DAE1CCA4E73009431AB /* ADJSystemProfile.m */; }; - 9DAA08BA1D2A837B001C04E4 /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA08B91D2A837B001C04E4 /* ADJTrackingPixel.m */; }; 9DF7A9C61CB4ECA600D3591F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9C51CB4ECA600D3591F /* AppDelegate.swift */; }; 9DF7A9C81CB4ECA600D3591F /* ViewControllerSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9C71CB4ECA600D3591F /* ViewControllerSwift.swift */; }; 9DF7A9CB1CB4ECA600D3591F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DF7A9C91CB4ECA600D3591F /* Main.storyboard */; }; 9DF7A9CD1CB4ECA600D3591F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9DF7A9CC1CB4ECA600D3591F /* Assets.xcassets */; }; 9DF7A9D01CB4ECA600D3591F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DF7A9CE1CB4ECA600D3591F /* LaunchScreen.storyboard */; }; - 9DF7AA191CB4F0DB00D3591F /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9E41CB4F0DB00D3591F /* ADJActivityHandler.m */; }; - 9DF7AA1A1CB4F0DB00D3591F /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9E61CB4F0DB00D3591F /* ADJActivityKind.m */; }; - 9DF7AA1B1CB4F0DB00D3591F /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9E81CB4F0DB00D3591F /* ADJActivityPackage.m */; }; - 9DF7AA1C1CB4F0DB00D3591F /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9EA1CB4F0DB00D3591F /* ADJActivityState.m */; }; - 9DF7AA1D1CB4F0DB00D3591F /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9ED1CB4F0DB00D3591F /* NSData+ADJAdditions.m */; }; - 9DF7AA1E1CB4F0DB00D3591F /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9EF1CB4F0DB00D3591F /* NSString+ADJAdditions.m */; }; - 9DF7AA1F1CB4F0DB00D3591F /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9F11CB4F0DB00D3591F /* UIDevice+ADJAdditions.m */; }; - 9DF7AA201CB4F0DB00D3591F /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9F31CB4F0DB00D3591F /* ADJAdjustFactory.m */; }; - 9DF7AA211CB4F0DB00D3591F /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9F51CB4F0DB00D3591F /* ADJAttribution.m */; }; - 9DF7AA221CB4F0DB00D3591F /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9F71CB4F0DB00D3591F /* ADJAttributionHandler.m */; }; - 9DF7AA231CB4F0DB00D3591F /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9F91CB4F0DB00D3591F /* ADJConfig.m */; }; - 9DF7AA241CB4F0DB00D3591F /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9FB1CB4F0DB00D3591F /* ADJDeviceInfo.m */; }; - 9DF7AA251CB4F0DB00D3591F /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9FD1CB4F0DB00D3591F /* ADJEvent.m */; }; - 9DF7AA261CB4F0DB00D3591F /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7A9FF1CB4F0DB00D3591F /* ADJEventFailure.m */; }; - 9DF7AA271CB4F0DB00D3591F /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA011CB4F0DB00D3591F /* ADJEventSuccess.m */; }; - 9DF7AA281CB4F0DB00D3591F /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA031CB4F0DB00D3591F /* ADJLogger.m */; }; - 9DF7AA291CB4F0DB00D3591F /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA051CB4F0DB00D3591F /* ADJPackageBuilder.m */; }; - 9DF7AA2A1CB4F0DB00D3591F /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA071CB4F0DB00D3591F /* ADJPackageHandler.m */; }; - 9DF7AA2B1CB4F0DB00D3591F /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA091CB4F0DB00D3591F /* ADJRequestHandler.m */; }; - 9DF7AA2C1CB4F0DB00D3591F /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA0B1CB4F0DB00D3591F /* ADJResponseData.m */; }; - 9DF7AA2D1CB4F0DB00D3591F /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA0D1CB4F0DB00D3591F /* ADJSessionFailure.m */; }; - 9DF7AA2E1CB4F0DB00D3591F /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA0F1CB4F0DB00D3591F /* ADJSessionSuccess.m */; }; - 9DF7AA2F1CB4F0DB00D3591F /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA111CB4F0DB00D3591F /* ADJTimerCycle.m */; }; - 9DF7AA301CB4F0DB00D3591F /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA131CB4F0DB00D3591F /* ADJTimerOnce.m */; }; - 9DF7AA311CB4F0DB00D3591F /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA151CB4F0DB00D3591F /* Adjust.m */; }; - 9DF7AA321CB4F0DB00D3591F /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA171CB4F0DB00D3591F /* ADJUtil.m */; }; - 9DF7AA331CB4F0DB00D3591F /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DF7AA181CB4F0DB00D3591F /* Info.plist */; }; + 9DFB04C21D745B22006D48FC /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04C11D745B22006D48FC /* iAd.framework */; }; + 9DFB04C41D745B28006D48FC /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04C31D745B28006D48FC /* AdSupport.framework */; }; + 9DFB04C61D745B2D006D48FC /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04C51D745B2D006D48FC /* SafariServices.framework */; }; + 9DFB04C81D745B33006D48FC /* AdjustSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04C71D745B33006D48FC /* AdjustSdk.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 96164DA91CCA4E73009431AB /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; - 96164DAA1CCA4E73009431AB /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; - 96164DAB1CCA4E73009431AB /* ADJSdkClickHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandler.h; sourceTree = ""; }; - 96164DAC1CCA4E73009431AB /* ADJSdkClickHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandler.m; sourceTree = ""; }; - 96164DAD1CCA4E73009431AB /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; - 96164DAE1CCA4E73009431AB /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; - 9DAA08B81D2A837B001C04E4 /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; - 9DAA08B91D2A837B001C04E4 /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; 9DF7A9C21CB4ECA600D3591F /* AdjustExample-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AdjustExample-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 9DF7A9C51CB4ECA600D3591F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 9DF7A9C71CB4ECA600D3591F /* ViewControllerSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerSwift.swift; sourceTree = ""; }; @@ -62,59 +27,10 @@ 9DF7A9CF1CB4ECA600D3591F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 9DF7A9D11CB4ECA600D3591F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9DF7A9DF1CB4F01B00D3591F /* AdjustExample-Swift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AdjustExample-Swift-Bridging-Header.h"; sourceTree = ""; }; - 9DF7A9E31CB4F0DB00D3591F /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; - 9DF7A9E41CB4F0DB00D3591F /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; - 9DF7A9E51CB4F0DB00D3591F /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; - 9DF7A9E61CB4F0DB00D3591F /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; - 9DF7A9E71CB4F0DB00D3591F /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; - 9DF7A9E81CB4F0DB00D3591F /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; - 9DF7A9E91CB4F0DB00D3591F /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; - 9DF7A9EA1CB4F0DB00D3591F /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; - 9DF7A9EC1CB4F0DB00D3591F /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; - 9DF7A9ED1CB4F0DB00D3591F /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; - 9DF7A9EE1CB4F0DB00D3591F /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; - 9DF7A9EF1CB4F0DB00D3591F /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; - 9DF7A9F01CB4F0DB00D3591F /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; - 9DF7A9F11CB4F0DB00D3591F /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; - 9DF7A9F21CB4F0DB00D3591F /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; - 9DF7A9F31CB4F0DB00D3591F /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; - 9DF7A9F41CB4F0DB00D3591F /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; - 9DF7A9F51CB4F0DB00D3591F /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; - 9DF7A9F61CB4F0DB00D3591F /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; - 9DF7A9F71CB4F0DB00D3591F /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; - 9DF7A9F81CB4F0DB00D3591F /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; - 9DF7A9F91CB4F0DB00D3591F /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; - 9DF7A9FA1CB4F0DB00D3591F /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; - 9DF7A9FB1CB4F0DB00D3591F /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; - 9DF7A9FC1CB4F0DB00D3591F /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; - 9DF7A9FD1CB4F0DB00D3591F /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; - 9DF7A9FE1CB4F0DB00D3591F /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; - 9DF7A9FF1CB4F0DB00D3591F /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; - 9DF7AA001CB4F0DB00D3591F /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; - 9DF7AA011CB4F0DB00D3591F /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; - 9DF7AA021CB4F0DB00D3591F /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; - 9DF7AA031CB4F0DB00D3591F /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; - 9DF7AA041CB4F0DB00D3591F /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; - 9DF7AA051CB4F0DB00D3591F /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; - 9DF7AA061CB4F0DB00D3591F /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; - 9DF7AA071CB4F0DB00D3591F /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; - 9DF7AA081CB4F0DB00D3591F /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; - 9DF7AA091CB4F0DB00D3591F /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; - 9DF7AA0A1CB4F0DB00D3591F /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; - 9DF7AA0B1CB4F0DB00D3591F /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; - 9DF7AA0C1CB4F0DB00D3591F /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; - 9DF7AA0D1CB4F0DB00D3591F /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; - 9DF7AA0E1CB4F0DB00D3591F /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; - 9DF7AA0F1CB4F0DB00D3591F /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; - 9DF7AA101CB4F0DB00D3591F /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; - 9DF7AA111CB4F0DB00D3591F /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; - 9DF7AA121CB4F0DB00D3591F /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; - 9DF7AA131CB4F0DB00D3591F /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; - 9DF7AA141CB4F0DB00D3591F /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; - 9DF7AA151CB4F0DB00D3591F /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; - 9DF7AA161CB4F0DB00D3591F /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; - 9DF7AA171CB4F0DB00D3591F /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; - 9DF7AA181CB4F0DB00D3591F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9DFB04C11D745B22006D48FC /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; + 9DFB04C31D745B28006D48FC /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; + 9DFB04C51D745B2D006D48FC /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; }; + 9DFB04C71D745B33006D48FC /* AdjustSdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdjustSdk.framework; path = Adjust/AdjustSdk.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -122,6 +38,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9DFB04C21D745B22006D48FC /* iAd.framework in Frameworks */, + 9DFB04C81D745B33006D48FC /* AdjustSdk.framework in Frameworks */, + 9DFB04C41D745B28006D48FC /* AdSupport.framework in Frameworks */, + 9DFB04C61D745B2D006D48FC /* SafariServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -154,86 +74,20 @@ 9DF7A9CE1CB4ECA600D3591F /* LaunchScreen.storyboard */, 9DF7A9D11CB4ECA600D3591F /* Info.plist */, 9DF7A9DF1CB4F01B00D3591F /* AdjustExample-Swift-Bridging-Header.h */, - 9DF7A9E21CB4F0DB00D3591F /* Adjust */, + 9DFB04C01D745B13006D48FC /* Frameworks */, ); path = "AdjustExample-Swift"; sourceTree = ""; }; - 9DF7A9E21CB4F0DB00D3591F /* Adjust */ = { + 9DFB04C01D745B13006D48FC /* Frameworks */ = { isa = PBXGroup; children = ( - 9DAA08B81D2A837B001C04E4 /* ADJTrackingPixel.h */, - 9DAA08B91D2A837B001C04E4 /* ADJTrackingPixel.m */, - 96164DA91CCA4E73009431AB /* ADJBackoffStrategy.h */, - 96164DAA1CCA4E73009431AB /* ADJBackoffStrategy.m */, - 96164DAB1CCA4E73009431AB /* ADJSdkClickHandler.h */, - 96164DAC1CCA4E73009431AB /* ADJSdkClickHandler.m */, - 96164DAD1CCA4E73009431AB /* ADJSystemProfile.h */, - 96164DAE1CCA4E73009431AB /* ADJSystemProfile.m */, - 9DF7A9E31CB4F0DB00D3591F /* ADJActivityHandler.h */, - 9DF7A9E41CB4F0DB00D3591F /* ADJActivityHandler.m */, - 9DF7A9E51CB4F0DB00D3591F /* ADJActivityKind.h */, - 9DF7A9E61CB4F0DB00D3591F /* ADJActivityKind.m */, - 9DF7A9E71CB4F0DB00D3591F /* ADJActivityPackage.h */, - 9DF7A9E81CB4F0DB00D3591F /* ADJActivityPackage.m */, - 9DF7A9E91CB4F0DB00D3591F /* ADJActivityState.h */, - 9DF7A9EA1CB4F0DB00D3591F /* ADJActivityState.m */, - 9DF7A9EB1CB4F0DB00D3591F /* ADJAdditions */, - 9DF7A9F21CB4F0DB00D3591F /* ADJAdjustFactory.h */, - 9DF7A9F31CB4F0DB00D3591F /* ADJAdjustFactory.m */, - 9DF7A9F41CB4F0DB00D3591F /* ADJAttribution.h */, - 9DF7A9F51CB4F0DB00D3591F /* ADJAttribution.m */, - 9DF7A9F61CB4F0DB00D3591F /* ADJAttributionHandler.h */, - 9DF7A9F71CB4F0DB00D3591F /* ADJAttributionHandler.m */, - 9DF7A9F81CB4F0DB00D3591F /* ADJConfig.h */, - 9DF7A9F91CB4F0DB00D3591F /* ADJConfig.m */, - 9DF7A9FA1CB4F0DB00D3591F /* ADJDeviceInfo.h */, - 9DF7A9FB1CB4F0DB00D3591F /* ADJDeviceInfo.m */, - 9DF7A9FC1CB4F0DB00D3591F /* ADJEvent.h */, - 9DF7A9FD1CB4F0DB00D3591F /* ADJEvent.m */, - 9DF7A9FE1CB4F0DB00D3591F /* ADJEventFailure.h */, - 9DF7A9FF1CB4F0DB00D3591F /* ADJEventFailure.m */, - 9DF7AA001CB4F0DB00D3591F /* ADJEventSuccess.h */, - 9DF7AA011CB4F0DB00D3591F /* ADJEventSuccess.m */, - 9DF7AA021CB4F0DB00D3591F /* ADJLogger.h */, - 9DF7AA031CB4F0DB00D3591F /* ADJLogger.m */, - 9DF7AA041CB4F0DB00D3591F /* ADJPackageBuilder.h */, - 9DF7AA051CB4F0DB00D3591F /* ADJPackageBuilder.m */, - 9DF7AA061CB4F0DB00D3591F /* ADJPackageHandler.h */, - 9DF7AA071CB4F0DB00D3591F /* ADJPackageHandler.m */, - 9DF7AA081CB4F0DB00D3591F /* ADJRequestHandler.h */, - 9DF7AA091CB4F0DB00D3591F /* ADJRequestHandler.m */, - 9DF7AA0A1CB4F0DB00D3591F /* ADJResponseData.h */, - 9DF7AA0B1CB4F0DB00D3591F /* ADJResponseData.m */, - 9DF7AA0C1CB4F0DB00D3591F /* ADJSessionFailure.h */, - 9DF7AA0D1CB4F0DB00D3591F /* ADJSessionFailure.m */, - 9DF7AA0E1CB4F0DB00D3591F /* ADJSessionSuccess.h */, - 9DF7AA0F1CB4F0DB00D3591F /* ADJSessionSuccess.m */, - 9DF7AA101CB4F0DB00D3591F /* ADJTimerCycle.h */, - 9DF7AA111CB4F0DB00D3591F /* ADJTimerCycle.m */, - 9DF7AA121CB4F0DB00D3591F /* ADJTimerOnce.h */, - 9DF7AA131CB4F0DB00D3591F /* ADJTimerOnce.m */, - 9DF7AA141CB4F0DB00D3591F /* Adjust.h */, - 9DF7AA151CB4F0DB00D3591F /* Adjust.m */, - 9DF7AA161CB4F0DB00D3591F /* ADJUtil.h */, - 9DF7AA171CB4F0DB00D3591F /* ADJUtil.m */, - 9DF7AA181CB4F0DB00D3591F /* Info.plist */, + 9DFB04C11D745B22006D48FC /* iAd.framework */, + 9DFB04C71D745B33006D48FC /* AdjustSdk.framework */, + 9DFB04C31D745B28006D48FC /* AdSupport.framework */, + 9DFB04C51D745B2D006D48FC /* SafariServices.framework */, ); - name = Adjust; - path = ../../../Adjust; - sourceTree = ""; - }; - 9DF7A9EB1CB4F0DB00D3591F /* ADJAdditions */ = { - isa = PBXGroup; - children = ( - 9DF7A9EC1CB4F0DB00D3591F /* NSData+ADJAdditions.h */, - 9DF7A9ED1CB4F0DB00D3591F /* NSData+ADJAdditions.m */, - 9DF7A9EE1CB4F0DB00D3591F /* NSString+ADJAdditions.h */, - 9DF7A9EF1CB4F0DB00D3591F /* NSString+ADJAdditions.m */, - 9DF7A9F01CB4F0DB00D3591F /* UIDevice+ADJAdditions.h */, - 9DF7A9F11CB4F0DB00D3591F /* UIDevice+ADJAdditions.m */, - ); - path = ADJAdditions; + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ @@ -268,6 +122,7 @@ TargetAttributes = { 9DF7A9C11CB4ECA600D3591F = { CreatedOnToolsVersion = 7.3; + LastSwiftMigration = 0800; }; }; }; @@ -294,7 +149,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9DF7AA331CB4F0DB00D3591F /* Info.plist in Resources */, 9DF7A9D01CB4ECA600D3591F /* LaunchScreen.storyboard in Resources */, 9DF7A9CD1CB4ECA600D3591F /* Assets.xcassets in Resources */, 9DF7A9CB1CB4ECA600D3591F /* Main.storyboard in Resources */, @@ -308,38 +162,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9DF7AA1C1CB4F0DB00D3591F /* ADJActivityState.m in Sources */, - 9DF7AA191CB4F0DB00D3591F /* ADJActivityHandler.m in Sources */, - 9DF7AA2E1CB4F0DB00D3591F /* ADJSessionSuccess.m in Sources */, 9DF7A9C81CB4ECA600D3591F /* ViewControllerSwift.swift in Sources */, - 9DF7AA291CB4F0DB00D3591F /* ADJPackageBuilder.m in Sources */, - 96164DB11CCA4E73009431AB /* ADJSystemProfile.m in Sources */, - 9DF7AA211CB4F0DB00D3591F /* ADJAttribution.m in Sources */, - 9DF7AA251CB4F0DB00D3591F /* ADJEvent.m in Sources */, - 9DF7AA311CB4F0DB00D3591F /* Adjust.m in Sources */, - 9DF7AA2C1CB4F0DB00D3591F /* ADJResponseData.m in Sources */, - 9DF7AA321CB4F0DB00D3591F /* ADJUtil.m in Sources */, - 9DF7AA261CB4F0DB00D3591F /* ADJEventFailure.m in Sources */, - 9DF7AA221CB4F0DB00D3591F /* ADJAttributionHandler.m in Sources */, - 96164DB01CCA4E73009431AB /* ADJSdkClickHandler.m in Sources */, - 9DF7AA301CB4F0DB00D3591F /* ADJTimerOnce.m in Sources */, - 96164DAF1CCA4E73009431AB /* ADJBackoffStrategy.m in Sources */, - 9DF7AA241CB4F0DB00D3591F /* ADJDeviceInfo.m in Sources */, - 9DAA08BA1D2A837B001C04E4 /* ADJTrackingPixel.m in Sources */, - 9DF7AA1F1CB4F0DB00D3591F /* UIDevice+ADJAdditions.m in Sources */, - 9DF7AA281CB4F0DB00D3591F /* ADJLogger.m in Sources */, - 9DF7AA2A1CB4F0DB00D3591F /* ADJPackageHandler.m in Sources */, - 9DF7AA2D1CB4F0DB00D3591F /* ADJSessionFailure.m in Sources */, - 9DF7AA1E1CB4F0DB00D3591F /* NSString+ADJAdditions.m in Sources */, - 9DF7AA201CB4F0DB00D3591F /* ADJAdjustFactory.m in Sources */, - 9DF7AA1B1CB4F0DB00D3591F /* ADJActivityPackage.m in Sources */, - 9DF7AA1A1CB4F0DB00D3591F /* ADJActivityKind.m in Sources */, - 9DF7AA2B1CB4F0DB00D3591F /* ADJRequestHandler.m in Sources */, - 9DF7AA1D1CB4F0DB00D3591F /* NSData+ADJAdditions.m in Sources */, 9DF7A9C61CB4ECA600D3591F /* AppDelegate.swift in Sources */, - 9DF7AA231CB4F0DB00D3591F /* ADJConfig.m in Sources */, - 9DF7AA271CB4F0DB00D3591F /* ADJEventSuccess.m in Sources */, - 9DF7AA2F1CB4F0DB00D3591F /* ADJTimerCycle.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -402,7 +226,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -441,7 +265,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -453,12 +277,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-Swift/Adjust", + ); INFOPLIST_FILE = "AdjustExample-Swift/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-Swift"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "AdjustExample-Swift/AdjustExample-Swift-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -467,11 +298,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-Swift/Adjust", + ); INFOPLIST_FILE = "AdjustExample-Swift/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-Swift"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "AdjustExample-Swift/AdjustExample-Swift-Bridging-Header.h"; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/AdjustSdk b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/AdjustSdk new file mode 120000 index 000000000..010b1f0e7 --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/AdjustSdk @@ -0,0 +1 @@ +Versions/Current/AdjustSdk \ No newline at end of file diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Headers b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Headers new file mode 120000 index 000000000..a177d2a6b --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk new file mode 100644 index 000000000..888a3875b Binary files /dev/null and b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk differ diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h new file mode 100644 index 000000000..21faee13e --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h @@ -0,0 +1,43 @@ +// +// ADJAttribution.h +// adjust +// +// Created by Pedro Filipe on 29/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJAttribution : NSObject + +// the following attributes are only set when error is nil +// (when activity was tracked successfully and response could be parsed) + +// tracker token of current device +@property (nonatomic, copy) NSString *trackerToken; + +// tracker name of current device +@property (nonatomic, copy) NSString *trackerName; + +// tracker network +@property (nonatomic, copy) NSString *network; + +// tracker campaign +@property (nonatomic, copy) NSString *campaign; + +// tracker adgroup +@property (nonatomic, copy) NSString *adgroup; + +// tracker creative +@property (nonatomic, copy) NSString *creative; + +// tracker click_label +@property (nonatomic, copy) NSString *clickLabel; + +- (BOOL)isEqualToAttribution:(ADJAttribution *)attribution; + ++ (ADJAttribution *)dataWithJsonDict:(NSDictionary *)jsonDict; +- (id)initWithJsonDict:(NSDictionary *)jsonDict; +- (NSDictionary *)dictionary; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h new file mode 100644 index 000000000..1774c80c7 --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h @@ -0,0 +1,177 @@ +// +// ADJConfig.h +// adjust +// +// Created by Pedro Filipe on 30/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import +#import "ADJLogger.h" +#import "ADJAttribution.h" +#import "ADJSessionSuccess.h" +#import "ADJSessionFailure.h" +#import "ADJEventSuccess.h" +#import "ADJEventFailure.h" + +/** + * Optional delegate that will get informed about tracking results + */ +@protocol AdjustDelegate +@optional + +/** + * Optional delegate method that gets called when the attribution information changed + * + * @param attribution The attribution information. + * See ADJAttribution for details + */ +- (void)adjustAttributionChanged:(ADJAttribution *)attribution; + +/** + * Optional delegate method that gets called when an event is tracked with success + * + * @param eventSuccessResponseData The response information from tracking with success + * See ADJEventSuccess for details + */ +- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData; + +/** + * Optional delegate method that gets called when an event is tracked with failure + * + * @param eventFailureResponseData The response information from tracking with failure + * See ADJEventFailure for details + */ +- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with success + * + * @param sessionSuccessResponseData The response information from tracking with success + * See ADJSessionSuccess for details + */ +- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with failure + * + * @param sessionFailureResponseData The response information from tracking with failure + * See ADJSessionFailure for details + */ +- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData; + +/** + * Optional delegate method that gets called when a deeplink is about to be opened by the adjust SDK + * + * @param deeplink The deeplink url that was received by the adjust SDK to be opened + * @return boolean Value that indicates whether the deeplink should be opened by the adjust SDK + */ +- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink; + +@end + +@interface ADJConfig : NSObject + +@property (nonatomic, copy) NSString *sdkPrefix; +@property (nonatomic, copy) NSString *defaultTracker; +@property (nonatomic, copy, readonly) NSString *appToken; +@property (nonatomic, copy, readonly) NSString *environment; + +/** + * Configuration object for the initialization of the Adjust SDK + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment; + +/** + * Configuration object for the initialization of the Adjust SDK. + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + * @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress + * and replaces the default value for production environment + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; + +/** + * Change the verbosity of Adjust's logs + * + * You can increase or reduce the amount of logs from Adjust by passing + * one of the following parameters. Use ADJLogLevelSuppress to disable all logging + * + * @var logLevel The desired minimum log level (default: info) + * Must be one of the following: + * - ADJLogLevelVerbose (enable all logging) + * - ADJLogLevelDebug (enable more logging) + * - ADJLogLevelInfo (the default) + * - ADJLogLevelWarn (disable info logging) + * - ADJLogLevelError (disable warnings as well) + * - ADJLogLevelAssert (disable errors as well) + * - ADJLogLevelSuppress (suppress all logging) + */ +@property (nonatomic, assign) ADJLogLevel logLevel; + +/** + * Enable event buffering if your app triggers a lot of events. + * When enabled, events get buffered and only get tracked each + * minute. Buffered events are still persisted, of course + * + * @var eventBufferingEnabled Enable or disable event buffering + */ +@property (nonatomic, assign) BOOL eventBufferingEnabled; + +/** + * Set the optional delegate that will inform you about attribution or events + * + * See the AdjustDelegate declaration above for details + * + * @var delegate The delegate that might implement the optional delegate methods + */ +@property (nonatomic, weak) NSObject *delegate; + +/** + * Enables sending in the background + * + * @var sendInBackground Enable or disable sending in the background + */ +@property (nonatomic, assign) BOOL sendInBackground; + +/** + * Enables delayed start of the SDK + * + * @var delayStart Number of seconds after which SDK will start + */ +@property (nonatomic, assign) double delayStart; + +/** + * User agent for the requests. + * + * @var userAgent User agent value. + */ +@property (nonatomic, copy) NSString *userAgent; + +@property (nonatomic, assign, readonly) BOOL hasResponseDelegate; +@property (nonatomic, assign, readonly) BOOL hasAttributionChangedDelegate; + +- (BOOL) isValid; +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h new file mode 100644 index 000000000..7fcb8881d --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h @@ -0,0 +1,89 @@ +// +// ADJEvent.h +// adjust +// +// Created by Pedro Filipe on 15/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEvent : NSObject + +@property (nonatomic, copy, readonly) NSString* eventToken; +@property (nonatomic, copy, readonly) NSNumber* revenue; +@property (nonatomic, readonly) NSDictionary* callbackParameters; +@property (nonatomic, readonly) NSDictionary* partnerParameters; +@property (nonatomic, copy, readonly) NSString* transactionId; +@property (nonatomic, copy, readonly) NSString* currency; +@property (nonatomic, copy, readonly) NSData* receipt; +@property (nonatomic, assign, readonly) BOOL emptyReceipt; + +/** + * Create Event object with Event Token. + * + * @param eventToken Event token that is created in the dashboard + * at http://adjust.com and should be six characters long. + */ ++ (ADJEvent *)eventWithEventToken:(NSString *)eventToken; +- (id) initWithEventToken:(NSString *)eventToken; + +/** + * Add a key-pair to a callback URL. + * + * In your dashboard at http://adjust.com you can assign a callback URL to each + * event type. That URL will get called every time the event is triggered. On + * top of that you can add callback parameters to the following method that + * will be forwarded to these callbacks. + * + * @param key String key in the callback URL. + * @param value String value of the key in the Callback URL. + * + */ +- (void) addCallbackParameter:(NSString *)key + value:(NSString *)value; + +/** + * Add a key-pair to be fowarded to a partner. + * + * @param key String key to be fowarded to the partner + * @param value String value of the key to be fowarded to the partner + * + */ +- (void) addPartnerParameter:(NSString *)key + value:(NSString *)value; + +/** + * Set the revenue and associated currency of the event. + * + * The event can contain some revenue. The amount revenue is measured in units. + * It must include a currency in the ISO 4217 format. + * + * @param amount The amount in units (example: for 1.50 EUR is 1.5) + * @param currency String of the currency with ISO 4217 format. + * It should be 3 characters long (example: for 1.50 EUR is @"EUR") + */ +- (void) setRevenue:(double)amount currency:(NSString *)currency; + +/** + * Set the transaction ID of a In-App Purchases to avoid revenue duplications. + * + * A transaction ID can be used to avoid duplicate revenue events. The last ten + * transaction identifiers are remembered. + * + * @param transactionId The identifier used to avoid duplicate revenue events + */ +- (void) setTransactionId:(NSString *)transactionId; + +- (BOOL) isValid; + +/** + * + * Validate a in-app-purchase receipt. + * + * @param receipt The receipt to validate + * @param transactionId The identifier used to validate the receipt and to avoid duplicate revenue events + */ +- (void) setReceipt:(NSData *)receipt transactionId:(NSString *)transactionId; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h new file mode 100644 index 000000000..46ef36d16 --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h @@ -0,0 +1,34 @@ +// +// ADJEventFailure.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventFailure *)eventFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h new file mode 100644 index 000000000..ce2abb1bd --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h @@ -0,0 +1,31 @@ +// +// ADJEventSuccess.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventSuccess *)eventSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h new file mode 100644 index 000000000..89f02f159 --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h @@ -0,0 +1,39 @@ +// +// ADJLogger.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-11-15. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// +#import + +typedef enum { + ADJLogLevelVerbose = 1, + ADJLogLevelDebug = 2, + ADJLogLevelInfo = 3, + ADJLogLevelWarn = 4, + ADJLogLevelError = 5, + ADJLogLevelAssert = 6, + ADJLogLevelSuppress = 7 +} ADJLogLevel; + +// A simple logger with multiple log levels. +@protocol ADJLogger + +- (void)setLogLevel:(ADJLogLevel)logLevel; +- (void)lockLogLevel; + +- (void)verbose:(NSString *)message, ...; +- (void)debug: (NSString *)message, ...; +- (void)info: (NSString *)message, ...; +- (void)warn: (NSString *)message, ...; +- (void)error: (NSString *)message, ...; +- (void)assert: (NSString *)message, ...; + +@end + +@interface ADJLogger : NSObject + ++ (ADJLogLevel) LogLevelFromString: (NSString *) logLevelString; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h new file mode 100644 index 000000000..25681f03b --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h @@ -0,0 +1,31 @@ +// +// ADJFailureResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionFailure *)sessionFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h new file mode 100644 index 000000000..5533928bc --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h @@ -0,0 +1,28 @@ +// +// ADJSuccessResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionSuccess *)sessionSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h new file mode 100644 index 000000000..337479af3 --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h @@ -0,0 +1,201 @@ +// +// Adjust.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-07-23. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// + +#import "ADJEvent.h" +#import "ADJAttribution.h" +#import "ADJConfig.h" + +/** + * Constants for our supported tracking environments + */ +extern NSString * const ADJEnvironmentSandbox; +extern NSString * const ADJEnvironmentProduction; + +/** + * The main interface to Adjust + * + * Use the methods of this class to tell Adjust about the usage of your app. + * See the README for details. + */ +@interface Adjust : NSObject + +/** + * Tell Adjust that the application did launch + * + * This is required to initialize Adjust. Call this in the didFinishLaunching + * method of your AppDelegate. + * + * See ADJConfig.h for more configuration options + * + * @param adjustConfig The configuration object that includes the environment + * and the App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long. + */ ++ (void)appDidLaunch:(ADJConfig *)adjustConfig; + +/** + * Tell Adjust that a particular event has happened + * + * See ADJEvent.h for more event options. + * + * @param event The Event object for this kind of event. It needs a event token + * that is created in the dashboard at http://adjust.com and should be six + * characters long. + */ ++ (void)trackEvent:(ADJEvent *)event; + +/** + * Tell adjust that the application resumed + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionStart; + +/** + * Tell adjust that the application paused + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionEnd; + +/** + * Enable or disable the adjust SDK. This setting is saved for future sessions + * + * @param enabled The flag to enable or disable the adjust SDK + */ ++ (void)setEnabled:(BOOL)enabled; + +/** + * Check if the SDK is enabled or disabled + * + * return Boolean indicating whether SDK is enabled or not + */ ++ (BOOL)isEnabled; + +/** + * Read the URL that opened the application to search for an adjust deep link + * + * @param url URL object which contains info about adjust deep link + */ ++ (void)appWillOpenUrl:(NSURL *)url; + +/** + * Set the device token used by push notifications + * + * @param deviceToken Apple push notification token for iOS device + */ ++ (void)setDeviceToken:(NSData *)deviceToken; + +/** + * Enable or disable offline mode. Activities won't be sent but they are saved when + * offline mode is disabled. This feature is not saved for future sessions + * + * @param enabled The flag to enable or disable offline mode + */ ++ (void)setOfflineMode:(BOOL)enabled; + +/** + * Convert a universal link style url to a deeplink style url with the corresponding scheme + * + * @param url URL object which contains info about adjust deep link + * @param scheme Desired scheme to which you want your resulting URL object to be prefixed with + * + * @return URL object in custom URL scheme style prefixed with given scheme name + */ ++ (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +/** + * Retrieve iOS device IDFA value + * + * @return Device IDFA value + */ ++ (NSString *)idfa; + +/** + * Tell the adjust SDK to stop waiting for delayed initialisation timer to complete but rather to start + * upon this call. This should be called if you have obtained needed callback/partner parameters which you + * wanted to put as default ones before the delayedStart value you have set on ADJConfig has expired + */ ++ (void)sendFirstPackages; + +/** + * Tell adjust to send the request to Google and check if the installation + * belongs to Google AdWords campaign + */ ++ (void)sendAdWordsRequest; + +/** + * Add default callback parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default callback parameter key + * @param value Default callback parameter value + */ ++ (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +/** + * Add default partner parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default partner parameter key + * @param value Default partner parameter value + */ ++ (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; + +/** + * Remove default callback parameter from the session packages + * + * @param key Default callback parameter key + */ ++ (void)removeSessionCallbackParameter:(NSString *)key; + +/** + * Remove default partner parameter from the session packages + * + * @param key Default partner parameter key + */ ++ (void)removeSessionPartnerParameter:(NSString *)key; + +/** + * Remove all default callback parameters from the session packages + */ ++ (void)resetSessionCallbackParameters; + +/** + * Remove all default partner parameters from the session packages + */ ++ (void)resetSessionPartnerParameters; + +/** + * Obtain singleton Adjust object + */ ++ (id)getInstance; + +- (void)appDidLaunch:(ADJConfig *)adjustConfig; +- (void)trackEvent:(ADJEvent *)event; +- (void)setEnabled:(BOOL)enabled; +- (void)teardown:(BOOL)deleteState; +- (void)appWillOpenUrl:(NSURL *)url; +- (void)setOfflineMode:(BOOL)enabled; +- (void)setDeviceToken:(NSData *)deviceToken; + +- (BOOL)isEnabled; +- (NSString *)idfa; +- (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +- (void)sendFirstPackages; +- (void)sendAdWordsRequest; +- (void)trackSubsessionEnd; +- (void)trackSubsessionStart; +- (void)resetSessionPartnerParameters; +- (void)resetSessionCallbackParameters; +- (void)removeSessionPartnerParameter:(NSString *)key; +- (void)removeSessionCallbackParameter:(NSString *)key; +- (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; +- (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +@end diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/Current b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/Current new file mode 120000 index 000000000..8c7e5a667 --- /dev/null +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/Adjust/AdjustSdk.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/AdjustExample-Swift-Bridging-Header.h b/examples/AdjustExample-Swift/AdjustExample-Swift/AdjustExample-Swift-Bridging-Header.h index 26f47be09..fa3e7c4fb 100644 --- a/examples/AdjustExample-Swift/AdjustExample-Swift/AdjustExample-Swift-Bridging-Header.h +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/AdjustExample-Swift-Bridging-Header.h @@ -2,4 +2,4 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "Adjust.h" \ No newline at end of file +#import \ No newline at end of file diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/AppDelegate.swift b/examples/AdjustExample-Swift/AdjustExample-Swift/AppDelegate.swift index 679ed7c39..49f0162b0 100644 --- a/examples/AdjustExample-Swift/AdjustExample-Swift/AppDelegate.swift +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/AppDelegate.swift @@ -12,17 +12,14 @@ import UIKit class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Check AdWords Search and Mobile Web. - // Adjust.sendAdWordsRequest() - + func application(_application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let appToken = "{YourAppToken}" let environment = ADJEnvironmentSandbox let adjustConfig = ADJConfig(appToken: appToken, environment: environment) - // Change the log level. - adjustConfig.logLevel = ADJLogLevelVerbose + // change the log level + adjustConfig?.logLevel = ADJLogLevelVerbose // Enable event buffering. // adjustConfig.eventBufferingEnabled = true @@ -33,8 +30,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate { // Send in the background. // adjustConfig.sendInBackground = true - // Set an attribution delegate. - adjustConfig.delegate = self + // set an attribution delegate + adjustConfig?.delegate = self // Initialise the SDK. Adjust.appDidLaunch(adjustConfig) @@ -48,49 +45,49 @@ class AppDelegate: UIResponder, UIApplicationDelegate, AdjustDelegate { return true } - func adjustAttributionChanged(attribution: ADJAttribution) { - NSLog("adjust attribution %@", attribution) + func adjustAttributionChanged(_attribution: ADJAttribution) { + NSLog("adjust attribution %@", _attribution) } - func adjustEventTrackingSucceeded(eventSuccessResponseData: ADJEventSuccess) { - NSLog("adjust event success %@", eventSuccessResponseData) + func adjustEventTrackingSucceeded(_eventSuccessResponseData: ADJEventSuccess) { + NSLog("adjust event success %@", _eventSuccessResponseData) } - func adjustEventTrackingFailed(eventFailureResponseData: ADJEventFailure) { - NSLog("adjust event failure %@", eventFailureResponseData) + func adjustEventTrackingFailed(_eventFailureResponseData: ADJEventFailure) { + NSLog("adjust event failure %@", _eventFailureResponseData) } - func adjustSessionTrackingSucceeded(sessionSuccessResponseData: ADJSessionSuccess) { - NSLog("adjust session success %@", sessionSuccessResponseData) + func adjustSessionTrackingSucceeded(_sessionSuccessResponseData: ADJSessionSuccess) { + NSLog("adjust session success %@", _sessionSuccessResponseData) } - func adjustSessionTrackingFailed(sessionFailureResponseData: ADJSessionFailure) { - NSLog("adjust session failure %@", sessionFailureResponseData) + func adjustSessionTrackingFailed(_sessionFailureResponseData: ADJSessionFailure) { + NSLog("adjust session failure %@", _sessionFailureResponseData) } - func adjustDeeplinkResponse(deeplink: NSURL!) -> Bool { + @objc func adjustDeeplinkResponse(_deeplink: NSURL!) -> Bool { return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } } diff --git a/examples/AdjustExample-Swift/AdjustExample-Swift/ViewControllerSwift.swift b/examples/AdjustExample-Swift/AdjustExample-Swift/ViewControllerSwift.swift index 9f7214009..eefb5d6b9 100644 --- a/examples/AdjustExample-Swift/AdjustExample-Swift/ViewControllerSwift.swift +++ b/examples/AdjustExample-Swift/AdjustExample-Swift/ViewControllerSwift.swift @@ -27,68 +27,72 @@ class ViewControllerSwift: UIViewController { super.didReceiveMemoryWarning() } - @IBAction func btnTrackEventSimpleTapped(sender: UIButton) { + @IBAction func btnTrackEventSimpleTapped(_sender: UIButton) { let event = ADJEvent(eventToken: "{YourEventToken}"); Adjust.trackEvent(event); } - @IBAction func btnTrackEventRevenueTapped(sender: UIButton) { + @IBAction func btnTrackEventRevenueTapped(_sender: UIButton) { let event = ADJEvent(eventToken: "{YourEventToken}"); - event.setRevenue(0.99, currency: "EUR"); + event?.setRevenue(0.99, currency: "EUR"); Adjust.trackEvent(event); } - @IBAction func btnTrackEventCallbackTapped(sender: UIButton) { + @IBAction func btnTrackEventCallbackTapped(_sender: UIButton) { let event = ADJEvent(eventToken: "{YourEventToken}"); - event.addCallbackParameter("foo", value: "bar"); - event.addCallbackParameter("key", value: "value"); + event?.addCallbackParameter("foo", value: "bar"); + event?.addCallbackParameter("key", value: "value"); Adjust.trackEvent(event); } - @IBAction func btnTrackEventPartnerTapped(sender: UIButton) { + @IBAction func btnTrackEventPartnerTapped(_sender: UIButton) { let event = ADJEvent(eventToken: "{YourEventToken}"); - event.addPartnerParameter("foo", value: "bar"); - event.addPartnerParameter("key", value: "value"); + event?.addPartnerParameter("foo", value: "bar"); + event?.addPartnerParameter("key", value: "value"); Adjust.trackEvent(event); } - @IBAction func btnEnableOfflineModeTapped(sender: UIButton) { + @IBAction func btnEnableOfflineModeTapped(_sender: UIButton) { Adjust.setOfflineMode(true); } - @IBAction func btnDisableOfflineModeTapped(sender: UIButton) { + @IBAction func btnDisableOfflineModeTapped(_sender: UIButton) { Adjust.setOfflineMode(false); } - @IBAction func btnEnableSDKTapped(sender: UIButton) { + @IBAction func btnEnableSDKTapped(_sender: UIButton) { Adjust.setEnabled(true); } - @IBAction func btnDisableSDKTapped(sender: UIButton) { + @IBAction func btnDisableSDKTapped(_sender: UIButton) { Adjust.setEnabled(false); } - @IBAction func btnIsSDKEnabledTapped(sender: UIButton) { + @IBAction func btnIsSDKEnabledTapped(_sender: UIButton) { let isSDKEnabled = Adjust.isEnabled(); if (isSDKEnabled) { - let alert = UIAlertController(title: "Is SDK Enabled?", - message: "SDK is ENABLED!", - preferredStyle: UIAlertControllerStyle.Alert) - - alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) - self.presentViewController(alert, animated: true, completion: nil) + // let alert = UIAlertController(title: "Is SDK Enabled?", + // message: "SDK is ENABLED!", + // preferredStyle: UIAlertControllerStyle.Alert) + // + // alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) + // self.present(alert, animated: true, completion: nil) + + NSLog("SDK is enabled!"); } else { - let alert = UIAlertController(title: "Is SDK Enabled?", - message: "SDK is DISABLED!", - preferredStyle: UIAlertControllerStyle.Alert) - - alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) - self.presentViewController(alert, animated: true, completion: nil) + // let alert = UIAlertController(title: "Is SDK Enabled?", + // message: "SDK is DISABLED!", + // preferredStyle: UIAlertControllerStyle.Alert) + // + // alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) + // self.present(alert, animated: true, completion: nil) + + NSLog("SDK is disabled"); } } } diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj b/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj index b1c2d6f05..d6eb2c3df 100644 --- a/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj @@ -15,35 +15,6 @@ 9D1082C81CFDAFF30050568B /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D1082C71CFDAFF30050568B /* WebKit.framework */; }; 9D1082CA1CFDAFF60050568B /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D1082C91CFDAFF60050568B /* iAd.framework */; }; 9D1082CC1CFDAFFB0050568B /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D1082CB1CFDAFFB0050568B /* AdSupport.framework */; }; - 9D1083091CFDB0100050568B /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082CE1CFDB0100050568B /* ADJSystemProfile.m */; }; - 9D10830A1CFDB0100050568B /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082D01CFDB0100050568B /* NSString+ADJAdditions.m */; }; - 9D10830B1CFDB0100050568B /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082D21CFDB0100050568B /* UIDevice+ADJAdditions.m */; }; - 9D10830C1CFDB0100050568B /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082D41CFDB0100050568B /* NSData+ADJAdditions.m */; }; - 9D10830D1CFDB0100050568B /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082D71CFDB0100050568B /* Adjust.m */; }; - 9D10830E1CFDB0100050568B /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082D91CFDB0100050568B /* ADJActivityHandler.m */; }; - 9D10830F1CFDB0100050568B /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082DB1CFDB0100050568B /* ADJActivityKind.m */; }; - 9D1083101CFDB0100050568B /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082DD1CFDB0100050568B /* ADJActivityPackage.m */; }; - 9D1083111CFDB0100050568B /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082DF1CFDB0100050568B /* ADJActivityState.m */; }; - 9D1083121CFDB0100050568B /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082E11CFDB0100050568B /* ADJAdjustFactory.m */; }; - 9D1083131CFDB0100050568B /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082E31CFDB0100050568B /* ADJLogger.m */; }; - 9D1083141CFDB0100050568B /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082E51CFDB0100050568B /* ADJPackageBuilder.m */; }; - 9D1083151CFDB0100050568B /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082E71CFDB0100050568B /* ADJPackageHandler.m */; }; - 9D1083161CFDB0100050568B /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082E91CFDB0100050568B /* ADJRequestHandler.m */; }; - 9D1083171CFDB0100050568B /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082EB1CFDB0100050568B /* ADJUtil.m */; }; - 9D1083181CFDB0100050568B /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082ED1CFDB0100050568B /* ADJEvent.m */; }; - 9D1083191CFDB0100050568B /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082EF1CFDB0100050568B /* ADJDeviceInfo.m */; }; - 9D10831A1CFDB0100050568B /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082F11CFDB0100050568B /* ADJAttributionHandler.m */; }; - 9D10831B1CFDB0100050568B /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082F31CFDB0100050568B /* ADJAttribution.m */; }; - 9D10831C1CFDB0100050568B /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082F51CFDB0100050568B /* ADJConfig.m */; }; - 9D10831D1CFDB0100050568B /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082F71CFDB0100050568B /* ADJTimerOnce.m */; }; - 9D10831E1CFDB0100050568B /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082F91CFDB0100050568B /* ADJTimerCycle.m */; }; - 9D10831F1CFDB0100050568B /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082FB1CFDB0100050568B /* ADJResponseData.m */; }; - 9D1083201CFDB0100050568B /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082FD1CFDB0100050568B /* ADJSessionSuccess.m */; }; - 9D1083211CFDB0100050568B /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082FF1CFDB0100050568B /* ADJSessionFailure.m */; }; - 9D1083221CFDB0100050568B /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1083011CFDB0100050568B /* ADJEventSuccess.m */; }; - 9D1083231CFDB0100050568B /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1083031CFDB0100050568B /* ADJEventFailure.m */; }; - 9D1083241CFDB0100050568B /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1083051CFDB0100050568B /* ADJBackoffStrategy.m */; }; - 9D1083251CFDB0100050568B /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1083071CFDB0100050568B /* ADJSdkClickHandler.m */; }; 9D10833A1CFDBD9F0050568B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D1083391CFDBD9F0050568B /* CoreGraphics.framework */; }; 9D10833D1CFDD8F00050568B /* WKWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D10833C1CFDD8F00050568B /* WKWebViewController.m */; }; 9D10833F1CFDDBF50050568B /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9D10833E1CFDDBF50050568B /* Default-568h@2x.png */; }; @@ -58,6 +29,8 @@ 9D75F19C1D07463800E5D222 /* adjust_event.js in Resources */ = {isa = PBXBuildFile; fileRef = 9D75F1931D07463800E5D222 /* adjust_event.js */; }; 9D75F19D1D07463800E5D222 /* adjust_config.js in Resources */ = {isa = PBXBuildFile; fileRef = 9D75F1941D07463800E5D222 /* adjust_config.js */; }; 9D9A99DA1D0B699A0022FFCE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9A99D91D0B699A0022FFCE /* AppDelegate.m */; }; + 9DFB04CA1D745BDE006D48FC /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04C91D745BDE006D48FC /* SafariServices.framework */; }; + 9DFB04CC1D745C3D006D48FC /* AdjustSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04CB1D745C3D006D48FC /* AdjustSdk.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -73,64 +46,6 @@ 9D1082C71CFDAFF30050568B /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 9D1082C91CFDAFF60050568B /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; 9D1082CB1CFDAFFB0050568B /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; - 9D1082CD1CFDB0100050568B /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; - 9D1082CE1CFDB0100050568B /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; - 9D1082CF1CFDB0100050568B /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; - 9D1082D01CFDB0100050568B /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; - 9D1082D11CFDB0100050568B /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; - 9D1082D21CFDB0100050568B /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; - 9D1082D31CFDB0100050568B /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; - 9D1082D41CFDB0100050568B /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; - 9D1082D61CFDB0100050568B /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; - 9D1082D71CFDB0100050568B /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; - 9D1082D81CFDB0100050568B /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; - 9D1082D91CFDB0100050568B /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; - 9D1082DA1CFDB0100050568B /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; - 9D1082DB1CFDB0100050568B /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; - 9D1082DC1CFDB0100050568B /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; - 9D1082DD1CFDB0100050568B /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; - 9D1082DE1CFDB0100050568B /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; - 9D1082DF1CFDB0100050568B /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; - 9D1082E01CFDB0100050568B /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; - 9D1082E11CFDB0100050568B /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; - 9D1082E21CFDB0100050568B /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; - 9D1082E31CFDB0100050568B /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; - 9D1082E41CFDB0100050568B /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; - 9D1082E51CFDB0100050568B /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; - 9D1082E61CFDB0100050568B /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; - 9D1082E71CFDB0100050568B /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; - 9D1082E81CFDB0100050568B /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; - 9D1082E91CFDB0100050568B /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; - 9D1082EA1CFDB0100050568B /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; - 9D1082EB1CFDB0100050568B /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; - 9D1082EC1CFDB0100050568B /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; - 9D1082ED1CFDB0100050568B /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; - 9D1082EE1CFDB0100050568B /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; - 9D1082EF1CFDB0100050568B /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; - 9D1082F01CFDB0100050568B /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; - 9D1082F11CFDB0100050568B /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; - 9D1082F21CFDB0100050568B /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; - 9D1082F31CFDB0100050568B /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; - 9D1082F41CFDB0100050568B /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; - 9D1082F51CFDB0100050568B /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; - 9D1082F61CFDB0100050568B /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; - 9D1082F71CFDB0100050568B /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; - 9D1082F81CFDB0100050568B /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; - 9D1082F91CFDB0100050568B /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; - 9D1082FA1CFDB0100050568B /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; - 9D1082FB1CFDB0100050568B /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; - 9D1082FC1CFDB0100050568B /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; - 9D1082FD1CFDB0100050568B /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; - 9D1082FE1CFDB0100050568B /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; - 9D1082FF1CFDB0100050568B /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; - 9D1083001CFDB0100050568B /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; - 9D1083011CFDB0100050568B /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; - 9D1083021CFDB0100050568B /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; - 9D1083031CFDB0100050568B /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; - 9D1083041CFDB0100050568B /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; - 9D1083051CFDB0100050568B /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; - 9D1083061CFDB0100050568B /* ADJSdkClickHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandler.h; sourceTree = ""; }; - 9D1083071CFDB0100050568B /* ADJSdkClickHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandler.m; sourceTree = ""; }; 9D1083391CFDBD9F0050568B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 9D10833B1CFDD8F00050568B /* WKWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewController.h; sourceTree = ""; }; 9D10833C1CFDD8F00050568B /* WKWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKWebViewController.m; sourceTree = ""; }; @@ -152,6 +67,8 @@ 9D75F1941D07463800E5D222 /* adjust_config.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = adjust_config.js; sourceTree = ""; }; 9D9A99D81D0B699A0022FFCE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 9D9A99D91D0B699A0022FFCE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9DFB04C91D745BDE006D48FC /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; }; + 9DFB04CB1D745C3D006D48FC /* AdjustSdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdjustSdk.framework; path = Adjust/AdjustSdk.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -159,12 +76,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9D1083431CFDE29A0050568B /* Foundation.framework in Frameworks */, - 9D1083411CFDE2470050568B /* UIKit.framework in Frameworks */, 9D1082CA1CFDAFF60050568B /* iAd.framework in Frameworks */, + 9D1083411CFDE2470050568B /* UIKit.framework in Frameworks */, 9D1082C81CFDAFF30050568B /* WebKit.framework in Frameworks */, + 9DFB04CC1D745C3D006D48FC /* AdjustSdk.framework in Frameworks */, 9D1082CC1CFDAFFB0050568B /* AdSupport.framework in Frameworks */, + 9D1083431CFDE29A0050568B /* Foundation.framework in Frameworks */, 9D10833A1CFDBD9F0050568B /* CoreGraphics.framework in Frameworks */, + 9DFB04CA1D745BDE006D48FC /* SafariServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -208,7 +127,6 @@ isa = PBXGroup; children = ( 9D10833E1CFDDBF50050568B /* Default-568h@2x.png */, - 9D1083081CFDB0100050568B /* Adjust */, 9D75F1951D07463800E5D222 /* AdjustBridge */, 9D1082C61CFDAFE30050568B /* Frameworks */, 9D1082A81CFDAF8E0050568B /* main.m */, @@ -219,90 +137,18 @@ 9D1082C61CFDAFE30050568B /* Frameworks */ = { isa = PBXGroup; children = ( - 9D1083421CFDE29A0050568B /* Foundation.framework */, - 9D1083401CFDE2470050568B /* UIKit.framework */, 9D1082C91CFDAFF60050568B /* iAd.framework */, + 9D1083401CFDE2470050568B /* UIKit.framework */, 9D1082C71CFDAFF30050568B /* WebKit.framework */, + 9DFB04CB1D745C3D006D48FC /* AdjustSdk.framework */, 9D1082CB1CFDAFFB0050568B /* AdSupport.framework */, + 9D1083421CFDE29A0050568B /* Foundation.framework */, 9D1083391CFDBD9F0050568B /* CoreGraphics.framework */, + 9DFB04C91D745BDE006D48FC /* SafariServices.framework */, ); name = Frameworks; sourceTree = ""; }; - 9D1082D51CFDB0100050568B /* ADJAdditions */ = { - isa = PBXGroup; - children = ( - 9D1082CF1CFDB0100050568B /* NSString+ADJAdditions.h */, - 9D1082D01CFDB0100050568B /* NSString+ADJAdditions.m */, - 9D1082D11CFDB0100050568B /* UIDevice+ADJAdditions.h */, - 9D1082D21CFDB0100050568B /* UIDevice+ADJAdditions.m */, - 9D1082D31CFDB0100050568B /* NSData+ADJAdditions.h */, - 9D1082D41CFDB0100050568B /* NSData+ADJAdditions.m */, - ); - path = ADJAdditions; - sourceTree = ""; - }; - 9D1083081CFDB0100050568B /* Adjust */ = { - isa = PBXGroup; - children = ( - 9D1082CD1CFDB0100050568B /* ADJSystemProfile.h */, - 9D1082CE1CFDB0100050568B /* ADJSystemProfile.m */, - 9D1082D51CFDB0100050568B /* ADJAdditions */, - 9D1082D61CFDB0100050568B /* Adjust.h */, - 9D1082D71CFDB0100050568B /* Adjust.m */, - 9D1082D81CFDB0100050568B /* ADJActivityHandler.h */, - 9D1082D91CFDB0100050568B /* ADJActivityHandler.m */, - 9D1082DA1CFDB0100050568B /* ADJActivityKind.h */, - 9D1082DB1CFDB0100050568B /* ADJActivityKind.m */, - 9D1082DC1CFDB0100050568B /* ADJActivityPackage.h */, - 9D1082DD1CFDB0100050568B /* ADJActivityPackage.m */, - 9D1082DE1CFDB0100050568B /* ADJActivityState.h */, - 9D1082DF1CFDB0100050568B /* ADJActivityState.m */, - 9D1082E01CFDB0100050568B /* ADJAdjustFactory.h */, - 9D1082E11CFDB0100050568B /* ADJAdjustFactory.m */, - 9D1082E21CFDB0100050568B /* ADJLogger.h */, - 9D1082E31CFDB0100050568B /* ADJLogger.m */, - 9D1082E41CFDB0100050568B /* ADJPackageBuilder.h */, - 9D1082E51CFDB0100050568B /* ADJPackageBuilder.m */, - 9D1082E61CFDB0100050568B /* ADJPackageHandler.h */, - 9D1082E71CFDB0100050568B /* ADJPackageHandler.m */, - 9D1082E81CFDB0100050568B /* ADJRequestHandler.h */, - 9D1082E91CFDB0100050568B /* ADJRequestHandler.m */, - 9D1082EA1CFDB0100050568B /* ADJUtil.h */, - 9D1082EB1CFDB0100050568B /* ADJUtil.m */, - 9D1082EC1CFDB0100050568B /* ADJEvent.h */, - 9D1082ED1CFDB0100050568B /* ADJEvent.m */, - 9D1082EE1CFDB0100050568B /* ADJDeviceInfo.h */, - 9D1082EF1CFDB0100050568B /* ADJDeviceInfo.m */, - 9D1082F01CFDB0100050568B /* ADJAttributionHandler.h */, - 9D1082F11CFDB0100050568B /* ADJAttributionHandler.m */, - 9D1082F21CFDB0100050568B /* ADJAttribution.h */, - 9D1082F31CFDB0100050568B /* ADJAttribution.m */, - 9D1082F41CFDB0100050568B /* ADJConfig.h */, - 9D1082F51CFDB0100050568B /* ADJConfig.m */, - 9D1082F61CFDB0100050568B /* ADJTimerOnce.h */, - 9D1082F71CFDB0100050568B /* ADJTimerOnce.m */, - 9D1082F81CFDB0100050568B /* ADJTimerCycle.h */, - 9D1082F91CFDB0100050568B /* ADJTimerCycle.m */, - 9D1082FA1CFDB0100050568B /* ADJResponseData.h */, - 9D1082FB1CFDB0100050568B /* ADJResponseData.m */, - 9D1082FC1CFDB0100050568B /* ADJSessionSuccess.h */, - 9D1082FD1CFDB0100050568B /* ADJSessionSuccess.m */, - 9D1082FE1CFDB0100050568B /* ADJSessionFailure.h */, - 9D1082FF1CFDB0100050568B /* ADJSessionFailure.m */, - 9D1083001CFDB0100050568B /* ADJEventSuccess.h */, - 9D1083011CFDB0100050568B /* ADJEventSuccess.m */, - 9D1083021CFDB0100050568B /* ADJEventFailure.h */, - 9D1083031CFDB0100050568B /* ADJEventFailure.m */, - 9D1083041CFDB0100050568B /* ADJBackoffStrategy.h */, - 9D1083051CFDB0100050568B /* ADJBackoffStrategy.m */, - 9D1083061CFDB0100050568B /* ADJSdkClickHandler.h */, - 9D1083071CFDB0100050568B /* ADJSdkClickHandler.m */, - ); - name = Adjust; - path = ../../../Adjust; - sourceTree = ""; - }; 9D75F18F1D07463800E5D222 /* WebViewJavascriptBridge */ = { isa = PBXGroup; children = ( @@ -321,11 +167,11 @@ 9D75F1951D07463800E5D222 /* AdjustBridge */ = { isa = PBXGroup; children = ( + 9D75F1901D07463800E5D222 /* AdjustBridge.h */, + 9D75F1911D07463800E5D222 /* AdjustBridge.m */, 968595EF1D0B2E630011CA2B /* AdjustBridgeRegister.h */, 968595F01D0B2E630011CA2B /* AdjustBridgeRegister.m */, 9D75F18F1D07463800E5D222 /* WebViewJavascriptBridge */, - 9D75F1901D07463800E5D222 /* AdjustBridge.h */, - 9D75F1911D07463800E5D222 /* AdjustBridge.m */, 9D75F1921D07463800E5D222 /* adjust.js */, 9D75F1931D07463800E5D222 /* adjust_event.js */, 9D75F1941D07463800E5D222 /* adjust_config.js */, @@ -408,44 +254,15 @@ buildActionMask = 2147483647; files = ( 9D9A99DA1D0B699A0022FFCE /* AppDelegate.m in Sources */, - 9D10830F1CFDB0100050568B /* ADJActivityKind.m in Sources */, - 9D10830A1CFDB0100050568B /* NSString+ADJAdditions.m in Sources */, - 9D1083221CFDB0100050568B /* ADJEventSuccess.m in Sources */, 9D1082AF1CFDAF8E0050568B /* UIWebViewController.m in Sources */, - 9D1083251CFDB0100050568B /* ADJSdkClickHandler.m in Sources */, 9D75F1961D07463800E5D222 /* WebViewJavascriptBridge.m in Sources */, - 9D10831B1CFDB0100050568B /* ADJAttribution.m in Sources */, - 9D10830E1CFDB0100050568B /* ADJActivityHandler.m in Sources */, - 9D1083191CFDB0100050568B /* ADJDeviceInfo.m in Sources */, - 9D1083161CFDB0100050568B /* ADJRequestHandler.m in Sources */, - 9D1083201CFDB0100050568B /* ADJSessionSuccess.m in Sources */, - 9D1083211CFDB0100050568B /* ADJSessionFailure.m in Sources */, 9D75F1991D07463800E5D222 /* WKWebViewJavascriptBridge.m in Sources */, - 9D1083181CFDB0100050568B /* ADJEvent.m in Sources */, 9D10833D1CFDD8F00050568B /* WKWebViewController.m in Sources */, - 9D10831C1CFDB0100050568B /* ADJConfig.m in Sources */, - 9D1083121CFDB0100050568B /* ADJAdjustFactory.m in Sources */, - 9D1083171CFDB0100050568B /* ADJUtil.m in Sources */, - 9D1083231CFDB0100050568B /* ADJEventFailure.m in Sources */, - 9D10831F1CFDB0100050568B /* ADJResponseData.m in Sources */, - 9D10831A1CFDB0100050568B /* ADJAttributionHandler.m in Sources */, - 9D1083101CFDB0100050568B /* ADJActivityPackage.m in Sources */, - 9D1083241CFDB0100050568B /* ADJBackoffStrategy.m in Sources */, 9D75F19A1D07463800E5D222 /* AdjustBridge.m in Sources */, - 9D1083151CFDB0100050568B /* ADJPackageHandler.m in Sources */, 9D75F1971D07463800E5D222 /* WebViewJavascriptBridge_JS.m in Sources */, - 9D1083111CFDB0100050568B /* ADJActivityState.m in Sources */, 968595F11D0B2E630011CA2B /* AdjustBridgeRegister.m in Sources */, - 9D10830B1CFDB0100050568B /* UIDevice+ADJAdditions.m in Sources */, - 9D1083091CFDB0100050568B /* ADJSystemProfile.m in Sources */, 9D75F1981D07463800E5D222 /* WebViewJavascriptBridgeBase.m in Sources */, - 9D10830C1CFDB0100050568B /* NSData+ADJAdditions.m in Sources */, - 9D1083141CFDB0100050568B /* ADJPackageBuilder.m in Sources */, - 9D1083131CFDB0100050568B /* ADJLogger.m in Sources */, - 9D10830D1CFDB0100050568B /* Adjust.m in Sources */, - 9D10831D1CFDB0100050568B /* ADJTimerOnce.m in Sources */, 9D1082A91CFDAF8E0050568B /* main.m in Sources */, - 9D10831E1CFDB0100050568B /* ADJTimerCycle.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -492,6 +309,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; }; name = Debug; @@ -529,6 +347,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -537,22 +356,32 @@ 9D1082BC1CFDAF8E0050568B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-WebView/Adjust", + ); INFOPLIST_FILE = "AdjustExample-WebView/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-WebView"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 9D1082BD1CFDAF8E0050568B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-WebView/Adjust", + ); INFOPLIST_FILE = "AdjustExample-WebView/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-WebView"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/AdjustSdk b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/AdjustSdk new file mode 120000 index 000000000..010b1f0e7 --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/AdjustSdk @@ -0,0 +1 @@ +Versions/Current/AdjustSdk \ No newline at end of file diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Headers b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Headers new file mode 120000 index 000000000..a177d2a6b --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk new file mode 100644 index 000000000..888a3875b Binary files /dev/null and b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk differ diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h new file mode 100644 index 000000000..21faee13e --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h @@ -0,0 +1,43 @@ +// +// ADJAttribution.h +// adjust +// +// Created by Pedro Filipe on 29/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJAttribution : NSObject + +// the following attributes are only set when error is nil +// (when activity was tracked successfully and response could be parsed) + +// tracker token of current device +@property (nonatomic, copy) NSString *trackerToken; + +// tracker name of current device +@property (nonatomic, copy) NSString *trackerName; + +// tracker network +@property (nonatomic, copy) NSString *network; + +// tracker campaign +@property (nonatomic, copy) NSString *campaign; + +// tracker adgroup +@property (nonatomic, copy) NSString *adgroup; + +// tracker creative +@property (nonatomic, copy) NSString *creative; + +// tracker click_label +@property (nonatomic, copy) NSString *clickLabel; + +- (BOOL)isEqualToAttribution:(ADJAttribution *)attribution; + ++ (ADJAttribution *)dataWithJsonDict:(NSDictionary *)jsonDict; +- (id)initWithJsonDict:(NSDictionary *)jsonDict; +- (NSDictionary *)dictionary; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h new file mode 100644 index 000000000..1774c80c7 --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h @@ -0,0 +1,177 @@ +// +// ADJConfig.h +// adjust +// +// Created by Pedro Filipe on 30/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import +#import "ADJLogger.h" +#import "ADJAttribution.h" +#import "ADJSessionSuccess.h" +#import "ADJSessionFailure.h" +#import "ADJEventSuccess.h" +#import "ADJEventFailure.h" + +/** + * Optional delegate that will get informed about tracking results + */ +@protocol AdjustDelegate +@optional + +/** + * Optional delegate method that gets called when the attribution information changed + * + * @param attribution The attribution information. + * See ADJAttribution for details + */ +- (void)adjustAttributionChanged:(ADJAttribution *)attribution; + +/** + * Optional delegate method that gets called when an event is tracked with success + * + * @param eventSuccessResponseData The response information from tracking with success + * See ADJEventSuccess for details + */ +- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData; + +/** + * Optional delegate method that gets called when an event is tracked with failure + * + * @param eventFailureResponseData The response information from tracking with failure + * See ADJEventFailure for details + */ +- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with success + * + * @param sessionSuccessResponseData The response information from tracking with success + * See ADJSessionSuccess for details + */ +- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with failure + * + * @param sessionFailureResponseData The response information from tracking with failure + * See ADJSessionFailure for details + */ +- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData; + +/** + * Optional delegate method that gets called when a deeplink is about to be opened by the adjust SDK + * + * @param deeplink The deeplink url that was received by the adjust SDK to be opened + * @return boolean Value that indicates whether the deeplink should be opened by the adjust SDK + */ +- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink; + +@end + +@interface ADJConfig : NSObject + +@property (nonatomic, copy) NSString *sdkPrefix; +@property (nonatomic, copy) NSString *defaultTracker; +@property (nonatomic, copy, readonly) NSString *appToken; +@property (nonatomic, copy, readonly) NSString *environment; + +/** + * Configuration object for the initialization of the Adjust SDK + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment; + +/** + * Configuration object for the initialization of the Adjust SDK. + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + * @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress + * and replaces the default value for production environment + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; + +/** + * Change the verbosity of Adjust's logs + * + * You can increase or reduce the amount of logs from Adjust by passing + * one of the following parameters. Use ADJLogLevelSuppress to disable all logging + * + * @var logLevel The desired minimum log level (default: info) + * Must be one of the following: + * - ADJLogLevelVerbose (enable all logging) + * - ADJLogLevelDebug (enable more logging) + * - ADJLogLevelInfo (the default) + * - ADJLogLevelWarn (disable info logging) + * - ADJLogLevelError (disable warnings as well) + * - ADJLogLevelAssert (disable errors as well) + * - ADJLogLevelSuppress (suppress all logging) + */ +@property (nonatomic, assign) ADJLogLevel logLevel; + +/** + * Enable event buffering if your app triggers a lot of events. + * When enabled, events get buffered and only get tracked each + * minute. Buffered events are still persisted, of course + * + * @var eventBufferingEnabled Enable or disable event buffering + */ +@property (nonatomic, assign) BOOL eventBufferingEnabled; + +/** + * Set the optional delegate that will inform you about attribution or events + * + * See the AdjustDelegate declaration above for details + * + * @var delegate The delegate that might implement the optional delegate methods + */ +@property (nonatomic, weak) NSObject *delegate; + +/** + * Enables sending in the background + * + * @var sendInBackground Enable or disable sending in the background + */ +@property (nonatomic, assign) BOOL sendInBackground; + +/** + * Enables delayed start of the SDK + * + * @var delayStart Number of seconds after which SDK will start + */ +@property (nonatomic, assign) double delayStart; + +/** + * User agent for the requests. + * + * @var userAgent User agent value. + */ +@property (nonatomic, copy) NSString *userAgent; + +@property (nonatomic, assign, readonly) BOOL hasResponseDelegate; +@property (nonatomic, assign, readonly) BOOL hasAttributionChangedDelegate; + +- (BOOL) isValid; +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h new file mode 100644 index 000000000..7fcb8881d --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h @@ -0,0 +1,89 @@ +// +// ADJEvent.h +// adjust +// +// Created by Pedro Filipe on 15/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEvent : NSObject + +@property (nonatomic, copy, readonly) NSString* eventToken; +@property (nonatomic, copy, readonly) NSNumber* revenue; +@property (nonatomic, readonly) NSDictionary* callbackParameters; +@property (nonatomic, readonly) NSDictionary* partnerParameters; +@property (nonatomic, copy, readonly) NSString* transactionId; +@property (nonatomic, copy, readonly) NSString* currency; +@property (nonatomic, copy, readonly) NSData* receipt; +@property (nonatomic, assign, readonly) BOOL emptyReceipt; + +/** + * Create Event object with Event Token. + * + * @param eventToken Event token that is created in the dashboard + * at http://adjust.com and should be six characters long. + */ ++ (ADJEvent *)eventWithEventToken:(NSString *)eventToken; +- (id) initWithEventToken:(NSString *)eventToken; + +/** + * Add a key-pair to a callback URL. + * + * In your dashboard at http://adjust.com you can assign a callback URL to each + * event type. That URL will get called every time the event is triggered. On + * top of that you can add callback parameters to the following method that + * will be forwarded to these callbacks. + * + * @param key String key in the callback URL. + * @param value String value of the key in the Callback URL. + * + */ +- (void) addCallbackParameter:(NSString *)key + value:(NSString *)value; + +/** + * Add a key-pair to be fowarded to a partner. + * + * @param key String key to be fowarded to the partner + * @param value String value of the key to be fowarded to the partner + * + */ +- (void) addPartnerParameter:(NSString *)key + value:(NSString *)value; + +/** + * Set the revenue and associated currency of the event. + * + * The event can contain some revenue. The amount revenue is measured in units. + * It must include a currency in the ISO 4217 format. + * + * @param amount The amount in units (example: for 1.50 EUR is 1.5) + * @param currency String of the currency with ISO 4217 format. + * It should be 3 characters long (example: for 1.50 EUR is @"EUR") + */ +- (void) setRevenue:(double)amount currency:(NSString *)currency; + +/** + * Set the transaction ID of a In-App Purchases to avoid revenue duplications. + * + * A transaction ID can be used to avoid duplicate revenue events. The last ten + * transaction identifiers are remembered. + * + * @param transactionId The identifier used to avoid duplicate revenue events + */ +- (void) setTransactionId:(NSString *)transactionId; + +- (BOOL) isValid; + +/** + * + * Validate a in-app-purchase receipt. + * + * @param receipt The receipt to validate + * @param transactionId The identifier used to validate the receipt and to avoid duplicate revenue events + */ +- (void) setReceipt:(NSData *)receipt transactionId:(NSString *)transactionId; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h new file mode 100644 index 000000000..46ef36d16 --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h @@ -0,0 +1,34 @@ +// +// ADJEventFailure.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventFailure *)eventFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h new file mode 100644 index 000000000..ce2abb1bd --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h @@ -0,0 +1,31 @@ +// +// ADJEventSuccess.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventSuccess *)eventSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h new file mode 100644 index 000000000..89f02f159 --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h @@ -0,0 +1,39 @@ +// +// ADJLogger.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-11-15. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// +#import + +typedef enum { + ADJLogLevelVerbose = 1, + ADJLogLevelDebug = 2, + ADJLogLevelInfo = 3, + ADJLogLevelWarn = 4, + ADJLogLevelError = 5, + ADJLogLevelAssert = 6, + ADJLogLevelSuppress = 7 +} ADJLogLevel; + +// A simple logger with multiple log levels. +@protocol ADJLogger + +- (void)setLogLevel:(ADJLogLevel)logLevel; +- (void)lockLogLevel; + +- (void)verbose:(NSString *)message, ...; +- (void)debug: (NSString *)message, ...; +- (void)info: (NSString *)message, ...; +- (void)warn: (NSString *)message, ...; +- (void)error: (NSString *)message, ...; +- (void)assert: (NSString *)message, ...; + +@end + +@interface ADJLogger : NSObject + ++ (ADJLogLevel) LogLevelFromString: (NSString *) logLevelString; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h new file mode 100644 index 000000000..25681f03b --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h @@ -0,0 +1,31 @@ +// +// ADJFailureResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionFailure *)sessionFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h new file mode 100644 index 000000000..5533928bc --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h @@ -0,0 +1,28 @@ +// +// ADJSuccessResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionSuccess *)sessionSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h new file mode 100644 index 000000000..337479af3 --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h @@ -0,0 +1,201 @@ +// +// Adjust.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-07-23. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// + +#import "ADJEvent.h" +#import "ADJAttribution.h" +#import "ADJConfig.h" + +/** + * Constants for our supported tracking environments + */ +extern NSString * const ADJEnvironmentSandbox; +extern NSString * const ADJEnvironmentProduction; + +/** + * The main interface to Adjust + * + * Use the methods of this class to tell Adjust about the usage of your app. + * See the README for details. + */ +@interface Adjust : NSObject + +/** + * Tell Adjust that the application did launch + * + * This is required to initialize Adjust. Call this in the didFinishLaunching + * method of your AppDelegate. + * + * See ADJConfig.h for more configuration options + * + * @param adjustConfig The configuration object that includes the environment + * and the App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long. + */ ++ (void)appDidLaunch:(ADJConfig *)adjustConfig; + +/** + * Tell Adjust that a particular event has happened + * + * See ADJEvent.h for more event options. + * + * @param event The Event object for this kind of event. It needs a event token + * that is created in the dashboard at http://adjust.com and should be six + * characters long. + */ ++ (void)trackEvent:(ADJEvent *)event; + +/** + * Tell adjust that the application resumed + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionStart; + +/** + * Tell adjust that the application paused + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionEnd; + +/** + * Enable or disable the adjust SDK. This setting is saved for future sessions + * + * @param enabled The flag to enable or disable the adjust SDK + */ ++ (void)setEnabled:(BOOL)enabled; + +/** + * Check if the SDK is enabled or disabled + * + * return Boolean indicating whether SDK is enabled or not + */ ++ (BOOL)isEnabled; + +/** + * Read the URL that opened the application to search for an adjust deep link + * + * @param url URL object which contains info about adjust deep link + */ ++ (void)appWillOpenUrl:(NSURL *)url; + +/** + * Set the device token used by push notifications + * + * @param deviceToken Apple push notification token for iOS device + */ ++ (void)setDeviceToken:(NSData *)deviceToken; + +/** + * Enable or disable offline mode. Activities won't be sent but they are saved when + * offline mode is disabled. This feature is not saved for future sessions + * + * @param enabled The flag to enable or disable offline mode + */ ++ (void)setOfflineMode:(BOOL)enabled; + +/** + * Convert a universal link style url to a deeplink style url with the corresponding scheme + * + * @param url URL object which contains info about adjust deep link + * @param scheme Desired scheme to which you want your resulting URL object to be prefixed with + * + * @return URL object in custom URL scheme style prefixed with given scheme name + */ ++ (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +/** + * Retrieve iOS device IDFA value + * + * @return Device IDFA value + */ ++ (NSString *)idfa; + +/** + * Tell the adjust SDK to stop waiting for delayed initialisation timer to complete but rather to start + * upon this call. This should be called if you have obtained needed callback/partner parameters which you + * wanted to put as default ones before the delayedStart value you have set on ADJConfig has expired + */ ++ (void)sendFirstPackages; + +/** + * Tell adjust to send the request to Google and check if the installation + * belongs to Google AdWords campaign + */ ++ (void)sendAdWordsRequest; + +/** + * Add default callback parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default callback parameter key + * @param value Default callback parameter value + */ ++ (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +/** + * Add default partner parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default partner parameter key + * @param value Default partner parameter value + */ ++ (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; + +/** + * Remove default callback parameter from the session packages + * + * @param key Default callback parameter key + */ ++ (void)removeSessionCallbackParameter:(NSString *)key; + +/** + * Remove default partner parameter from the session packages + * + * @param key Default partner parameter key + */ ++ (void)removeSessionPartnerParameter:(NSString *)key; + +/** + * Remove all default callback parameters from the session packages + */ ++ (void)resetSessionCallbackParameters; + +/** + * Remove all default partner parameters from the session packages + */ ++ (void)resetSessionPartnerParameters; + +/** + * Obtain singleton Adjust object + */ ++ (id)getInstance; + +- (void)appDidLaunch:(ADJConfig *)adjustConfig; +- (void)trackEvent:(ADJEvent *)event; +- (void)setEnabled:(BOOL)enabled; +- (void)teardown:(BOOL)deleteState; +- (void)appWillOpenUrl:(NSURL *)url; +- (void)setOfflineMode:(BOOL)enabled; +- (void)setDeviceToken:(NSData *)deviceToken; + +- (BOOL)isEnabled; +- (NSString *)idfa; +- (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +- (void)sendFirstPackages; +- (void)sendAdWordsRequest; +- (void)trackSubsessionEnd; +- (void)trackSubsessionStart; +- (void)resetSessionPartnerParameters; +- (void)resetSessionCallbackParameters; +- (void)removeSessionPartnerParameter:(NSString *)key; +- (void)removeSessionCallbackParameter:(NSString *)key; +- (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; +- (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +@end diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/Current b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/Current new file mode 120000 index 000000000..8c7e5a667 --- /dev/null +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Adjust/AdjustSdk.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/Info.plist b/examples/AdjustExample-WebView/AdjustExample-WebView/Info.plist index 7c1b946f8..2145b2d66 100644 --- a/examples/AdjustExample-WebView/AdjustExample-WebView/Info.plist +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/Info.plist @@ -18,6 +18,17 @@ 1.0 CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleURLName + com.adjust.example + CFBundleURLSchemes + + adjustExample + + + CFBundleVersion 1 LSRequiresIPhoneOS @@ -29,17 +40,9 @@ UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - - CFBundleURLTypes - - - CFBundleURLName - com.adjust.example - CFBundleURLSchemes - - adjustExample - - + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortraitUpsideDown diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj b/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj index 8aa125fdd..d24f71156 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.pbxproj @@ -7,9 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 96164D941CCA4E1C009431AB /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D8F1CCA4E1C009431AB /* ADJBackoffStrategy.m */; }; - 96164D951CCA4E1C009431AB /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D911CCA4E1C009431AB /* ADJSdkClickHandler.m */; }; - 96164D961CCA4E1C009431AB /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D931CCA4E1C009431AB /* ADJSystemProfile.m */; }; 963909411BCBFCF300A2E8A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909401BCBFCF300A2E8A4 /* main.m */; }; 963909441BCBFCF300A2E8A4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909431BCBFCF300A2E8A4 /* AppDelegate.m */; }; 9639094A1BCBFCF300A2E8A4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 963909481BCBFCF300A2E8A4 /* Main.storyboard */; }; @@ -17,46 +14,14 @@ 9639094F1BCBFCF300A2E8A4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9639094D1BCBFCF300A2E8A4 /* LaunchScreen.storyboard */; }; 9639095F1BCBFD3B00A2E8A4 /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9639095E1BCBFD3B00A2E8A4 /* iAd.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 963909611BCBFD4200A2E8A4 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963909601BCBFD4200A2E8A4 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 963909941BCBFF8D00A2E8A4 /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639096A1BCBFF8D00A2E8A4 /* ADJActivityHandler.m */; }; - 963909951BCBFF8D00A2E8A4 /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639096C1BCBFF8D00A2E8A4 /* ADJActivityKind.m */; }; - 963909961BCBFF8D00A2E8A4 /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639096E1BCBFF8D00A2E8A4 /* ADJActivityPackage.m */; }; - 963909971BCBFF8D00A2E8A4 /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909701BCBFF8D00A2E8A4 /* ADJActivityState.m */; }; - 963909981BCBFF8D00A2E8A4 /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909731BCBFF8D00A2E8A4 /* NSData+ADJAdditions.m */; }; - 963909991BCBFF8D00A2E8A4 /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909751BCBFF8D00A2E8A4 /* NSString+ADJAdditions.m */; }; - 9639099A1BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909771BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.m */; }; - 9639099B1BCBFF8D00A2E8A4 /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909791BCBFF8D00A2E8A4 /* ADJAdjustFactory.m */; }; - 9639099C1BCBFF8D00A2E8A4 /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639097B1BCBFF8D00A2E8A4 /* ADJAttribution.m */; }; - 9639099D1BCBFF8D00A2E8A4 /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639097D1BCBFF8D00A2E8A4 /* ADJAttributionHandler.m */; }; - 9639099E1BCBFF8D00A2E8A4 /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639097F1BCBFF8D00A2E8A4 /* ADJConfig.m */; }; - 9639099F1BCBFF8D00A2E8A4 /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909811BCBFF8D00A2E8A4 /* ADJDeviceInfo.m */; }; - 963909A01BCBFF8D00A2E8A4 /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909831BCBFF8D00A2E8A4 /* ADJEvent.m */; }; - 963909A11BCBFF8D00A2E8A4 /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909851BCBFF8D00A2E8A4 /* ADJLogger.m */; }; - 963909A21BCBFF8D00A2E8A4 /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909871BCBFF8D00A2E8A4 /* ADJPackageBuilder.m */; }; - 963909A31BCBFF8D00A2E8A4 /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909891BCBFF8D00A2E8A4 /* ADJPackageHandler.m */; }; - 963909A41BCBFF8D00A2E8A4 /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639098B1BCBFF8D00A2E8A4 /* ADJRequestHandler.m */; }; - 963909A51BCBFF8D00A2E8A4 /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639098D1BCBFF8D00A2E8A4 /* ADJTimerCycle.m */; }; - 963909A61BCBFF8D00A2E8A4 /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9639098F1BCBFF8D00A2E8A4 /* ADJTimerOnce.m */; }; - 963909A71BCBFF8D00A2E8A4 /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909911BCBFF8D00A2E8A4 /* Adjust.m */; }; - 963909A81BCBFF8D00A2E8A4 /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909931BCBFF8D00A2E8A4 /* ADJUtil.m */; }; - 964E17FD1D50C6250097770B /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 964E17FC1D50C6250097770B /* SafariServices.framework */; }; - 96BA940B1C3D57FD00C96245 /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 96BA94091C3D57FD00C96245 /* ADJSessionFailure.m */; }; - 96BA940C1C3D57FD00C96245 /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 96BA940A1C3D57FD00C96245 /* ADJSessionSuccess.m */; }; - 96E423CA1C85F3B50006729A /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E423C71C85F3B50006729A /* ADJEventFailure.m */; }; - 96E423CB1C85F3B50006729A /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 96E423C91C85F3B50006729A /* ADJEventSuccess.m */; }; - 96FCC5441C18643E007BBFE1 /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 96FCC5411C18643E007BBFE1 /* ADJResponseData.m */; }; - 9DAA08B71D2A835E001C04E4 /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA08B61D2A835E001C04E4 /* ADJTrackingPixel.m */; }; + 964E17FD1D50C6250097770B /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 964E17FC1D50C6250097770B /* SafariServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 9DAC2DEB1C0F611300AC9D97 /* URLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAC2DEA1C0F611300AC9D97 /* URLRequest.m */; }; + 9DB457B31D743AB4004D69E8 /* AdjustSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DB457B21D743AB4004D69E8 /* AdjustSdk.framework */; }; 9DC95F261C104CEF00138E4B /* ViewControlleriOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F251C104CEF00138E4B /* ViewControlleriOS.m */; }; 9DC95F2A1C10515300138E4B /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F291C10515300138E4B /* Constants.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 96164D8E1CCA4E1C009431AB /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; - 96164D8F1CCA4E1C009431AB /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; - 96164D901CCA4E1C009431AB /* ADJSdkClickHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandler.h; sourceTree = ""; }; - 96164D911CCA4E1C009431AB /* ADJSdkClickHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandler.m; sourceTree = ""; }; - 96164D921CCA4E1C009431AB /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; - 96164D931CCA4E1C009431AB /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; 9639093C1BCBFCF300A2E8A4 /* AdjustExample-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AdjustExample-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 963909401BCBFCF300A2E8A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 963909421BCBFCF300A2E8A4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -67,63 +32,10 @@ 963909501BCBFCF300A2E8A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9639095E1BCBFD3B00A2E8A4 /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; 963909601BCBFD4200A2E8A4 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; - 963909691BCBFF8D00A2E8A4 /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; - 9639096A1BCBFF8D00A2E8A4 /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; - 9639096B1BCBFF8D00A2E8A4 /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; - 9639096C1BCBFF8D00A2E8A4 /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; - 9639096D1BCBFF8D00A2E8A4 /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; - 9639096E1BCBFF8D00A2E8A4 /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; - 9639096F1BCBFF8D00A2E8A4 /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; - 963909701BCBFF8D00A2E8A4 /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; - 963909721BCBFF8D00A2E8A4 /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; - 963909731BCBFF8D00A2E8A4 /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; - 963909741BCBFF8D00A2E8A4 /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; - 963909751BCBFF8D00A2E8A4 /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; - 963909761BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; - 963909771BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; - 963909781BCBFF8D00A2E8A4 /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; - 963909791BCBFF8D00A2E8A4 /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; - 9639097A1BCBFF8D00A2E8A4 /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; - 9639097B1BCBFF8D00A2E8A4 /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; - 9639097C1BCBFF8D00A2E8A4 /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; - 9639097D1BCBFF8D00A2E8A4 /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; - 9639097E1BCBFF8D00A2E8A4 /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; - 9639097F1BCBFF8D00A2E8A4 /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; - 963909801BCBFF8D00A2E8A4 /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; - 963909811BCBFF8D00A2E8A4 /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; - 963909821BCBFF8D00A2E8A4 /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; - 963909831BCBFF8D00A2E8A4 /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; - 963909841BCBFF8D00A2E8A4 /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; - 963909851BCBFF8D00A2E8A4 /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; - 963909861BCBFF8D00A2E8A4 /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; - 963909871BCBFF8D00A2E8A4 /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; - 963909881BCBFF8D00A2E8A4 /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; - 963909891BCBFF8D00A2E8A4 /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; - 9639098A1BCBFF8D00A2E8A4 /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; - 9639098B1BCBFF8D00A2E8A4 /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; - 9639098C1BCBFF8D00A2E8A4 /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; - 9639098D1BCBFF8D00A2E8A4 /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; - 9639098E1BCBFF8D00A2E8A4 /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; - 9639098F1BCBFF8D00A2E8A4 /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; - 963909901BCBFF8D00A2E8A4 /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; - 963909911BCBFF8D00A2E8A4 /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; - 963909921BCBFF8D00A2E8A4 /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; - 963909931BCBFF8D00A2E8A4 /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; 964E17FC1D50C6250097770B /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; }; - 96BA94071C3D57FD00C96245 /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; - 96BA94081C3D57FD00C96245 /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; - 96BA94091C3D57FD00C96245 /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; - 96BA940A1C3D57FD00C96245 /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; - 96E423C61C85F3B50006729A /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; - 96E423C71C85F3B50006729A /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; - 96E423C81C85F3B50006729A /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; - 96E423C91C85F3B50006729A /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; - 96FCC5401C18643E007BBFE1 /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; - 96FCC5411C18643E007BBFE1 /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; - 9DAA08B51D2A835E001C04E4 /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; - 9DAA08B61D2A835E001C04E4 /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; 9DAC2DE91C0F611300AC9D97 /* URLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLRequest.h; sourceTree = ""; }; 9DAC2DEA1C0F611300AC9D97 /* URLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = URLRequest.m; sourceTree = ""; }; + 9DB457B21D743AB4004D69E8 /* AdjustSdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdjustSdk.framework; path = Adjust/AdjustSdk.framework; sourceTree = ""; }; 9DC95F241C104CEF00138E4B /* ViewControlleriOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewControlleriOS.h; sourceTree = ""; }; 9DC95F251C104CEF00138E4B /* ViewControlleriOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewControlleriOS.m; sourceTree = ""; }; 9DC95F281C10515300138E4B /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; @@ -135,9 +47,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 964E17FD1D50C6250097770B /* SafariServices.framework in Frameworks */, - 963909611BCBFD4200A2E8A4 /* AdSupport.framework in Frameworks */, 9639095F1BCBFD3B00A2E8A4 /* iAd.framework in Frameworks */, + 9DB457B31D743AB4004D69E8 /* AdjustSdk.framework in Frameworks */, + 963909611BCBFD4200A2E8A4 /* AdSupport.framework in Frameworks */, + 964E17FD1D50C6250097770B /* SafariServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -149,7 +62,6 @@ children = ( 9639093E1BCBFCF300A2E8A4 /* AdjustExample-iOS */, 9639093D1BCBFCF300A2E8A4 /* Products */, - 964E17FB1D50C6240097770B /* Frameworks */, ); sourceTree = ""; }; @@ -185,101 +97,18 @@ isa = PBXGroup; children = ( 9DF7ACCB1CB50DC800D3591F /* Frameworks */, - 963909681BCBFF8D00A2E8A4 /* Adjust */, 963909401BCBFCF300A2E8A4 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; - 963909681BCBFF8D00A2E8A4 /* Adjust */ = { - isa = PBXGroup; - children = ( - 9DAA08B51D2A835E001C04E4 /* ADJTrackingPixel.h */, - 9DAA08B61D2A835E001C04E4 /* ADJTrackingPixel.m */, - 96164D8E1CCA4E1C009431AB /* ADJBackoffStrategy.h */, - 96164D8F1CCA4E1C009431AB /* ADJBackoffStrategy.m */, - 96164D901CCA4E1C009431AB /* ADJSdkClickHandler.h */, - 96164D911CCA4E1C009431AB /* ADJSdkClickHandler.m */, - 96164D921CCA4E1C009431AB /* ADJSystemProfile.h */, - 96164D931CCA4E1C009431AB /* ADJSystemProfile.m */, - 96E423C61C85F3B50006729A /* ADJEventFailure.h */, - 96E423C71C85F3B50006729A /* ADJEventFailure.m */, - 96E423C81C85F3B50006729A /* ADJEventSuccess.h */, - 96E423C91C85F3B50006729A /* ADJEventSuccess.m */, - 96BA94071C3D57FD00C96245 /* ADJSessionSuccess.h */, - 96BA94081C3D57FD00C96245 /* ADJSessionFailure.h */, - 96BA94091C3D57FD00C96245 /* ADJSessionFailure.m */, - 96BA940A1C3D57FD00C96245 /* ADJSessionSuccess.m */, - 96FCC5401C18643E007BBFE1 /* ADJResponseData.h */, - 96FCC5411C18643E007BBFE1 /* ADJResponseData.m */, - 963909691BCBFF8D00A2E8A4 /* ADJActivityHandler.h */, - 9639096A1BCBFF8D00A2E8A4 /* ADJActivityHandler.m */, - 9639096B1BCBFF8D00A2E8A4 /* ADJActivityKind.h */, - 9639096C1BCBFF8D00A2E8A4 /* ADJActivityKind.m */, - 9639096D1BCBFF8D00A2E8A4 /* ADJActivityPackage.h */, - 9639096E1BCBFF8D00A2E8A4 /* ADJActivityPackage.m */, - 9639096F1BCBFF8D00A2E8A4 /* ADJActivityState.h */, - 963909701BCBFF8D00A2E8A4 /* ADJActivityState.m */, - 963909711BCBFF8D00A2E8A4 /* ADJAdditions */, - 963909781BCBFF8D00A2E8A4 /* ADJAdjustFactory.h */, - 963909791BCBFF8D00A2E8A4 /* ADJAdjustFactory.m */, - 9639097A1BCBFF8D00A2E8A4 /* ADJAttribution.h */, - 9639097B1BCBFF8D00A2E8A4 /* ADJAttribution.m */, - 9639097C1BCBFF8D00A2E8A4 /* ADJAttributionHandler.h */, - 9639097D1BCBFF8D00A2E8A4 /* ADJAttributionHandler.m */, - 9639097E1BCBFF8D00A2E8A4 /* ADJConfig.h */, - 9639097F1BCBFF8D00A2E8A4 /* ADJConfig.m */, - 963909801BCBFF8D00A2E8A4 /* ADJDeviceInfo.h */, - 963909811BCBFF8D00A2E8A4 /* ADJDeviceInfo.m */, - 963909821BCBFF8D00A2E8A4 /* ADJEvent.h */, - 963909831BCBFF8D00A2E8A4 /* ADJEvent.m */, - 963909841BCBFF8D00A2E8A4 /* ADJLogger.h */, - 963909851BCBFF8D00A2E8A4 /* ADJLogger.m */, - 963909861BCBFF8D00A2E8A4 /* ADJPackageBuilder.h */, - 963909871BCBFF8D00A2E8A4 /* ADJPackageBuilder.m */, - 963909881BCBFF8D00A2E8A4 /* ADJPackageHandler.h */, - 963909891BCBFF8D00A2E8A4 /* ADJPackageHandler.m */, - 9639098A1BCBFF8D00A2E8A4 /* ADJRequestHandler.h */, - 9639098B1BCBFF8D00A2E8A4 /* ADJRequestHandler.m */, - 9639098C1BCBFF8D00A2E8A4 /* ADJTimerCycle.h */, - 9639098D1BCBFF8D00A2E8A4 /* ADJTimerCycle.m */, - 9639098E1BCBFF8D00A2E8A4 /* ADJTimerOnce.h */, - 9639098F1BCBFF8D00A2E8A4 /* ADJTimerOnce.m */, - 963909901BCBFF8D00A2E8A4 /* Adjust.h */, - 963909911BCBFF8D00A2E8A4 /* Adjust.m */, - 963909921BCBFF8D00A2E8A4 /* ADJUtil.h */, - 963909931BCBFF8D00A2E8A4 /* ADJUtil.m */, - ); - name = Adjust; - path = ../../../Adjust; - sourceTree = ""; - }; - 963909711BCBFF8D00A2E8A4 /* ADJAdditions */ = { - isa = PBXGroup; - children = ( - 963909721BCBFF8D00A2E8A4 /* NSData+ADJAdditions.h */, - 963909731BCBFF8D00A2E8A4 /* NSData+ADJAdditions.m */, - 963909741BCBFF8D00A2E8A4 /* NSString+ADJAdditions.h */, - 963909751BCBFF8D00A2E8A4 /* NSString+ADJAdditions.m */, - 963909761BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.h */, - 963909771BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.m */, - ); - path = ADJAdditions; - sourceTree = ""; - }; - 964E17FB1D50C6240097770B /* Frameworks */ = { - isa = PBXGroup; - children = ( - 964E17FC1D50C6250097770B /* SafariServices.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 9DF7ACCB1CB50DC800D3591F /* Frameworks */ = { isa = PBXGroup; children = ( - 963909601BCBFD4200A2E8A4 /* AdSupport.framework */, 9639095E1BCBFD3B00A2E8A4 /* iAd.framework */, + 9DB457B21D743AB4004D69E8 /* AdjustSdk.framework */, + 963909601BCBFD4200A2E8A4 /* AdSupport.framework */, + 964E17FC1D50C6250097770B /* SafariServices.framework */, ); name = Frameworks; sourceTree = ""; @@ -310,7 +139,7 @@ 963909341BCBFCF300A2E8A4 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = adjust; TargetAttributes = { 9639093B1BCBFCF300A2E8A4 = { @@ -354,40 +183,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9639099F1BCBFF8D00A2E8A4 /* ADJDeviceInfo.m in Sources */, - 963909A81BCBFF8D00A2E8A4 /* ADJUtil.m in Sources */, 9DAC2DEB1C0F611300AC9D97 /* URLRequest.m in Sources */, - 96BA940B1C3D57FD00C96245 /* ADJSessionFailure.m in Sources */, - 9639099D1BCBFF8D00A2E8A4 /* ADJAttributionHandler.m in Sources */, - 963909A21BCBFF8D00A2E8A4 /* ADJPackageBuilder.m in Sources */, - 96164D961CCA4E1C009431AB /* ADJSystemProfile.m in Sources */, - 963909A51BCBFF8D00A2E8A4 /* ADJTimerCycle.m in Sources */, - 963909A61BCBFF8D00A2E8A4 /* ADJTimerOnce.m in Sources */, 9DC95F2A1C10515300138E4B /* Constants.m in Sources */, - 963909951BCBFF8D00A2E8A4 /* ADJActivityKind.m in Sources */, - 9639099A1BCBFF8D00A2E8A4 /* UIDevice+ADJAdditions.m in Sources */, - 963909971BCBFF8D00A2E8A4 /* ADJActivityState.m in Sources */, - 96BA940C1C3D57FD00C96245 /* ADJSessionSuccess.m in Sources */, - 963909A11BCBFF8D00A2E8A4 /* ADJLogger.m in Sources */, - 963909961BCBFF8D00A2E8A4 /* ADJActivityPackage.m in Sources */, - 96E423CA1C85F3B50006729A /* ADJEventFailure.m in Sources */, - 96FCC5441C18643E007BBFE1 /* ADJResponseData.m in Sources */, - 963909A01BCBFF8D00A2E8A4 /* ADJEvent.m in Sources */, - 963909A31BCBFF8D00A2E8A4 /* ADJPackageHandler.m in Sources */, - 963909981BCBFF8D00A2E8A4 /* NSData+ADJAdditions.m in Sources */, - 963909A41BCBFF8D00A2E8A4 /* ADJRequestHandler.m in Sources */, - 96164D951CCA4E1C009431AB /* ADJSdkClickHandler.m in Sources */, - 963909941BCBFF8D00A2E8A4 /* ADJActivityHandler.m in Sources */, - 963909991BCBFF8D00A2E8A4 /* NSString+ADJAdditions.m in Sources */, - 963909A71BCBFF8D00A2E8A4 /* Adjust.m in Sources */, - 9639099E1BCBFF8D00A2E8A4 /* ADJConfig.m in Sources */, 963909441BCBFCF300A2E8A4 /* AppDelegate.m in Sources */, - 9639099B1BCBFF8D00A2E8A4 /* ADJAdjustFactory.m in Sources */, 963909411BCBFCF300A2E8A4 /* main.m in Sources */, - 96E423CB1C85F3B50006729A /* ADJEventSuccess.m in Sources */, - 9DAA08B71D2A835E001C04E4 /* ADJTrackingPixel.m in Sources */, - 96164D941CCA4E1C009431AB /* ADJBackoffStrategy.m in Sources */, - 9639099C1BCBFF8D00A2E8A4 /* ADJAttribution.m in Sources */, 9DC95F261C104CEF00138E4B /* ViewControlleriOS.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -501,10 +300,16 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-iOS/Adjust", + ); INFOPLIST_FILE = "AdjustExample-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iOS"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -514,10 +319,16 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = BrandAsset; + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-iOS/Adjust", + ); INFOPLIST_FILE = "AdjustExample-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iOS"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/AdjustSdk b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/AdjustSdk new file mode 120000 index 000000000..010b1f0e7 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/AdjustSdk @@ -0,0 +1 @@ +Versions/Current/AdjustSdk \ No newline at end of file diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Headers b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Headers new file mode 120000 index 000000000..a177d2a6b --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk new file mode 100644 index 000000000..888a3875b Binary files /dev/null and b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk differ diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h new file mode 100644 index 000000000..21faee13e --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h @@ -0,0 +1,43 @@ +// +// ADJAttribution.h +// adjust +// +// Created by Pedro Filipe on 29/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJAttribution : NSObject + +// the following attributes are only set when error is nil +// (when activity was tracked successfully and response could be parsed) + +// tracker token of current device +@property (nonatomic, copy) NSString *trackerToken; + +// tracker name of current device +@property (nonatomic, copy) NSString *trackerName; + +// tracker network +@property (nonatomic, copy) NSString *network; + +// tracker campaign +@property (nonatomic, copy) NSString *campaign; + +// tracker adgroup +@property (nonatomic, copy) NSString *adgroup; + +// tracker creative +@property (nonatomic, copy) NSString *creative; + +// tracker click_label +@property (nonatomic, copy) NSString *clickLabel; + +- (BOOL)isEqualToAttribution:(ADJAttribution *)attribution; + ++ (ADJAttribution *)dataWithJsonDict:(NSDictionary *)jsonDict; +- (id)initWithJsonDict:(NSDictionary *)jsonDict; +- (NSDictionary *)dictionary; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h new file mode 100644 index 000000000..1774c80c7 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h @@ -0,0 +1,177 @@ +// +// ADJConfig.h +// adjust +// +// Created by Pedro Filipe on 30/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import +#import "ADJLogger.h" +#import "ADJAttribution.h" +#import "ADJSessionSuccess.h" +#import "ADJSessionFailure.h" +#import "ADJEventSuccess.h" +#import "ADJEventFailure.h" + +/** + * Optional delegate that will get informed about tracking results + */ +@protocol AdjustDelegate +@optional + +/** + * Optional delegate method that gets called when the attribution information changed + * + * @param attribution The attribution information. + * See ADJAttribution for details + */ +- (void)adjustAttributionChanged:(ADJAttribution *)attribution; + +/** + * Optional delegate method that gets called when an event is tracked with success + * + * @param eventSuccessResponseData The response information from tracking with success + * See ADJEventSuccess for details + */ +- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData; + +/** + * Optional delegate method that gets called when an event is tracked with failure + * + * @param eventFailureResponseData The response information from tracking with failure + * See ADJEventFailure for details + */ +- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with success + * + * @param sessionSuccessResponseData The response information from tracking with success + * See ADJSessionSuccess for details + */ +- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with failure + * + * @param sessionFailureResponseData The response information from tracking with failure + * See ADJSessionFailure for details + */ +- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData; + +/** + * Optional delegate method that gets called when a deeplink is about to be opened by the adjust SDK + * + * @param deeplink The deeplink url that was received by the adjust SDK to be opened + * @return boolean Value that indicates whether the deeplink should be opened by the adjust SDK + */ +- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink; + +@end + +@interface ADJConfig : NSObject + +@property (nonatomic, copy) NSString *sdkPrefix; +@property (nonatomic, copy) NSString *defaultTracker; +@property (nonatomic, copy, readonly) NSString *appToken; +@property (nonatomic, copy, readonly) NSString *environment; + +/** + * Configuration object for the initialization of the Adjust SDK + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment; + +/** + * Configuration object for the initialization of the Adjust SDK. + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + * @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress + * and replaces the default value for production environment + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; + +/** + * Change the verbosity of Adjust's logs + * + * You can increase or reduce the amount of logs from Adjust by passing + * one of the following parameters. Use ADJLogLevelSuppress to disable all logging + * + * @var logLevel The desired minimum log level (default: info) + * Must be one of the following: + * - ADJLogLevelVerbose (enable all logging) + * - ADJLogLevelDebug (enable more logging) + * - ADJLogLevelInfo (the default) + * - ADJLogLevelWarn (disable info logging) + * - ADJLogLevelError (disable warnings as well) + * - ADJLogLevelAssert (disable errors as well) + * - ADJLogLevelSuppress (suppress all logging) + */ +@property (nonatomic, assign) ADJLogLevel logLevel; + +/** + * Enable event buffering if your app triggers a lot of events. + * When enabled, events get buffered and only get tracked each + * minute. Buffered events are still persisted, of course + * + * @var eventBufferingEnabled Enable or disable event buffering + */ +@property (nonatomic, assign) BOOL eventBufferingEnabled; + +/** + * Set the optional delegate that will inform you about attribution or events + * + * See the AdjustDelegate declaration above for details + * + * @var delegate The delegate that might implement the optional delegate methods + */ +@property (nonatomic, weak) NSObject *delegate; + +/** + * Enables sending in the background + * + * @var sendInBackground Enable or disable sending in the background + */ +@property (nonatomic, assign) BOOL sendInBackground; + +/** + * Enables delayed start of the SDK + * + * @var delayStart Number of seconds after which SDK will start + */ +@property (nonatomic, assign) double delayStart; + +/** + * User agent for the requests. + * + * @var userAgent User agent value. + */ +@property (nonatomic, copy) NSString *userAgent; + +@property (nonatomic, assign, readonly) BOOL hasResponseDelegate; +@property (nonatomic, assign, readonly) BOOL hasAttributionChangedDelegate; + +- (BOOL) isValid; +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h new file mode 100644 index 000000000..7fcb8881d --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h @@ -0,0 +1,89 @@ +// +// ADJEvent.h +// adjust +// +// Created by Pedro Filipe on 15/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEvent : NSObject + +@property (nonatomic, copy, readonly) NSString* eventToken; +@property (nonatomic, copy, readonly) NSNumber* revenue; +@property (nonatomic, readonly) NSDictionary* callbackParameters; +@property (nonatomic, readonly) NSDictionary* partnerParameters; +@property (nonatomic, copy, readonly) NSString* transactionId; +@property (nonatomic, copy, readonly) NSString* currency; +@property (nonatomic, copy, readonly) NSData* receipt; +@property (nonatomic, assign, readonly) BOOL emptyReceipt; + +/** + * Create Event object with Event Token. + * + * @param eventToken Event token that is created in the dashboard + * at http://adjust.com and should be six characters long. + */ ++ (ADJEvent *)eventWithEventToken:(NSString *)eventToken; +- (id) initWithEventToken:(NSString *)eventToken; + +/** + * Add a key-pair to a callback URL. + * + * In your dashboard at http://adjust.com you can assign a callback URL to each + * event type. That URL will get called every time the event is triggered. On + * top of that you can add callback parameters to the following method that + * will be forwarded to these callbacks. + * + * @param key String key in the callback URL. + * @param value String value of the key in the Callback URL. + * + */ +- (void) addCallbackParameter:(NSString *)key + value:(NSString *)value; + +/** + * Add a key-pair to be fowarded to a partner. + * + * @param key String key to be fowarded to the partner + * @param value String value of the key to be fowarded to the partner + * + */ +- (void) addPartnerParameter:(NSString *)key + value:(NSString *)value; + +/** + * Set the revenue and associated currency of the event. + * + * The event can contain some revenue. The amount revenue is measured in units. + * It must include a currency in the ISO 4217 format. + * + * @param amount The amount in units (example: for 1.50 EUR is 1.5) + * @param currency String of the currency with ISO 4217 format. + * It should be 3 characters long (example: for 1.50 EUR is @"EUR") + */ +- (void) setRevenue:(double)amount currency:(NSString *)currency; + +/** + * Set the transaction ID of a In-App Purchases to avoid revenue duplications. + * + * A transaction ID can be used to avoid duplicate revenue events. The last ten + * transaction identifiers are remembered. + * + * @param transactionId The identifier used to avoid duplicate revenue events + */ +- (void) setTransactionId:(NSString *)transactionId; + +- (BOOL) isValid; + +/** + * + * Validate a in-app-purchase receipt. + * + * @param receipt The receipt to validate + * @param transactionId The identifier used to validate the receipt and to avoid duplicate revenue events + */ +- (void) setReceipt:(NSData *)receipt transactionId:(NSString *)transactionId; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h new file mode 100644 index 000000000..46ef36d16 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h @@ -0,0 +1,34 @@ +// +// ADJEventFailure.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventFailure *)eventFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h new file mode 100644 index 000000000..ce2abb1bd --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h @@ -0,0 +1,31 @@ +// +// ADJEventSuccess.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventSuccess *)eventSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h new file mode 100644 index 000000000..89f02f159 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h @@ -0,0 +1,39 @@ +// +// ADJLogger.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-11-15. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// +#import + +typedef enum { + ADJLogLevelVerbose = 1, + ADJLogLevelDebug = 2, + ADJLogLevelInfo = 3, + ADJLogLevelWarn = 4, + ADJLogLevelError = 5, + ADJLogLevelAssert = 6, + ADJLogLevelSuppress = 7 +} ADJLogLevel; + +// A simple logger with multiple log levels. +@protocol ADJLogger + +- (void)setLogLevel:(ADJLogLevel)logLevel; +- (void)lockLogLevel; + +- (void)verbose:(NSString *)message, ...; +- (void)debug: (NSString *)message, ...; +- (void)info: (NSString *)message, ...; +- (void)warn: (NSString *)message, ...; +- (void)error: (NSString *)message, ...; +- (void)assert: (NSString *)message, ...; + +@end + +@interface ADJLogger : NSObject + ++ (ADJLogLevel) LogLevelFromString: (NSString *) logLevelString; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h new file mode 100644 index 000000000..25681f03b --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h @@ -0,0 +1,31 @@ +// +// ADJFailureResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionFailure *)sessionFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h new file mode 100644 index 000000000..5533928bc --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h @@ -0,0 +1,28 @@ +// +// ADJSuccessResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionSuccess *)sessionSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h new file mode 100644 index 000000000..337479af3 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h @@ -0,0 +1,201 @@ +// +// Adjust.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-07-23. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// + +#import "ADJEvent.h" +#import "ADJAttribution.h" +#import "ADJConfig.h" + +/** + * Constants for our supported tracking environments + */ +extern NSString * const ADJEnvironmentSandbox; +extern NSString * const ADJEnvironmentProduction; + +/** + * The main interface to Adjust + * + * Use the methods of this class to tell Adjust about the usage of your app. + * See the README for details. + */ +@interface Adjust : NSObject + +/** + * Tell Adjust that the application did launch + * + * This is required to initialize Adjust. Call this in the didFinishLaunching + * method of your AppDelegate. + * + * See ADJConfig.h for more configuration options + * + * @param adjustConfig The configuration object that includes the environment + * and the App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long. + */ ++ (void)appDidLaunch:(ADJConfig *)adjustConfig; + +/** + * Tell Adjust that a particular event has happened + * + * See ADJEvent.h for more event options. + * + * @param event The Event object for this kind of event. It needs a event token + * that is created in the dashboard at http://adjust.com and should be six + * characters long. + */ ++ (void)trackEvent:(ADJEvent *)event; + +/** + * Tell adjust that the application resumed + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionStart; + +/** + * Tell adjust that the application paused + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionEnd; + +/** + * Enable or disable the adjust SDK. This setting is saved for future sessions + * + * @param enabled The flag to enable or disable the adjust SDK + */ ++ (void)setEnabled:(BOOL)enabled; + +/** + * Check if the SDK is enabled or disabled + * + * return Boolean indicating whether SDK is enabled or not + */ ++ (BOOL)isEnabled; + +/** + * Read the URL that opened the application to search for an adjust deep link + * + * @param url URL object which contains info about adjust deep link + */ ++ (void)appWillOpenUrl:(NSURL *)url; + +/** + * Set the device token used by push notifications + * + * @param deviceToken Apple push notification token for iOS device + */ ++ (void)setDeviceToken:(NSData *)deviceToken; + +/** + * Enable or disable offline mode. Activities won't be sent but they are saved when + * offline mode is disabled. This feature is not saved for future sessions + * + * @param enabled The flag to enable or disable offline mode + */ ++ (void)setOfflineMode:(BOOL)enabled; + +/** + * Convert a universal link style url to a deeplink style url with the corresponding scheme + * + * @param url URL object which contains info about adjust deep link + * @param scheme Desired scheme to which you want your resulting URL object to be prefixed with + * + * @return URL object in custom URL scheme style prefixed with given scheme name + */ ++ (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +/** + * Retrieve iOS device IDFA value + * + * @return Device IDFA value + */ ++ (NSString *)idfa; + +/** + * Tell the adjust SDK to stop waiting for delayed initialisation timer to complete but rather to start + * upon this call. This should be called if you have obtained needed callback/partner parameters which you + * wanted to put as default ones before the delayedStart value you have set on ADJConfig has expired + */ ++ (void)sendFirstPackages; + +/** + * Tell adjust to send the request to Google and check if the installation + * belongs to Google AdWords campaign + */ ++ (void)sendAdWordsRequest; + +/** + * Add default callback parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default callback parameter key + * @param value Default callback parameter value + */ ++ (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +/** + * Add default partner parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default partner parameter key + * @param value Default partner parameter value + */ ++ (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; + +/** + * Remove default callback parameter from the session packages + * + * @param key Default callback parameter key + */ ++ (void)removeSessionCallbackParameter:(NSString *)key; + +/** + * Remove default partner parameter from the session packages + * + * @param key Default partner parameter key + */ ++ (void)removeSessionPartnerParameter:(NSString *)key; + +/** + * Remove all default callback parameters from the session packages + */ ++ (void)resetSessionCallbackParameters; + +/** + * Remove all default partner parameters from the session packages + */ ++ (void)resetSessionPartnerParameters; + +/** + * Obtain singleton Adjust object + */ ++ (id)getInstance; + +- (void)appDidLaunch:(ADJConfig *)adjustConfig; +- (void)trackEvent:(ADJEvent *)event; +- (void)setEnabled:(BOOL)enabled; +- (void)teardown:(BOOL)deleteState; +- (void)appWillOpenUrl:(NSURL *)url; +- (void)setOfflineMode:(BOOL)enabled; +- (void)setDeviceToken:(NSData *)deviceToken; + +- (BOOL)isEnabled; +- (NSString *)idfa; +- (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +- (void)sendFirstPackages; +- (void)sendAdWordsRequest; +- (void)trackSubsessionEnd; +- (void)trackSubsessionStart; +- (void)resetSessionPartnerParameters; +- (void)resetSessionCallbackParameters; +- (void)removeSessionPartnerParameter:(NSString *)key; +- (void)removeSessionCallbackParameter:(NSString *)key; +- (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; +- (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +@end diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/Current b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/Current new file mode 120000 index 000000000..8c7e5a667 --- /dev/null +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Adjust/AdjustSdk.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h index 057d819a6..295ddf8af 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.h @@ -7,8 +7,7 @@ // #import - -#import "Adjust.h" +#import @interface AppDelegate : UIResponder diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m index 89a7e11ed..60beb4892 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/AppDelegate.m @@ -8,7 +8,6 @@ #import "Constants.h" #import "AppDelegate.h" -#import "ADJSystemProfile.h" @interface AppDelegate () @@ -42,6 +41,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Set an attribution delegate. [adjustConfig setDelegate:self]; + // delay the first session of the SDK + //[adjustConfig setDelayStart:7]; + + // set an attribution delegate + // Initialise the SDK. [Adjust appDidLaunch:adjustConfig]; diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard b/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard index 8dd53dd56..07bd0253a 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - - + + - - + + @@ -22,7 +22,7 @@ - + @@ -32,7 +32,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -112,7 +112,7 @@ - + diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/Info.plist b/examples/AdjustExample-iOS/AdjustExample-iOS/Info.plist index 38f415851..29c46b24c 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/Info.plist +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/Info.plist @@ -22,10 +22,10 @@ CFBundleURLName - com.adjust.AdjustExample-iOS + com.adjust.example CFBundleURLSchemes - adjustexampleios + adjustExample diff --git a/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.m b/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.m index b3aba1028..a67c6720e 100644 --- a/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.m +++ b/examples/AdjustExample-iOS/AdjustExample-iOS/ViewControlleriOS.m @@ -6,11 +6,12 @@ // Copyright © 2015 adjust. All rights reserved. // -#import "Adjust.h" #import "Constants.h" #import "URLRequest.h" #import "ViewControlleriOS.h" +#import + @interface ViewControlleriOS () @property (weak, nonatomic) IBOutlet UIButton *btnTrackSimpleEvent; diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit App/Info.plist b/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit App/Info.plist index af0b0aef7..279fcdb0e 100644 --- a/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit App/Info.plist +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit App/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion en CFBundleDisplayName - AdjustExample-iWatch WatchKit App + Adjust Example CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -28,7 +28,7 @@ UIInterfaceOrientationPortraitUpsideDown WKCompanionAppBundleIdentifier - com.adjust.AdjustExample-iWatch + com.adjust.example WKWatchKitApp diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit Extension/Info.plist b/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit Extension/Info.plist index 9b92a5835..e4d9f525e 100644 --- a/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit Extension/Info.plist +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch WatchKit Extension/Info.plist @@ -27,7 +27,7 @@ NSExtensionAttributes WKAppBundleIdentifier - com.adjust.AdjustExample-iWatch.watchkitapp + com.adjust.example.watchkitapp NSExtensionPointIdentifier com.apple.watchkit diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch.xcodeproj/project.pbxproj b/examples/AdjustExample-iWatch/AdjustExample-iWatch.xcodeproj/project.pbxproj index d25749e1c..7440eda33 100644 --- a/examples/AdjustExample-iWatch/AdjustExample-iWatch.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch.xcodeproj/project.pbxproj @@ -7,10 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 96164DA61CCA4E54009431AB /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164DA11CCA4E54009431AB /* ADJBackoffStrategy.m */; }; - 96164DA71CCA4E54009431AB /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164DA31CCA4E54009431AB /* ADJSdkClickHandler.m */; }; - 96164DA81CCA4E54009431AB /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164DA51CCA4E54009431AB /* ADJSystemProfile.m */; }; - 9DAA08B11D2A8302001C04E4 /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA08B01D2A8302001C04E4 /* ADJTrackingPixel.m */; }; 9DF7AC191CB4FEDB00D3591F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC181CB4FEDB00D3591F /* main.m */; }; 9DF7AC1C1CB4FEDB00D3591F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC1B1CB4FEDB00D3591F /* AppDelegate.m */; }; 9DF7AC1F1CB4FEDB00D3591F /* ViewControllerWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC1E1CB4FEDB00D3591F /* ViewControllerWatch.m */; }; @@ -24,40 +20,16 @@ 9DF7AC411CB4FEDB00D3591F /* InterfaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC401CB4FEDB00D3591F /* InterfaceController.m */; }; 9DF7AC441CB4FEDB00D3591F /* ExtensionDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC431CB4FEDB00D3591F /* ExtensionDelegate.m */; }; 9DF7AC461CB4FEDB00D3591F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9DF7AC451CB4FEDB00D3591F /* Assets.xcassets */; }; - 9DF7AC981CB4FF1800D3591F /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC631CB4FF1800D3591F /* ADJActivityHandler.m */; }; - 9DF7AC991CB4FF1800D3591F /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC651CB4FF1800D3591F /* ADJActivityKind.m */; }; - 9DF7AC9A1CB4FF1800D3591F /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC671CB4FF1800D3591F /* ADJActivityPackage.m */; }; - 9DF7AC9B1CB4FF1800D3591F /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC691CB4FF1800D3591F /* ADJActivityState.m */; }; - 9DF7AC9C1CB4FF1800D3591F /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC6C1CB4FF1800D3591F /* NSData+ADJAdditions.m */; }; - 9DF7AC9D1CB4FF1800D3591F /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC6E1CB4FF1800D3591F /* NSString+ADJAdditions.m */; }; - 9DF7AC9E1CB4FF1800D3591F /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC701CB4FF1800D3591F /* UIDevice+ADJAdditions.m */; }; - 9DF7AC9F1CB4FF1800D3591F /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC721CB4FF1800D3591F /* ADJAdjustFactory.m */; }; - 9DF7ACA01CB4FF1800D3591F /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC741CB4FF1800D3591F /* ADJAttribution.m */; }; - 9DF7ACA11CB4FF1800D3591F /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC761CB4FF1800D3591F /* ADJAttributionHandler.m */; }; - 9DF7ACA21CB4FF1800D3591F /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC781CB4FF1800D3591F /* ADJConfig.m */; }; - 9DF7ACA31CB4FF1800D3591F /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC7A1CB4FF1800D3591F /* ADJDeviceInfo.m */; }; - 9DF7ACA41CB4FF1800D3591F /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC7C1CB4FF1800D3591F /* ADJEvent.m */; }; - 9DF7ACA51CB4FF1800D3591F /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC7E1CB4FF1800D3591F /* ADJEventFailure.m */; }; - 9DF7ACA61CB4FF1800D3591F /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC801CB4FF1800D3591F /* ADJEventSuccess.m */; }; - 9DF7ACA71CB4FF1800D3591F /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC821CB4FF1800D3591F /* ADJLogger.m */; }; - 9DF7ACA81CB4FF1800D3591F /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC841CB4FF1800D3591F /* ADJPackageBuilder.m */; }; - 9DF7ACA91CB4FF1800D3591F /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC861CB4FF1800D3591F /* ADJPackageHandler.m */; }; - 9DF7ACAA1CB4FF1800D3591F /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC881CB4FF1800D3591F /* ADJRequestHandler.m */; }; - 9DF7ACAB1CB4FF1800D3591F /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC8A1CB4FF1800D3591F /* ADJResponseData.m */; }; - 9DF7ACAC1CB4FF1800D3591F /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC8C1CB4FF1800D3591F /* ADJSessionFailure.m */; }; - 9DF7ACAD1CB4FF1800D3591F /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC8E1CB4FF1800D3591F /* ADJSessionSuccess.m */; }; - 9DF7ACAE1CB4FF1800D3591F /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC901CB4FF1800D3591F /* ADJTimerCycle.m */; }; - 9DF7ACAF1CB4FF1800D3591F /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC921CB4FF1800D3591F /* ADJTimerOnce.m */; }; - 9DF7ACB01CB4FF1800D3591F /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC941CB4FF1800D3591F /* Adjust.m */; }; - 9DF7ACB11CB4FF1800D3591F /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AC961CB4FF1800D3591F /* ADJUtil.m */; }; - 9DF7ACB21CB4FF1800D3591F /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DF7AC971CB4FF1800D3591F /* Info.plist */; }; 9DF7ACB71CB4FF6400D3591F /* AdjustLoggingHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7ACB41CB4FF6400D3591F /* AdjustLoggingHelper.m */; }; 9DF7ACB81CB4FF6400D3591F /* AdjustTrackingHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7ACB61CB4FF6400D3591F /* AdjustTrackingHelper.m */; }; - 9DF7ACBB1CB5024700D3591F /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DF7ACBA1CB5024700D3591F /* iAd.framework */; }; - 9DF7ACBD1CB5024C00D3591F /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DF7ACBC1CB5024C00D3591F /* AdSupport.framework */; }; - 9DF7ACBF1CB5025100D3591F /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DF7ACBE1CB5025100D3591F /* CoreFoundation.framework */; }; 9DF7ACC81CB5032900D3591F /* EventTrackedController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7ACC51CB5032900D3591F /* EventTrackedController.m */; }; 9DF7ACC91CB5032900D3591F /* TableRowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7ACC71CB5032900D3591F /* TableRowController.m */; }; + 9DFB04CE1D745D28006D48FC /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04CD1D745D28006D48FC /* CoreFoundation.framework */; }; + 9DFB04D01D745D5C006D48FC /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04CF1D745D5C006D48FC /* CoreFoundation.framework */; }; + 9DFB04D21D745D60006D48FC /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04D11D745D60006D48FC /* iAd.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 9DFB04D41D745D65006D48FC /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04D31D745D65006D48FC /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 9DFB04D61D745D69006D48FC /* SafariServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04D51D745D69006D48FC /* SafariServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 9DFB04D81D745D71006D48FC /* AdjustSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB04D71D745D71006D48FC /* AdjustSdk.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -103,14 +75,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 96164DA01CCA4E54009431AB /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; - 96164DA11CCA4E54009431AB /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; - 96164DA21CCA4E54009431AB /* ADJSdkClickHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandler.h; sourceTree = ""; }; - 96164DA31CCA4E54009431AB /* ADJSdkClickHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandler.m; sourceTree = ""; }; - 96164DA41CCA4E54009431AB /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; - 96164DA51CCA4E54009431AB /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; - 9DAA08AF1D2A8301001C04E4 /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; - 9DAA08B01D2A8302001C04E4 /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; 9DF7AC141CB4FEDB00D3591F /* AdjustExample-iWatch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AdjustExample-iWatch.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 9DF7AC181CB4FEDB00D3591F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 9DF7AC1A1CB4FEDB00D3591F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -132,70 +96,20 @@ 9DF7AC431CB4FEDB00D3591F /* ExtensionDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExtensionDelegate.m; sourceTree = ""; }; 9DF7AC451CB4FEDB00D3591F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9DF7AC471CB4FEDB00D3591F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9DF7AC621CB4FF1800D3591F /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; - 9DF7AC631CB4FF1800D3591F /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; - 9DF7AC641CB4FF1800D3591F /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; - 9DF7AC651CB4FF1800D3591F /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; - 9DF7AC661CB4FF1800D3591F /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; - 9DF7AC671CB4FF1800D3591F /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; - 9DF7AC681CB4FF1800D3591F /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; - 9DF7AC691CB4FF1800D3591F /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; - 9DF7AC6B1CB4FF1800D3591F /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; - 9DF7AC6C1CB4FF1800D3591F /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; - 9DF7AC6D1CB4FF1800D3591F /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; - 9DF7AC6E1CB4FF1800D3591F /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; - 9DF7AC6F1CB4FF1800D3591F /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; - 9DF7AC701CB4FF1800D3591F /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; - 9DF7AC711CB4FF1800D3591F /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; - 9DF7AC721CB4FF1800D3591F /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; - 9DF7AC731CB4FF1800D3591F /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; - 9DF7AC741CB4FF1800D3591F /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; - 9DF7AC751CB4FF1800D3591F /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; - 9DF7AC761CB4FF1800D3591F /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; - 9DF7AC771CB4FF1800D3591F /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; - 9DF7AC781CB4FF1800D3591F /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; - 9DF7AC791CB4FF1800D3591F /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; - 9DF7AC7A1CB4FF1800D3591F /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; - 9DF7AC7B1CB4FF1800D3591F /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; - 9DF7AC7C1CB4FF1800D3591F /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; - 9DF7AC7D1CB4FF1800D3591F /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; - 9DF7AC7E1CB4FF1800D3591F /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; - 9DF7AC7F1CB4FF1800D3591F /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; - 9DF7AC801CB4FF1800D3591F /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; - 9DF7AC811CB4FF1800D3591F /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; - 9DF7AC821CB4FF1800D3591F /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; - 9DF7AC831CB4FF1800D3591F /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; - 9DF7AC841CB4FF1800D3591F /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; - 9DF7AC851CB4FF1800D3591F /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; - 9DF7AC861CB4FF1800D3591F /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; - 9DF7AC871CB4FF1800D3591F /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; - 9DF7AC881CB4FF1800D3591F /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; - 9DF7AC891CB4FF1800D3591F /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; - 9DF7AC8A1CB4FF1800D3591F /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; - 9DF7AC8B1CB4FF1800D3591F /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; - 9DF7AC8C1CB4FF1800D3591F /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; - 9DF7AC8D1CB4FF1800D3591F /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; - 9DF7AC8E1CB4FF1800D3591F /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; - 9DF7AC8F1CB4FF1800D3591F /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; - 9DF7AC901CB4FF1800D3591F /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; - 9DF7AC911CB4FF1800D3591F /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; - 9DF7AC921CB4FF1800D3591F /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; - 9DF7AC931CB4FF1800D3591F /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; - 9DF7AC941CB4FF1800D3591F /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; - 9DF7AC951CB4FF1800D3591F /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; - 9DF7AC961CB4FF1800D3591F /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; - 9DF7AC971CB4FF1800D3591F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9DF7ACB31CB4FF6400D3591F /* AdjustLoggingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustLoggingHelper.h; sourceTree = ""; }; 9DF7ACB41CB4FF6400D3591F /* AdjustLoggingHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustLoggingHelper.m; sourceTree = ""; }; 9DF7ACB51CB4FF6400D3591F /* AdjustTrackingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustTrackingHelper.h; sourceTree = ""; }; 9DF7ACB61CB4FF6400D3591F /* AdjustTrackingHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustTrackingHelper.m; sourceTree = ""; }; - 9DF7ACBA1CB5024700D3591F /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; - 9DF7ACBC1CB5024C00D3591F /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; - 9DF7ACBE1CB5025100D3591F /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 9DF7ACC41CB5032900D3591F /* EventTrackedController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTrackedController.h; sourceTree = ""; }; 9DF7ACC51CB5032900D3591F /* EventTrackedController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EventTrackedController.m; sourceTree = ""; }; 9DF7ACC61CB5032900D3591F /* TableRowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableRowController.h; sourceTree = ""; }; 9DF7ACC71CB5032900D3591F /* TableRowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableRowController.m; sourceTree = ""; }; + 9DFB04CD1D745D28006D48FC /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS2.2.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; }; + 9DFB04CF1D745D5C006D48FC /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + 9DFB04D11D745D60006D48FC /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; + 9DFB04D31D745D65006D48FC /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; + 9DFB04D51D745D69006D48FC /* SafariServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SafariServices.framework; path = System/Library/Frameworks/SafariServices.framework; sourceTree = SDKROOT; }; + 9DFB04D71D745D71006D48FC /* AdjustSdk.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdjustSdk.framework; path = Adjust/AdjustSdk.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -203,9 +117,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9DF7ACBF1CB5025100D3591F /* CoreFoundation.framework in Frameworks */, - 9DF7ACBD1CB5024C00D3591F /* AdSupport.framework in Frameworks */, - 9DF7ACBB1CB5024700D3591F /* iAd.framework in Frameworks */, + 9DFB04D21D745D60006D48FC /* iAd.framework in Frameworks */, + 9DFB04D81D745D71006D48FC /* AdjustSdk.framework in Frameworks */, + 9DFB04D41D745D65006D48FC /* AdSupport.framework in Frameworks */, + 9DFB04D61D745D69006D48FC /* SafariServices.framework in Frameworks */, + 9DFB04D01D745D5C006D48FC /* CoreFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -213,6 +129,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 9DFB04CE1D745D28006D48FC /* CoreFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -263,7 +180,6 @@ isa = PBXGroup; children = ( 9DF7ACB91CB5022200D3591F /* Frameworks */, - 9DF7AC611CB4FF1800D3591F /* Adjust */, 9DF7AC181CB4FEDB00D3591F /* main.m */, ); name = "Supporting Files"; @@ -296,89 +212,15 @@ path = "AdjustExample-iWatch WatchKit Extension"; sourceTree = ""; }; - 9DF7AC611CB4FF1800D3591F /* Adjust */ = { - isa = PBXGroup; - children = ( - 9DAA08AF1D2A8301001C04E4 /* ADJTrackingPixel.h */, - 9DAA08B01D2A8302001C04E4 /* ADJTrackingPixel.m */, - 96164DA01CCA4E54009431AB /* ADJBackoffStrategy.h */, - 96164DA11CCA4E54009431AB /* ADJBackoffStrategy.m */, - 96164DA21CCA4E54009431AB /* ADJSdkClickHandler.h */, - 96164DA31CCA4E54009431AB /* ADJSdkClickHandler.m */, - 96164DA41CCA4E54009431AB /* ADJSystemProfile.h */, - 96164DA51CCA4E54009431AB /* ADJSystemProfile.m */, - 9DF7AC621CB4FF1800D3591F /* ADJActivityHandler.h */, - 9DF7AC631CB4FF1800D3591F /* ADJActivityHandler.m */, - 9DF7AC641CB4FF1800D3591F /* ADJActivityKind.h */, - 9DF7AC651CB4FF1800D3591F /* ADJActivityKind.m */, - 9DF7AC661CB4FF1800D3591F /* ADJActivityPackage.h */, - 9DF7AC671CB4FF1800D3591F /* ADJActivityPackage.m */, - 9DF7AC681CB4FF1800D3591F /* ADJActivityState.h */, - 9DF7AC691CB4FF1800D3591F /* ADJActivityState.m */, - 9DF7AC6A1CB4FF1800D3591F /* ADJAdditions */, - 9DF7AC711CB4FF1800D3591F /* ADJAdjustFactory.h */, - 9DF7AC721CB4FF1800D3591F /* ADJAdjustFactory.m */, - 9DF7AC731CB4FF1800D3591F /* ADJAttribution.h */, - 9DF7AC741CB4FF1800D3591F /* ADJAttribution.m */, - 9DF7AC751CB4FF1800D3591F /* ADJAttributionHandler.h */, - 9DF7AC761CB4FF1800D3591F /* ADJAttributionHandler.m */, - 9DF7AC771CB4FF1800D3591F /* ADJConfig.h */, - 9DF7AC781CB4FF1800D3591F /* ADJConfig.m */, - 9DF7AC791CB4FF1800D3591F /* ADJDeviceInfo.h */, - 9DF7AC7A1CB4FF1800D3591F /* ADJDeviceInfo.m */, - 9DF7AC7B1CB4FF1800D3591F /* ADJEvent.h */, - 9DF7AC7C1CB4FF1800D3591F /* ADJEvent.m */, - 9DF7AC7D1CB4FF1800D3591F /* ADJEventFailure.h */, - 9DF7AC7E1CB4FF1800D3591F /* ADJEventFailure.m */, - 9DF7AC7F1CB4FF1800D3591F /* ADJEventSuccess.h */, - 9DF7AC801CB4FF1800D3591F /* ADJEventSuccess.m */, - 9DF7AC811CB4FF1800D3591F /* ADJLogger.h */, - 9DF7AC821CB4FF1800D3591F /* ADJLogger.m */, - 9DF7AC831CB4FF1800D3591F /* ADJPackageBuilder.h */, - 9DF7AC841CB4FF1800D3591F /* ADJPackageBuilder.m */, - 9DF7AC851CB4FF1800D3591F /* ADJPackageHandler.h */, - 9DF7AC861CB4FF1800D3591F /* ADJPackageHandler.m */, - 9DF7AC871CB4FF1800D3591F /* ADJRequestHandler.h */, - 9DF7AC881CB4FF1800D3591F /* ADJRequestHandler.m */, - 9DF7AC891CB4FF1800D3591F /* ADJResponseData.h */, - 9DF7AC8A1CB4FF1800D3591F /* ADJResponseData.m */, - 9DF7AC8B1CB4FF1800D3591F /* ADJSessionFailure.h */, - 9DF7AC8C1CB4FF1800D3591F /* ADJSessionFailure.m */, - 9DF7AC8D1CB4FF1800D3591F /* ADJSessionSuccess.h */, - 9DF7AC8E1CB4FF1800D3591F /* ADJSessionSuccess.m */, - 9DF7AC8F1CB4FF1800D3591F /* ADJTimerCycle.h */, - 9DF7AC901CB4FF1800D3591F /* ADJTimerCycle.m */, - 9DF7AC911CB4FF1800D3591F /* ADJTimerOnce.h */, - 9DF7AC921CB4FF1800D3591F /* ADJTimerOnce.m */, - 9DF7AC931CB4FF1800D3591F /* Adjust.h */, - 9DF7AC941CB4FF1800D3591F /* Adjust.m */, - 9DF7AC951CB4FF1800D3591F /* ADJUtil.h */, - 9DF7AC961CB4FF1800D3591F /* ADJUtil.m */, - 9DF7AC971CB4FF1800D3591F /* Info.plist */, - ); - name = Adjust; - path = ../../../Adjust; - sourceTree = ""; - }; - 9DF7AC6A1CB4FF1800D3591F /* ADJAdditions */ = { - isa = PBXGroup; - children = ( - 9DF7AC6B1CB4FF1800D3591F /* NSData+ADJAdditions.h */, - 9DF7AC6C1CB4FF1800D3591F /* NSData+ADJAdditions.m */, - 9DF7AC6D1CB4FF1800D3591F /* NSString+ADJAdditions.h */, - 9DF7AC6E1CB4FF1800D3591F /* NSString+ADJAdditions.m */, - 9DF7AC6F1CB4FF1800D3591F /* UIDevice+ADJAdditions.h */, - 9DF7AC701CB4FF1800D3591F /* UIDevice+ADJAdditions.m */, - ); - path = ADJAdditions; - sourceTree = ""; - }; 9DF7ACB91CB5022200D3591F /* Frameworks */ = { isa = PBXGroup; children = ( - 9DF7ACBE1CB5025100D3591F /* CoreFoundation.framework */, - 9DF7ACBC1CB5024C00D3591F /* AdSupport.framework */, - 9DF7ACBA1CB5024700D3591F /* iAd.framework */, + 9DFB04D11D745D60006D48FC /* iAd.framework */, + 9DFB04D71D745D71006D48FC /* AdjustSdk.framework */, + 9DFB04D31D745D65006D48FC /* AdSupport.framework */, + 9DFB04D51D745D69006D48FC /* SafariServices.framework */, + 9DFB04CF1D745D5C006D48FC /* CoreFoundation.framework */, + 9DFB04CD1D745D28006D48FC /* CoreFoundation.framework */, ); name = Frameworks; sourceTree = ""; @@ -484,7 +326,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9DF7ACB21CB4FF1800D3591F /* Info.plist in Resources */, 9DF7AC271CB4FEDB00D3591F /* LaunchScreen.storyboard in Resources */, 9DF7AC241CB4FEDB00D3591F /* Assets.xcassets in Resources */, 9DF7AC221CB4FEDB00D3591F /* Main.storyboard in Resources */, @@ -515,41 +356,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9DF7ACA31CB4FF1800D3591F /* ADJDeviceInfo.m in Sources */, - 9DF7ACAF1CB4FF1800D3591F /* ADJTimerOnce.m in Sources */, - 9DF7ACA11CB4FF1800D3591F /* ADJAttributionHandler.m in Sources */, - 9DF7ACA91CB4FF1800D3591F /* ADJPackageHandler.m in Sources */, - 9DF7AC991CB4FF1800D3591F /* ADJActivityKind.m in Sources */, - 9DF7AC9E1CB4FF1800D3591F /* UIDevice+ADJAdditions.m in Sources */, - 96164DA81CCA4E54009431AB /* ADJSystemProfile.m in Sources */, 9DF7ACB81CB4FF6400D3591F /* AdjustTrackingHelper.m in Sources */, - 9DF7AC9B1CB4FF1800D3591F /* ADJActivityState.m in Sources */, - 9DF7AC9A1CB4FF1800D3591F /* ADJActivityPackage.m in Sources */, - 9DF7ACA41CB4FF1800D3591F /* ADJEvent.m in Sources */, - 9DF7ACAD1CB4FF1800D3591F /* ADJSessionSuccess.m in Sources */, 9DF7AC1F1CB4FEDB00D3591F /* ViewControllerWatch.m in Sources */, - 9DF7ACA61CB4FF1800D3591F /* ADJEventSuccess.m in Sources */, - 9DF7ACAA1CB4FF1800D3591F /* ADJRequestHandler.m in Sources */, - 9DF7AC9C1CB4FF1800D3591F /* NSData+ADJAdditions.m in Sources */, - 9DF7ACA51CB4FF1800D3591F /* ADJEventFailure.m in Sources */, - 9DF7AC981CB4FF1800D3591F /* ADJActivityHandler.m in Sources */, - 9DF7ACB11CB4FF1800D3591F /* ADJUtil.m in Sources */, - 9DF7AC9D1CB4FF1800D3591F /* NSString+ADJAdditions.m in Sources */, - 9DF7ACA21CB4FF1800D3591F /* ADJConfig.m in Sources */, 9DF7AC1C1CB4FEDB00D3591F /* AppDelegate.m in Sources */, - 96164DA71CCA4E54009431AB /* ADJSdkClickHandler.m in Sources */, - 9DF7ACAC1CB4FF1800D3591F /* ADJSessionFailure.m in Sources */, - 9DF7ACAB1CB4FF1800D3591F /* ADJResponseData.m in Sources */, - 9DF7ACA71CB4FF1800D3591F /* ADJLogger.m in Sources */, - 9DF7ACB01CB4FF1800D3591F /* Adjust.m in Sources */, - 9DF7ACA81CB4FF1800D3591F /* ADJPackageBuilder.m in Sources */, - 9DF7AC9F1CB4FF1800D3591F /* ADJAdjustFactory.m in Sources */, 9DF7ACB71CB4FF6400D3591F /* AdjustLoggingHelper.m in Sources */, 9DF7AC191CB4FEDB00D3591F /* main.m in Sources */, - 9DAA08B11D2A8302001C04E4 /* ADJTrackingPixel.m in Sources */, - 96164DA61CCA4E54009431AB /* ADJBackoffStrategy.m in Sources */, - 9DF7ACAE1CB4FF1800D3591F /* ADJTimerCycle.m in Sources */, - 9DF7ACA01CB4FF1800D3591F /* ADJAttribution.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -644,9 +455,10 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; }; name = Debug; @@ -682,8 +494,9 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -694,7 +507,8 @@ buildSettings = { INFOPLIST_FILE = "AdjustExample-iWatch WatchKit Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iWatch.watchkitapp.watchkitextension"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; SKIP_INSTALL = YES; @@ -708,7 +522,8 @@ buildSettings = { INFOPLIST_FILE = "AdjustExample-iWatch WatchKit Extension/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iWatch.watchkitapp.watchkitextension"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; SKIP_INSTALL = YES; @@ -723,7 +538,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; IBSC_MODULE = AdjustExample_iWatch_WatchKit_Extension; INFOPLIST_FILE = "AdjustExample-iWatch WatchKit App/Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iWatch.watchkitapp"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; @@ -738,7 +554,8 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; IBSC_MODULE = AdjustExample_iWatch_WatchKit_Extension; INFOPLIST_FILE = "AdjustExample-iWatch WatchKit App/Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iWatch.watchkitapp"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; @@ -751,10 +568,15 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-iWatch/Adjust", + ); INFOPLIST_FILE = "AdjustExample-iWatch/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iWatch"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -763,10 +585,15 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-iWatch/Adjust", + ); INFOPLIST_FILE = "AdjustExample-iWatch/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-iWatch"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/AdjustSdk b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/AdjustSdk new file mode 120000 index 000000000..010b1f0e7 --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/AdjustSdk @@ -0,0 +1 @@ +Versions/Current/AdjustSdk \ No newline at end of file diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Headers b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Headers new file mode 120000 index 000000000..a177d2a6b --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk new file mode 100644 index 000000000..888a3875b Binary files /dev/null and b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/AdjustSdk differ diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h new file mode 100644 index 000000000..21faee13e --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJAttribution.h @@ -0,0 +1,43 @@ +// +// ADJAttribution.h +// adjust +// +// Created by Pedro Filipe on 29/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJAttribution : NSObject + +// the following attributes are only set when error is nil +// (when activity was tracked successfully and response could be parsed) + +// tracker token of current device +@property (nonatomic, copy) NSString *trackerToken; + +// tracker name of current device +@property (nonatomic, copy) NSString *trackerName; + +// tracker network +@property (nonatomic, copy) NSString *network; + +// tracker campaign +@property (nonatomic, copy) NSString *campaign; + +// tracker adgroup +@property (nonatomic, copy) NSString *adgroup; + +// tracker creative +@property (nonatomic, copy) NSString *creative; + +// tracker click_label +@property (nonatomic, copy) NSString *clickLabel; + +- (BOOL)isEqualToAttribution:(ADJAttribution *)attribution; + ++ (ADJAttribution *)dataWithJsonDict:(NSDictionary *)jsonDict; +- (id)initWithJsonDict:(NSDictionary *)jsonDict; +- (NSDictionary *)dictionary; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h new file mode 100644 index 000000000..1774c80c7 --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJConfig.h @@ -0,0 +1,177 @@ +// +// ADJConfig.h +// adjust +// +// Created by Pedro Filipe on 30/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import +#import "ADJLogger.h" +#import "ADJAttribution.h" +#import "ADJSessionSuccess.h" +#import "ADJSessionFailure.h" +#import "ADJEventSuccess.h" +#import "ADJEventFailure.h" + +/** + * Optional delegate that will get informed about tracking results + */ +@protocol AdjustDelegate +@optional + +/** + * Optional delegate method that gets called when the attribution information changed + * + * @param attribution The attribution information. + * See ADJAttribution for details + */ +- (void)adjustAttributionChanged:(ADJAttribution *)attribution; + +/** + * Optional delegate method that gets called when an event is tracked with success + * + * @param eventSuccessResponseData The response information from tracking with success + * See ADJEventSuccess for details + */ +- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData; + +/** + * Optional delegate method that gets called when an event is tracked with failure + * + * @param eventFailureResponseData The response information from tracking with failure + * See ADJEventFailure for details + */ +- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with success + * + * @param sessionSuccessResponseData The response information from tracking with success + * See ADJSessionSuccess for details + */ +- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with failure + * + * @param sessionFailureResponseData The response information from tracking with failure + * See ADJSessionFailure for details + */ +- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData; + +/** + * Optional delegate method that gets called when a deeplink is about to be opened by the adjust SDK + * + * @param deeplink The deeplink url that was received by the adjust SDK to be opened + * @return boolean Value that indicates whether the deeplink should be opened by the adjust SDK + */ +- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink; + +@end + +@interface ADJConfig : NSObject + +@property (nonatomic, copy) NSString *sdkPrefix; +@property (nonatomic, copy) NSString *defaultTracker; +@property (nonatomic, copy, readonly) NSString *appToken; +@property (nonatomic, copy, readonly) NSString *environment; + +/** + * Configuration object for the initialization of the Adjust SDK + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment; + +/** + * Configuration object for the initialization of the Adjust SDK. + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + * @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress + * and replaces the default value for production environment + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; + +/** + * Change the verbosity of Adjust's logs + * + * You can increase or reduce the amount of logs from Adjust by passing + * one of the following parameters. Use ADJLogLevelSuppress to disable all logging + * + * @var logLevel The desired minimum log level (default: info) + * Must be one of the following: + * - ADJLogLevelVerbose (enable all logging) + * - ADJLogLevelDebug (enable more logging) + * - ADJLogLevelInfo (the default) + * - ADJLogLevelWarn (disable info logging) + * - ADJLogLevelError (disable warnings as well) + * - ADJLogLevelAssert (disable errors as well) + * - ADJLogLevelSuppress (suppress all logging) + */ +@property (nonatomic, assign) ADJLogLevel logLevel; + +/** + * Enable event buffering if your app triggers a lot of events. + * When enabled, events get buffered and only get tracked each + * minute. Buffered events are still persisted, of course + * + * @var eventBufferingEnabled Enable or disable event buffering + */ +@property (nonatomic, assign) BOOL eventBufferingEnabled; + +/** + * Set the optional delegate that will inform you about attribution or events + * + * See the AdjustDelegate declaration above for details + * + * @var delegate The delegate that might implement the optional delegate methods + */ +@property (nonatomic, weak) NSObject *delegate; + +/** + * Enables sending in the background + * + * @var sendInBackground Enable or disable sending in the background + */ +@property (nonatomic, assign) BOOL sendInBackground; + +/** + * Enables delayed start of the SDK + * + * @var delayStart Number of seconds after which SDK will start + */ +@property (nonatomic, assign) double delayStart; + +/** + * User agent for the requests. + * + * @var userAgent User agent value. + */ +@property (nonatomic, copy) NSString *userAgent; + +@property (nonatomic, assign, readonly) BOOL hasResponseDelegate; +@property (nonatomic, assign, readonly) BOOL hasAttributionChangedDelegate; + +- (BOOL) isValid; +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h new file mode 100644 index 000000000..7fcb8881d --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEvent.h @@ -0,0 +1,89 @@ +// +// ADJEvent.h +// adjust +// +// Created by Pedro Filipe on 15/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEvent : NSObject + +@property (nonatomic, copy, readonly) NSString* eventToken; +@property (nonatomic, copy, readonly) NSNumber* revenue; +@property (nonatomic, readonly) NSDictionary* callbackParameters; +@property (nonatomic, readonly) NSDictionary* partnerParameters; +@property (nonatomic, copy, readonly) NSString* transactionId; +@property (nonatomic, copy, readonly) NSString* currency; +@property (nonatomic, copy, readonly) NSData* receipt; +@property (nonatomic, assign, readonly) BOOL emptyReceipt; + +/** + * Create Event object with Event Token. + * + * @param eventToken Event token that is created in the dashboard + * at http://adjust.com and should be six characters long. + */ ++ (ADJEvent *)eventWithEventToken:(NSString *)eventToken; +- (id) initWithEventToken:(NSString *)eventToken; + +/** + * Add a key-pair to a callback URL. + * + * In your dashboard at http://adjust.com you can assign a callback URL to each + * event type. That URL will get called every time the event is triggered. On + * top of that you can add callback parameters to the following method that + * will be forwarded to these callbacks. + * + * @param key String key in the callback URL. + * @param value String value of the key in the Callback URL. + * + */ +- (void) addCallbackParameter:(NSString *)key + value:(NSString *)value; + +/** + * Add a key-pair to be fowarded to a partner. + * + * @param key String key to be fowarded to the partner + * @param value String value of the key to be fowarded to the partner + * + */ +- (void) addPartnerParameter:(NSString *)key + value:(NSString *)value; + +/** + * Set the revenue and associated currency of the event. + * + * The event can contain some revenue. The amount revenue is measured in units. + * It must include a currency in the ISO 4217 format. + * + * @param amount The amount in units (example: for 1.50 EUR is 1.5) + * @param currency String of the currency with ISO 4217 format. + * It should be 3 characters long (example: for 1.50 EUR is @"EUR") + */ +- (void) setRevenue:(double)amount currency:(NSString *)currency; + +/** + * Set the transaction ID of a In-App Purchases to avoid revenue duplications. + * + * A transaction ID can be used to avoid duplicate revenue events. The last ten + * transaction identifiers are remembered. + * + * @param transactionId The identifier used to avoid duplicate revenue events + */ +- (void) setTransactionId:(NSString *)transactionId; + +- (BOOL) isValid; + +/** + * + * Validate a in-app-purchase receipt. + * + * @param receipt The receipt to validate + * @param transactionId The identifier used to validate the receipt and to avoid duplicate revenue events + */ +- (void) setReceipt:(NSData *)receipt transactionId:(NSString *)transactionId; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h new file mode 100644 index 000000000..46ef36d16 --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventFailure.h @@ -0,0 +1,34 @@ +// +// ADJEventFailure.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventFailure *)eventFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h new file mode 100644 index 000000000..ce2abb1bd --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJEventSuccess.h @@ -0,0 +1,31 @@ +// +// ADJEventSuccess.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventSuccess *)eventSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h new file mode 100644 index 000000000..89f02f159 --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJLogger.h @@ -0,0 +1,39 @@ +// +// ADJLogger.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-11-15. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// +#import + +typedef enum { + ADJLogLevelVerbose = 1, + ADJLogLevelDebug = 2, + ADJLogLevelInfo = 3, + ADJLogLevelWarn = 4, + ADJLogLevelError = 5, + ADJLogLevelAssert = 6, + ADJLogLevelSuppress = 7 +} ADJLogLevel; + +// A simple logger with multiple log levels. +@protocol ADJLogger + +- (void)setLogLevel:(ADJLogLevel)logLevel; +- (void)lockLogLevel; + +- (void)verbose:(NSString *)message, ...; +- (void)debug: (NSString *)message, ...; +- (void)info: (NSString *)message, ...; +- (void)warn: (NSString *)message, ...; +- (void)error: (NSString *)message, ...; +- (void)assert: (NSString *)message, ...; + +@end + +@interface ADJLogger : NSObject + ++ (ADJLogLevel) LogLevelFromString: (NSString *) logLevelString; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h new file mode 100644 index 000000000..25681f03b --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionFailure.h @@ -0,0 +1,31 @@ +// +// ADJFailureResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionFailure *)sessionFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h new file mode 100644 index 000000000..5533928bc --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/ADJSessionSuccess.h @@ -0,0 +1,28 @@ +// +// ADJSuccessResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionSuccess *)sessionSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h new file mode 100644 index 000000000..337479af3 --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/A/Headers/Adjust.h @@ -0,0 +1,201 @@ +// +// Adjust.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-07-23. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// + +#import "ADJEvent.h" +#import "ADJAttribution.h" +#import "ADJConfig.h" + +/** + * Constants for our supported tracking environments + */ +extern NSString * const ADJEnvironmentSandbox; +extern NSString * const ADJEnvironmentProduction; + +/** + * The main interface to Adjust + * + * Use the methods of this class to tell Adjust about the usage of your app. + * See the README for details. + */ +@interface Adjust : NSObject + +/** + * Tell Adjust that the application did launch + * + * This is required to initialize Adjust. Call this in the didFinishLaunching + * method of your AppDelegate. + * + * See ADJConfig.h for more configuration options + * + * @param adjustConfig The configuration object that includes the environment + * and the App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long. + */ ++ (void)appDidLaunch:(ADJConfig *)adjustConfig; + +/** + * Tell Adjust that a particular event has happened + * + * See ADJEvent.h for more event options. + * + * @param event The Event object for this kind of event. It needs a event token + * that is created in the dashboard at http://adjust.com and should be six + * characters long. + */ ++ (void)trackEvent:(ADJEvent *)event; + +/** + * Tell adjust that the application resumed + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionStart; + +/** + * Tell adjust that the application paused + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionEnd; + +/** + * Enable or disable the adjust SDK. This setting is saved for future sessions + * + * @param enabled The flag to enable or disable the adjust SDK + */ ++ (void)setEnabled:(BOOL)enabled; + +/** + * Check if the SDK is enabled or disabled + * + * return Boolean indicating whether SDK is enabled or not + */ ++ (BOOL)isEnabled; + +/** + * Read the URL that opened the application to search for an adjust deep link + * + * @param url URL object which contains info about adjust deep link + */ ++ (void)appWillOpenUrl:(NSURL *)url; + +/** + * Set the device token used by push notifications + * + * @param deviceToken Apple push notification token for iOS device + */ ++ (void)setDeviceToken:(NSData *)deviceToken; + +/** + * Enable or disable offline mode. Activities won't be sent but they are saved when + * offline mode is disabled. This feature is not saved for future sessions + * + * @param enabled The flag to enable or disable offline mode + */ ++ (void)setOfflineMode:(BOOL)enabled; + +/** + * Convert a universal link style url to a deeplink style url with the corresponding scheme + * + * @param url URL object which contains info about adjust deep link + * @param scheme Desired scheme to which you want your resulting URL object to be prefixed with + * + * @return URL object in custom URL scheme style prefixed with given scheme name + */ ++ (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +/** + * Retrieve iOS device IDFA value + * + * @return Device IDFA value + */ ++ (NSString *)idfa; + +/** + * Tell the adjust SDK to stop waiting for delayed initialisation timer to complete but rather to start + * upon this call. This should be called if you have obtained needed callback/partner parameters which you + * wanted to put as default ones before the delayedStart value you have set on ADJConfig has expired + */ ++ (void)sendFirstPackages; + +/** + * Tell adjust to send the request to Google and check if the installation + * belongs to Google AdWords campaign + */ ++ (void)sendAdWordsRequest; + +/** + * Add default callback parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default callback parameter key + * @param value Default callback parameter value + */ ++ (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +/** + * Add default partner parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default partner parameter key + * @param value Default partner parameter value + */ ++ (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; + +/** + * Remove default callback parameter from the session packages + * + * @param key Default callback parameter key + */ ++ (void)removeSessionCallbackParameter:(NSString *)key; + +/** + * Remove default partner parameter from the session packages + * + * @param key Default partner parameter key + */ ++ (void)removeSessionPartnerParameter:(NSString *)key; + +/** + * Remove all default callback parameters from the session packages + */ ++ (void)resetSessionCallbackParameters; + +/** + * Remove all default partner parameters from the session packages + */ ++ (void)resetSessionPartnerParameters; + +/** + * Obtain singleton Adjust object + */ ++ (id)getInstance; + +- (void)appDidLaunch:(ADJConfig *)adjustConfig; +- (void)trackEvent:(ADJEvent *)event; +- (void)setEnabled:(BOOL)enabled; +- (void)teardown:(BOOL)deleteState; +- (void)appWillOpenUrl:(NSURL *)url; +- (void)setOfflineMode:(BOOL)enabled; +- (void)setDeviceToken:(NSData *)deviceToken; + +- (BOOL)isEnabled; +- (NSString *)idfa; +- (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +- (void)sendFirstPackages; +- (void)sendAdWordsRequest; +- (void)trackSubsessionEnd; +- (void)trackSubsessionStart; +- (void)resetSessionPartnerParameters; +- (void)resetSessionCallbackParameters; +- (void)removeSessionPartnerParameter:(NSString *)key; +- (void)removeSessionCallbackParameter:(NSString *)key; +- (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; +- (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +@end diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/Current b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/Current new file mode 120000 index 000000000..8c7e5a667 --- /dev/null +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/Adjust/AdjustSdk.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/AdjustTrackingHelper.m b/examples/AdjustExample-iWatch/AdjustExample-iWatch/AdjustTrackingHelper.m index e9085f465..6e9a142f7 100644 --- a/examples/AdjustExample-iWatch/AdjustExample-iWatch/AdjustTrackingHelper.m +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/AdjustTrackingHelper.m @@ -6,9 +6,10 @@ // Copyright (c) 2015 adjust GmbH. All rights reserved. // -#import "Adjust.h" -#import "AdjustTrackingHelper.h" #import +#import + +#import "AdjustTrackingHelper.h" @implementation AdjustTrackingHelper diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/AppDelegate.h b/examples/AdjustExample-iWatch/AdjustExample-iWatch/AppDelegate.h index f1370f595..18e86a7e6 100644 --- a/examples/AdjustExample-iWatch/AdjustExample-iWatch/AppDelegate.h +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/AppDelegate.h @@ -7,7 +7,7 @@ // #import -#import "Adjust.h" +#import @interface AppDelegate : UIResponder diff --git a/examples/AdjustExample-iWatch/AdjustExample-iWatch/ViewControllerWatch.m b/examples/AdjustExample-iWatch/AdjustExample-iWatch/ViewControllerWatch.m index 83860041f..a2491c0db 100644 --- a/examples/AdjustExample-iWatch/AdjustExample-iWatch/ViewControllerWatch.m +++ b/examples/AdjustExample-iWatch/AdjustExample-iWatch/ViewControllerWatch.m @@ -6,7 +6,8 @@ // Copyright © 2016 adjust GmbH. All rights reserved. // -#import "Adjust.h" +#import + #import "ViewControllerWatch.h" #import "AdjustTrackingHelper.h" diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj b/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj index 6ca2d1f02..73b8d71d2 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.pbxproj @@ -7,54 +7,18 @@ objects = { /* Begin PBXBuildFile section */ - 96164D9D1CCA4E3A009431AB /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D981CCA4E3A009431AB /* ADJBackoffStrategy.m */; }; - 96164D9E1CCA4E3A009431AB /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D9A1CCA4E3A009431AB /* ADJSdkClickHandler.m */; }; - 96164D9F1CCA4E3A009431AB /* ADJSystemProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 96164D9C1CCA4E3A009431AB /* ADJSystemProfile.m */; }; 963909B71BCC0D8300A2E8A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909B61BCC0D8300A2E8A4 /* main.m */; }; 963909BA1BCC0D8300A2E8A4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909B91BCC0D8300A2E8A4 /* AppDelegate.m */; }; 963909BD1BCC0D8300A2E8A4 /* ViewControllertvOS.m in Sources */ = {isa = PBXBuildFile; fileRef = 963909BC1BCC0D8300A2E8A4 /* ViewControllertvOS.m */; }; 963909C01BCC0D8300A2E8A4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 963909BE1BCC0D8300A2E8A4 /* Main.storyboard */; }; 963909C21BCC0D8300A2E8A4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 963909C11BCC0D8300A2E8A4 /* Assets.xcassets */; }; 963909D01BCC0DA600A2E8A4 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963909CF1BCC0DA600A2E8A4 /* AdSupport.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 9DAA08B41D2A831A001C04E4 /* ADJTrackingPixel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA08B31D2A831A001C04E4 /* ADJTrackingPixel.m */; }; 9DC95F2F1C10596500138E4B /* Constants.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F2E1C10596500138E4B /* Constants.m */; }; 9DC95F321C105B4C00138E4B /* URLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DC95F311C105B4C00138E4B /* URLRequest.m */; }; - 9DF7AA6B1CB4F52500D3591F /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA361CB4F52400D3591F /* ADJActivityHandler.m */; }; - 9DF7AA6C1CB4F52500D3591F /* ADJActivityKind.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA381CB4F52400D3591F /* ADJActivityKind.m */; }; - 9DF7AA6D1CB4F52500D3591F /* ADJActivityPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA3A1CB4F52400D3591F /* ADJActivityPackage.m */; }; - 9DF7AA6E1CB4F52500D3591F /* ADJActivityState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA3C1CB4F52400D3591F /* ADJActivityState.m */; }; - 9DF7AA6F1CB4F52500D3591F /* NSData+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA3F1CB4F52400D3591F /* NSData+ADJAdditions.m */; }; - 9DF7AA701CB4F52500D3591F /* NSString+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA411CB4F52400D3591F /* NSString+ADJAdditions.m */; }; - 9DF7AA711CB4F52500D3591F /* UIDevice+ADJAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA431CB4F52400D3591F /* UIDevice+ADJAdditions.m */; }; - 9DF7AA721CB4F52500D3591F /* ADJAdjustFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA451CB4F52400D3591F /* ADJAdjustFactory.m */; }; - 9DF7AA731CB4F52500D3591F /* ADJAttribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA471CB4F52500D3591F /* ADJAttribution.m */; }; - 9DF7AA741CB4F52500D3591F /* ADJAttributionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA491CB4F52500D3591F /* ADJAttributionHandler.m */; }; - 9DF7AA751CB4F52500D3591F /* ADJConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA4B1CB4F52500D3591F /* ADJConfig.m */; }; - 9DF7AA761CB4F52500D3591F /* ADJDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA4D1CB4F52500D3591F /* ADJDeviceInfo.m */; }; - 9DF7AA771CB4F52500D3591F /* ADJEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA4F1CB4F52500D3591F /* ADJEvent.m */; }; - 9DF7AA781CB4F52500D3591F /* ADJEventFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA511CB4F52500D3591F /* ADJEventFailure.m */; }; - 9DF7AA791CB4F52500D3591F /* ADJEventSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA531CB4F52500D3591F /* ADJEventSuccess.m */; }; - 9DF7AA7A1CB4F52500D3591F /* ADJLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA551CB4F52500D3591F /* ADJLogger.m */; }; - 9DF7AA7B1CB4F52500D3591F /* ADJPackageBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA571CB4F52500D3591F /* ADJPackageBuilder.m */; }; - 9DF7AA7C1CB4F52500D3591F /* ADJPackageHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA591CB4F52500D3591F /* ADJPackageHandler.m */; }; - 9DF7AA7D1CB4F52500D3591F /* ADJRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA5B1CB4F52500D3591F /* ADJRequestHandler.m */; }; - 9DF7AA7E1CB4F52500D3591F /* ADJResponseData.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA5D1CB4F52500D3591F /* ADJResponseData.m */; }; - 9DF7AA7F1CB4F52500D3591F /* ADJSessionFailure.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA5F1CB4F52500D3591F /* ADJSessionFailure.m */; }; - 9DF7AA801CB4F52500D3591F /* ADJSessionSuccess.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA611CB4F52500D3591F /* ADJSessionSuccess.m */; }; - 9DF7AA811CB4F52500D3591F /* ADJTimerCycle.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA631CB4F52500D3591F /* ADJTimerCycle.m */; }; - 9DF7AA821CB4F52500D3591F /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA651CB4F52500D3591F /* ADJTimerOnce.m */; }; - 9DF7AA831CB4F52500D3591F /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA671CB4F52500D3591F /* Adjust.m */; }; - 9DF7AA841CB4F52500D3591F /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF7AA691CB4F52500D3591F /* ADJUtil.m */; }; - 9DF7AA851CB4F52500D3591F /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DF7AA6A1CB4F52500D3591F /* Info.plist */; }; + 9DFB060A1D746FB9006D48FC /* AdjustSdkTV.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DFB06091D746FB9006D48FC /* AdjustSdkTV.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 96164D971CCA4E3A009431AB /* ADJBackoffStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJBackoffStrategy.h; sourceTree = ""; }; - 96164D981CCA4E3A009431AB /* ADJBackoffStrategy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJBackoffStrategy.m; sourceTree = ""; }; - 96164D991CCA4E3A009431AB /* ADJSdkClickHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSdkClickHandler.h; sourceTree = ""; }; - 96164D9A1CCA4E3A009431AB /* ADJSdkClickHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSdkClickHandler.m; sourceTree = ""; }; - 96164D9B1CCA4E3A009431AB /* ADJSystemProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSystemProfile.h; sourceTree = ""; }; - 96164D9C1CCA4E3A009431AB /* ADJSystemProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSystemProfile.m; sourceTree = ""; }; 963909B21BCC0D8300A2E8A4 /* AdjustExample-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AdjustExample-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 963909B61BCC0D8300A2E8A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 963909B81BCC0D8300A2E8A4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -65,65 +29,11 @@ 963909C11BCC0D8300A2E8A4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 963909C31BCC0D8300A2E8A4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 963909CF1BCC0DA600A2E8A4 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; - 9DAA08B21D2A831A001C04E4 /* ADJTrackingPixel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTrackingPixel.h; sourceTree = ""; }; - 9DAA08B31D2A831A001C04E4 /* ADJTrackingPixel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTrackingPixel.m; sourceTree = ""; }; 9DC95F2D1C10596500138E4B /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; 9DC95F2E1C10596500138E4B /* Constants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Constants.m; sourceTree = ""; }; 9DC95F301C105B4C00138E4B /* URLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLRequest.h; sourceTree = ""; }; 9DC95F311C105B4C00138E4B /* URLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = URLRequest.m; sourceTree = ""; }; - 9DF7AA351CB4F52400D3591F /* ADJActivityHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityHandler.h; sourceTree = ""; }; - 9DF7AA361CB4F52400D3591F /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; - 9DF7AA371CB4F52400D3591F /* ADJActivityKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityKind.h; sourceTree = ""; }; - 9DF7AA381CB4F52400D3591F /* ADJActivityKind.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityKind.m; sourceTree = ""; }; - 9DF7AA391CB4F52400D3591F /* ADJActivityPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityPackage.h; sourceTree = ""; }; - 9DF7AA3A1CB4F52400D3591F /* ADJActivityPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityPackage.m; sourceTree = ""; }; - 9DF7AA3B1CB4F52400D3591F /* ADJActivityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJActivityState.h; sourceTree = ""; }; - 9DF7AA3C1CB4F52400D3591F /* ADJActivityState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityState.m; sourceTree = ""; }; - 9DF7AA3E1CB4F52400D3591F /* NSData+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+ADJAdditions.h"; sourceTree = ""; }; - 9DF7AA3F1CB4F52400D3591F /* NSData+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+ADJAdditions.m"; sourceTree = ""; }; - 9DF7AA401CB4F52400D3591F /* NSString+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ADJAdditions.h"; sourceTree = ""; }; - 9DF7AA411CB4F52400D3591F /* NSString+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ADJAdditions.m"; sourceTree = ""; }; - 9DF7AA421CB4F52400D3591F /* UIDevice+ADJAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+ADJAdditions.h"; sourceTree = ""; }; - 9DF7AA431CB4F52400D3591F /* UIDevice+ADJAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+ADJAdditions.m"; sourceTree = ""; }; - 9DF7AA441CB4F52400D3591F /* ADJAdjustFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAdjustFactory.h; sourceTree = ""; }; - 9DF7AA451CB4F52400D3591F /* ADJAdjustFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAdjustFactory.m; sourceTree = ""; }; - 9DF7AA461CB4F52400D3591F /* ADJAttribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttribution.h; sourceTree = ""; }; - 9DF7AA471CB4F52500D3591F /* ADJAttribution.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttribution.m; sourceTree = ""; }; - 9DF7AA481CB4F52500D3591F /* ADJAttributionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJAttributionHandler.h; sourceTree = ""; }; - 9DF7AA491CB4F52500D3591F /* ADJAttributionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJAttributionHandler.m; sourceTree = ""; }; - 9DF7AA4A1CB4F52500D3591F /* ADJConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConfig.h; sourceTree = ""; }; - 9DF7AA4B1CB4F52500D3591F /* ADJConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConfig.m; sourceTree = ""; }; - 9DF7AA4C1CB4F52500D3591F /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; - 9DF7AA4D1CB4F52500D3591F /* ADJDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJDeviceInfo.m; sourceTree = ""; }; - 9DF7AA4E1CB4F52500D3591F /* ADJEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEvent.h; sourceTree = ""; }; - 9DF7AA4F1CB4F52500D3591F /* ADJEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEvent.m; sourceTree = ""; }; - 9DF7AA501CB4F52500D3591F /* ADJEventFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventFailure.h; sourceTree = ""; }; - 9DF7AA511CB4F52500D3591F /* ADJEventFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventFailure.m; sourceTree = ""; }; - 9DF7AA521CB4F52500D3591F /* ADJEventSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJEventSuccess.h; sourceTree = ""; }; - 9DF7AA531CB4F52500D3591F /* ADJEventSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJEventSuccess.m; sourceTree = ""; }; - 9DF7AA541CB4F52500D3591F /* ADJLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJLogger.h; sourceTree = ""; }; - 9DF7AA551CB4F52500D3591F /* ADJLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJLogger.m; sourceTree = ""; }; - 9DF7AA561CB4F52500D3591F /* ADJPackageBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageBuilder.h; sourceTree = ""; }; - 9DF7AA571CB4F52500D3591F /* ADJPackageBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageBuilder.m; sourceTree = ""; }; - 9DF7AA581CB4F52500D3591F /* ADJPackageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJPackageHandler.h; sourceTree = ""; }; - 9DF7AA591CB4F52500D3591F /* ADJPackageHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJPackageHandler.m; sourceTree = ""; }; - 9DF7AA5A1CB4F52500D3591F /* ADJRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJRequestHandler.h; sourceTree = ""; }; - 9DF7AA5B1CB4F52500D3591F /* ADJRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJRequestHandler.m; sourceTree = ""; }; - 9DF7AA5C1CB4F52500D3591F /* ADJResponseData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJResponseData.h; sourceTree = ""; }; - 9DF7AA5D1CB4F52500D3591F /* ADJResponseData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJResponseData.m; sourceTree = ""; }; - 9DF7AA5E1CB4F52500D3591F /* ADJSessionFailure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionFailure.h; sourceTree = ""; }; - 9DF7AA5F1CB4F52500D3591F /* ADJSessionFailure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionFailure.m; sourceTree = ""; }; - 9DF7AA601CB4F52500D3591F /* ADJSessionSuccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJSessionSuccess.h; sourceTree = ""; }; - 9DF7AA611CB4F52500D3591F /* ADJSessionSuccess.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJSessionSuccess.m; sourceTree = ""; }; - 9DF7AA621CB4F52500D3591F /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; - 9DF7AA631CB4F52500D3591F /* ADJTimerCycle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerCycle.m; sourceTree = ""; }; - 9DF7AA641CB4F52500D3591F /* ADJTimerOnce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerOnce.h; sourceTree = ""; }; - 9DF7AA651CB4F52500D3591F /* ADJTimerOnce.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJTimerOnce.m; sourceTree = ""; }; - 9DF7AA661CB4F52500D3591F /* Adjust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Adjust.h; sourceTree = ""; }; - 9DF7AA671CB4F52500D3591F /* Adjust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Adjust.m; sourceTree = ""; }; - 9DF7AA681CB4F52500D3591F /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; - 9DF7AA691CB4F52500D3591F /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; - 9DF7AA6A1CB4F52500D3591F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9DFB06091D746FB9006D48FC /* AdjustSdkTV.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdjustSdkTV.framework; path = Adjust/AdjustSdkTV.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -132,6 +42,7 @@ buildActionMask = 2147483647; files = ( 963909D01BCC0DA600A2E8A4 /* AdSupport.framework in Frameworks */, + 9DFB060A1D746FB9006D48FC /* AdjustSdkTV.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -177,93 +88,16 @@ isa = PBXGroup; children = ( 9DF7ACCA1CB50DB700D3591F /* Frameworks */, - 9DF7AA341CB4F52400D3591F /* Adjust */, 963909B61BCC0D8300A2E8A4 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; - 9DF7AA341CB4F52400D3591F /* Adjust */ = { - isa = PBXGroup; - children = ( - 9DAA08B21D2A831A001C04E4 /* ADJTrackingPixel.h */, - 9DAA08B31D2A831A001C04E4 /* ADJTrackingPixel.m */, - 96164D971CCA4E3A009431AB /* ADJBackoffStrategy.h */, - 96164D981CCA4E3A009431AB /* ADJBackoffStrategy.m */, - 96164D991CCA4E3A009431AB /* ADJSdkClickHandler.h */, - 96164D9A1CCA4E3A009431AB /* ADJSdkClickHandler.m */, - 96164D9B1CCA4E3A009431AB /* ADJSystemProfile.h */, - 96164D9C1CCA4E3A009431AB /* ADJSystemProfile.m */, - 9DF7AA351CB4F52400D3591F /* ADJActivityHandler.h */, - 9DF7AA361CB4F52400D3591F /* ADJActivityHandler.m */, - 9DF7AA371CB4F52400D3591F /* ADJActivityKind.h */, - 9DF7AA381CB4F52400D3591F /* ADJActivityKind.m */, - 9DF7AA391CB4F52400D3591F /* ADJActivityPackage.h */, - 9DF7AA3A1CB4F52400D3591F /* ADJActivityPackage.m */, - 9DF7AA3B1CB4F52400D3591F /* ADJActivityState.h */, - 9DF7AA3C1CB4F52400D3591F /* ADJActivityState.m */, - 9DF7AA3D1CB4F52400D3591F /* ADJAdditions */, - 9DF7AA441CB4F52400D3591F /* ADJAdjustFactory.h */, - 9DF7AA451CB4F52400D3591F /* ADJAdjustFactory.m */, - 9DF7AA461CB4F52400D3591F /* ADJAttribution.h */, - 9DF7AA471CB4F52500D3591F /* ADJAttribution.m */, - 9DF7AA481CB4F52500D3591F /* ADJAttributionHandler.h */, - 9DF7AA491CB4F52500D3591F /* ADJAttributionHandler.m */, - 9DF7AA4A1CB4F52500D3591F /* ADJConfig.h */, - 9DF7AA4B1CB4F52500D3591F /* ADJConfig.m */, - 9DF7AA4C1CB4F52500D3591F /* ADJDeviceInfo.h */, - 9DF7AA4D1CB4F52500D3591F /* ADJDeviceInfo.m */, - 9DF7AA4E1CB4F52500D3591F /* ADJEvent.h */, - 9DF7AA4F1CB4F52500D3591F /* ADJEvent.m */, - 9DF7AA501CB4F52500D3591F /* ADJEventFailure.h */, - 9DF7AA511CB4F52500D3591F /* ADJEventFailure.m */, - 9DF7AA521CB4F52500D3591F /* ADJEventSuccess.h */, - 9DF7AA531CB4F52500D3591F /* ADJEventSuccess.m */, - 9DF7AA541CB4F52500D3591F /* ADJLogger.h */, - 9DF7AA551CB4F52500D3591F /* ADJLogger.m */, - 9DF7AA561CB4F52500D3591F /* ADJPackageBuilder.h */, - 9DF7AA571CB4F52500D3591F /* ADJPackageBuilder.m */, - 9DF7AA581CB4F52500D3591F /* ADJPackageHandler.h */, - 9DF7AA591CB4F52500D3591F /* ADJPackageHandler.m */, - 9DF7AA5A1CB4F52500D3591F /* ADJRequestHandler.h */, - 9DF7AA5B1CB4F52500D3591F /* ADJRequestHandler.m */, - 9DF7AA5C1CB4F52500D3591F /* ADJResponseData.h */, - 9DF7AA5D1CB4F52500D3591F /* ADJResponseData.m */, - 9DF7AA5E1CB4F52500D3591F /* ADJSessionFailure.h */, - 9DF7AA5F1CB4F52500D3591F /* ADJSessionFailure.m */, - 9DF7AA601CB4F52500D3591F /* ADJSessionSuccess.h */, - 9DF7AA611CB4F52500D3591F /* ADJSessionSuccess.m */, - 9DF7AA621CB4F52500D3591F /* ADJTimerCycle.h */, - 9DF7AA631CB4F52500D3591F /* ADJTimerCycle.m */, - 9DF7AA641CB4F52500D3591F /* ADJTimerOnce.h */, - 9DF7AA651CB4F52500D3591F /* ADJTimerOnce.m */, - 9DF7AA661CB4F52500D3591F /* Adjust.h */, - 9DF7AA671CB4F52500D3591F /* Adjust.m */, - 9DF7AA681CB4F52500D3591F /* ADJUtil.h */, - 9DF7AA691CB4F52500D3591F /* ADJUtil.m */, - 9DF7AA6A1CB4F52500D3591F /* Info.plist */, - ); - name = Adjust; - path = ../../../Adjust; - sourceTree = ""; - }; - 9DF7AA3D1CB4F52400D3591F /* ADJAdditions */ = { - isa = PBXGroup; - children = ( - 9DF7AA3E1CB4F52400D3591F /* NSData+ADJAdditions.h */, - 9DF7AA3F1CB4F52400D3591F /* NSData+ADJAdditions.m */, - 9DF7AA401CB4F52400D3591F /* NSString+ADJAdditions.h */, - 9DF7AA411CB4F52400D3591F /* NSString+ADJAdditions.m */, - 9DF7AA421CB4F52400D3591F /* UIDevice+ADJAdditions.h */, - 9DF7AA431CB4F52400D3591F /* UIDevice+ADJAdditions.m */, - ); - path = ADJAdditions; - sourceTree = ""; - }; 9DF7ACCA1CB50DB700D3591F /* Frameworks */ = { isa = PBXGroup; children = ( 963909CF1BCC0DA600A2E8A4 /* AdSupport.framework */, + 9DFB06091D746FB9006D48FC /* AdjustSdkTV.framework */, ); name = Frameworks; sourceTree = ""; @@ -327,7 +161,6 @@ files = ( 963909C21BCC0D8300A2E8A4 /* Assets.xcassets in Resources */, 963909C01BCC0D8300A2E8A4 /* Main.storyboard in Resources */, - 9DF7AA851CB4F52500D3591F /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -338,41 +171,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9DF7AA701CB4F52500D3591F /* NSString+ADJAdditions.m in Sources */, - 9DF7AA7F1CB4F52500D3591F /* ADJSessionFailure.m in Sources */, - 9DF7AA7E1CB4F52500D3591F /* ADJResponseData.m in Sources */, - 9DF7AA731CB4F52500D3591F /* ADJAttribution.m in Sources */, - 9DF7AA831CB4F52500D3591F /* Adjust.m in Sources */, - 9DF7AA6E1CB4F52500D3591F /* ADJActivityState.m in Sources */, - 96164D9F1CCA4E3A009431AB /* ADJSystemProfile.m in Sources */, 9DC95F2F1C10596500138E4B /* Constants.m in Sources */, - 9DF7AA7D1CB4F52500D3591F /* ADJRequestHandler.m in Sources */, - 9DF7AA7C1CB4F52500D3591F /* ADJPackageHandler.m in Sources */, - 9DF7AA801CB4F52500D3591F /* ADJSessionSuccess.m in Sources */, - 9DF7AA761CB4F52500D3591F /* ADJDeviceInfo.m in Sources */, - 9DF7AA811CB4F52500D3591F /* ADJTimerCycle.m in Sources */, 963909BD1BCC0D8300A2E8A4 /* ViewControllertvOS.m in Sources */, 963909BA1BCC0D8300A2E8A4 /* AppDelegate.m in Sources */, - 9DF7AA721CB4F52500D3591F /* ADJAdjustFactory.m in Sources */, - 9DF7AA7B1CB4F52500D3591F /* ADJPackageBuilder.m in Sources */, - 9DF7AA6B1CB4F52500D3591F /* ADJActivityHandler.m in Sources */, - 9DF7AA821CB4F52500D3591F /* ADJTimerOnce.m in Sources */, - 9DF7AA6C1CB4F52500D3591F /* ADJActivityKind.m in Sources */, - 9DF7AA791CB4F52500D3591F /* ADJEventSuccess.m in Sources */, 9DC95F321C105B4C00138E4B /* URLRequest.m in Sources */, - 96164D9E1CCA4E3A009431AB /* ADJSdkClickHandler.m in Sources */, - 9DF7AA741CB4F52500D3591F /* ADJAttributionHandler.m in Sources */, - 9DF7AA841CB4F52500D3591F /* ADJUtil.m in Sources */, - 9DF7AA751CB4F52500D3591F /* ADJConfig.m in Sources */, 963909B71BCC0D8300A2E8A4 /* main.m in Sources */, - 9DF7AA711CB4F52500D3591F /* UIDevice+ADJAdditions.m in Sources */, - 9DF7AA781CB4F52500D3591F /* ADJEventFailure.m in Sources */, - 9DF7AA6F1CB4F52500D3591F /* NSData+ADJAdditions.m in Sources */, - 9DF7AA7A1CB4F52500D3591F /* ADJLogger.m in Sources */, - 9DAA08B41D2A831A001C04E4 /* ADJTrackingPixel.m in Sources */, - 96164D9D1CCA4E3A009431AB /* ADJBackoffStrategy.m in Sources */, - 9DF7AA771CB4F52500D3591F /* ADJEvent.m in Sources */, - 9DF7AA6D1CB4F52500D3591F /* ADJActivityPackage.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -427,6 +230,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "-ObjC"; SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; @@ -463,6 +267,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-ObjC"; SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; @@ -475,9 +280,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-tvOS/Adjust", + ); INFOPLIST_FILE = "AdjustExample-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-tvOS"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -488,9 +298,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CODE_SIGN_IDENTITY = "iPhone Developer"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/AdjustExample-tvOS/Adjust", + ); INFOPLIST_FILE = "AdjustExample-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.adjust.AdjustExample-tvOS"; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.example; PRODUCT_NAME = "$(TARGET_NAME)"; TVOS_DEPLOYMENT_TARGET = 9.0; }; diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/AdjustSdkTV b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/AdjustSdkTV new file mode 100755 index 000000000..84240ba52 Binary files /dev/null and b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/AdjustSdkTV differ diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJAttribution.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJAttribution.h new file mode 100644 index 000000000..21faee13e --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJAttribution.h @@ -0,0 +1,43 @@ +// +// ADJAttribution.h +// adjust +// +// Created by Pedro Filipe on 29/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJAttribution : NSObject + +// the following attributes are only set when error is nil +// (when activity was tracked successfully and response could be parsed) + +// tracker token of current device +@property (nonatomic, copy) NSString *trackerToken; + +// tracker name of current device +@property (nonatomic, copy) NSString *trackerName; + +// tracker network +@property (nonatomic, copy) NSString *network; + +// tracker campaign +@property (nonatomic, copy) NSString *campaign; + +// tracker adgroup +@property (nonatomic, copy) NSString *adgroup; + +// tracker creative +@property (nonatomic, copy) NSString *creative; + +// tracker click_label +@property (nonatomic, copy) NSString *clickLabel; + +- (BOOL)isEqualToAttribution:(ADJAttribution *)attribution; + ++ (ADJAttribution *)dataWithJsonDict:(NSDictionary *)jsonDict; +- (id)initWithJsonDict:(NSDictionary *)jsonDict; +- (NSDictionary *)dictionary; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJConfig.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJConfig.h new file mode 100644 index 000000000..1774c80c7 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJConfig.h @@ -0,0 +1,177 @@ +// +// ADJConfig.h +// adjust +// +// Created by Pedro Filipe on 30/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import +#import "ADJLogger.h" +#import "ADJAttribution.h" +#import "ADJSessionSuccess.h" +#import "ADJSessionFailure.h" +#import "ADJEventSuccess.h" +#import "ADJEventFailure.h" + +/** + * Optional delegate that will get informed about tracking results + */ +@protocol AdjustDelegate +@optional + +/** + * Optional delegate method that gets called when the attribution information changed + * + * @param attribution The attribution information. + * See ADJAttribution for details + */ +- (void)adjustAttributionChanged:(ADJAttribution *)attribution; + +/** + * Optional delegate method that gets called when an event is tracked with success + * + * @param eventSuccessResponseData The response information from tracking with success + * See ADJEventSuccess for details + */ +- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData; + +/** + * Optional delegate method that gets called when an event is tracked with failure + * + * @param eventFailureResponseData The response information from tracking with failure + * See ADJEventFailure for details + */ +- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with success + * + * @param sessionSuccessResponseData The response information from tracking with success + * See ADJSessionSuccess for details + */ +- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData; + +/** + * Optional delegate method that gets called when an session is tracked with failure + * + * @param sessionFailureResponseData The response information from tracking with failure + * See ADJSessionFailure for details + */ +- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData; + +/** + * Optional delegate method that gets called when a deeplink is about to be opened by the adjust SDK + * + * @param deeplink The deeplink url that was received by the adjust SDK to be opened + * @return boolean Value that indicates whether the deeplink should be opened by the adjust SDK + */ +- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink; + +@end + +@interface ADJConfig : NSObject + +@property (nonatomic, copy) NSString *sdkPrefix; +@property (nonatomic, copy) NSString *defaultTracker; +@property (nonatomic, copy, readonly) NSString *appToken; +@property (nonatomic, copy, readonly) NSString *environment; + +/** + * Configuration object for the initialization of the Adjust SDK + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment; + +/** + * Configuration object for the initialization of the Adjust SDK. + * + * @param appToken The App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long + * @param environment The current environment your app. We use this environment to + * distinguish between real traffic and artificial traffic from test devices. + * It is very important that you keep this value meaningful at all times! + * Especially if you are tracking revenue + * @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress + * and replaces the default value for production environment + */ ++ (ADJConfig *)configWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; +- (id)initWithAppToken:(NSString *)appToken + environment:(NSString *)environment + allowSuppressLogLevel:(BOOL)allowSuppressLogLevel; + +/** + * Change the verbosity of Adjust's logs + * + * You can increase or reduce the amount of logs from Adjust by passing + * one of the following parameters. Use ADJLogLevelSuppress to disable all logging + * + * @var logLevel The desired minimum log level (default: info) + * Must be one of the following: + * - ADJLogLevelVerbose (enable all logging) + * - ADJLogLevelDebug (enable more logging) + * - ADJLogLevelInfo (the default) + * - ADJLogLevelWarn (disable info logging) + * - ADJLogLevelError (disable warnings as well) + * - ADJLogLevelAssert (disable errors as well) + * - ADJLogLevelSuppress (suppress all logging) + */ +@property (nonatomic, assign) ADJLogLevel logLevel; + +/** + * Enable event buffering if your app triggers a lot of events. + * When enabled, events get buffered and only get tracked each + * minute. Buffered events are still persisted, of course + * + * @var eventBufferingEnabled Enable or disable event buffering + */ +@property (nonatomic, assign) BOOL eventBufferingEnabled; + +/** + * Set the optional delegate that will inform you about attribution or events + * + * See the AdjustDelegate declaration above for details + * + * @var delegate The delegate that might implement the optional delegate methods + */ +@property (nonatomic, weak) NSObject *delegate; + +/** + * Enables sending in the background + * + * @var sendInBackground Enable or disable sending in the background + */ +@property (nonatomic, assign) BOOL sendInBackground; + +/** + * Enables delayed start of the SDK + * + * @var delayStart Number of seconds after which SDK will start + */ +@property (nonatomic, assign) double delayStart; + +/** + * User agent for the requests. + * + * @var userAgent User agent value. + */ +@property (nonatomic, copy) NSString *userAgent; + +@property (nonatomic, assign, readonly) BOOL hasResponseDelegate; +@property (nonatomic, assign, readonly) BOOL hasAttributionChangedDelegate; + +- (BOOL) isValid; +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEvent.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEvent.h new file mode 100644 index 000000000..7fcb8881d --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEvent.h @@ -0,0 +1,89 @@ +// +// ADJEvent.h +// adjust +// +// Created by Pedro Filipe on 15/10/14. +// Copyright (c) 2014 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEvent : NSObject + +@property (nonatomic, copy, readonly) NSString* eventToken; +@property (nonatomic, copy, readonly) NSNumber* revenue; +@property (nonatomic, readonly) NSDictionary* callbackParameters; +@property (nonatomic, readonly) NSDictionary* partnerParameters; +@property (nonatomic, copy, readonly) NSString* transactionId; +@property (nonatomic, copy, readonly) NSString* currency; +@property (nonatomic, copy, readonly) NSData* receipt; +@property (nonatomic, assign, readonly) BOOL emptyReceipt; + +/** + * Create Event object with Event Token. + * + * @param eventToken Event token that is created in the dashboard + * at http://adjust.com and should be six characters long. + */ ++ (ADJEvent *)eventWithEventToken:(NSString *)eventToken; +- (id) initWithEventToken:(NSString *)eventToken; + +/** + * Add a key-pair to a callback URL. + * + * In your dashboard at http://adjust.com you can assign a callback URL to each + * event type. That URL will get called every time the event is triggered. On + * top of that you can add callback parameters to the following method that + * will be forwarded to these callbacks. + * + * @param key String key in the callback URL. + * @param value String value of the key in the Callback URL. + * + */ +- (void) addCallbackParameter:(NSString *)key + value:(NSString *)value; + +/** + * Add a key-pair to be fowarded to a partner. + * + * @param key String key to be fowarded to the partner + * @param value String value of the key to be fowarded to the partner + * + */ +- (void) addPartnerParameter:(NSString *)key + value:(NSString *)value; + +/** + * Set the revenue and associated currency of the event. + * + * The event can contain some revenue. The amount revenue is measured in units. + * It must include a currency in the ISO 4217 format. + * + * @param amount The amount in units (example: for 1.50 EUR is 1.5) + * @param currency String of the currency with ISO 4217 format. + * It should be 3 characters long (example: for 1.50 EUR is @"EUR") + */ +- (void) setRevenue:(double)amount currency:(NSString *)currency; + +/** + * Set the transaction ID of a In-App Purchases to avoid revenue duplications. + * + * A transaction ID can be used to avoid duplicate revenue events. The last ten + * transaction identifiers are remembered. + * + * @param transactionId The identifier used to avoid duplicate revenue events + */ +- (void) setTransactionId:(NSString *)transactionId; + +- (BOOL) isValid; + +/** + * + * Validate a in-app-purchase receipt. + * + * @param receipt The receipt to validate + * @param transactionId The identifier used to validate the receipt and to avoid duplicate revenue events + */ +- (void) setReceipt:(NSData *)receipt transactionId:(NSString *)transactionId; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEventFailure.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEventFailure.h new file mode 100644 index 000000000..46ef36d16 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEventFailure.h @@ -0,0 +1,34 @@ +// +// ADJEventFailure.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventFailure *)eventFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEventSuccess.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEventSuccess.h new file mode 100644 index 000000000..ce2abb1bd --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJEventSuccess.h @@ -0,0 +1,31 @@ +// +// ADJEventSuccess.h +// adjust +// +// Created by Pedro Filipe on 17/02/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJEventSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// event token of the tracked event. +@property (nonatomic, copy) NSString * eventToken; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJEventSuccess *)eventSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJLogger.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJLogger.h new file mode 100644 index 000000000..89f02f159 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJLogger.h @@ -0,0 +1,39 @@ +// +// ADJLogger.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-11-15. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// +#import + +typedef enum { + ADJLogLevelVerbose = 1, + ADJLogLevelDebug = 2, + ADJLogLevelInfo = 3, + ADJLogLevelWarn = 4, + ADJLogLevelError = 5, + ADJLogLevelAssert = 6, + ADJLogLevelSuppress = 7 +} ADJLogLevel; + +// A simple logger with multiple log levels. +@protocol ADJLogger + +- (void)setLogLevel:(ADJLogLevel)logLevel; +- (void)lockLogLevel; + +- (void)verbose:(NSString *)message, ...; +- (void)debug: (NSString *)message, ...; +- (void)info: (NSString *)message, ...; +- (void)warn: (NSString *)message, ...; +- (void)error: (NSString *)message, ...; +- (void)assert: (NSString *)message, ...; + +@end + +@interface ADJLogger : NSObject + ++ (ADJLogLevel) LogLevelFromString: (NSString *) logLevelString; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJSessionFailure.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJSessionFailure.h new file mode 100644 index 000000000..25681f03b --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJSessionFailure.h @@ -0,0 +1,31 @@ +// +// ADJFailureResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionFailure : NSObject + +// error message from the server or the sdk. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// indicates if the package will be retried to be send later +@property (nonatomic, assign) BOOL willRetry; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionFailure *)sessionFailureResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJSessionSuccess.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJSessionSuccess.h new file mode 100644 index 000000000..5533928bc --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/ADJSessionSuccess.h @@ -0,0 +1,28 @@ +// +// ADJSuccessResponseData.h +// adjust +// +// Created by Pedro Filipe on 05/01/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +@interface ADJSessionSuccess : NSObject + +// message from the server. +@property (nonatomic, copy) NSString * message; + +// timeStamp from the server. +@property (nonatomic, copy) NSString * timeStamp; + +// adid of the device. +@property (nonatomic, copy) NSString * adid; + +// the server response in json format +@property (nonatomic, strong) NSDictionary *jsonResponse; + ++ (ADJSessionSuccess *)sessionSuccessResponseData; +- (id)init; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/Adjust.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/Adjust.h new file mode 100644 index 000000000..337479af3 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/Adjust.h @@ -0,0 +1,201 @@ +// +// Adjust.h +// Adjust +// +// Created by Christian Wellenbrock on 2012-07-23. +// Copyright (c) 2012-2014 adjust GmbH. All rights reserved. +// + +#import "ADJEvent.h" +#import "ADJAttribution.h" +#import "ADJConfig.h" + +/** + * Constants for our supported tracking environments + */ +extern NSString * const ADJEnvironmentSandbox; +extern NSString * const ADJEnvironmentProduction; + +/** + * The main interface to Adjust + * + * Use the methods of this class to tell Adjust about the usage of your app. + * See the README for details. + */ +@interface Adjust : NSObject + +/** + * Tell Adjust that the application did launch + * + * This is required to initialize Adjust. Call this in the didFinishLaunching + * method of your AppDelegate. + * + * See ADJConfig.h for more configuration options + * + * @param adjustConfig The configuration object that includes the environment + * and the App Token of your app. This unique identifier can + * be found it in your dashboard at http://adjust.com and should always + * be 12 characters long. + */ ++ (void)appDidLaunch:(ADJConfig *)adjustConfig; + +/** + * Tell Adjust that a particular event has happened + * + * See ADJEvent.h for more event options. + * + * @param event The Event object for this kind of event. It needs a event token + * that is created in the dashboard at http://adjust.com and should be six + * characters long. + */ ++ (void)trackEvent:(ADJEvent *)event; + +/** + * Tell adjust that the application resumed + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionStart; + +/** + * Tell adjust that the application paused + * + * Only necessary if the native notifications can't be used + */ ++ (void)trackSubsessionEnd; + +/** + * Enable or disable the adjust SDK. This setting is saved for future sessions + * + * @param enabled The flag to enable or disable the adjust SDK + */ ++ (void)setEnabled:(BOOL)enabled; + +/** + * Check if the SDK is enabled or disabled + * + * return Boolean indicating whether SDK is enabled or not + */ ++ (BOOL)isEnabled; + +/** + * Read the URL that opened the application to search for an adjust deep link + * + * @param url URL object which contains info about adjust deep link + */ ++ (void)appWillOpenUrl:(NSURL *)url; + +/** + * Set the device token used by push notifications + * + * @param deviceToken Apple push notification token for iOS device + */ ++ (void)setDeviceToken:(NSData *)deviceToken; + +/** + * Enable or disable offline mode. Activities won't be sent but they are saved when + * offline mode is disabled. This feature is not saved for future sessions + * + * @param enabled The flag to enable or disable offline mode + */ ++ (void)setOfflineMode:(BOOL)enabled; + +/** + * Convert a universal link style url to a deeplink style url with the corresponding scheme + * + * @param url URL object which contains info about adjust deep link + * @param scheme Desired scheme to which you want your resulting URL object to be prefixed with + * + * @return URL object in custom URL scheme style prefixed with given scheme name + */ ++ (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +/** + * Retrieve iOS device IDFA value + * + * @return Device IDFA value + */ ++ (NSString *)idfa; + +/** + * Tell the adjust SDK to stop waiting for delayed initialisation timer to complete but rather to start + * upon this call. This should be called if you have obtained needed callback/partner parameters which you + * wanted to put as default ones before the delayedStart value you have set on ADJConfig has expired + */ ++ (void)sendFirstPackages; + +/** + * Tell adjust to send the request to Google and check if the installation + * belongs to Google AdWords campaign + */ ++ (void)sendAdWordsRequest; + +/** + * Add default callback parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default callback parameter key + * @param value Default callback parameter value + */ ++ (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +/** + * Add default partner parameter key-value pair which is going to be sent with each tracked session + * + * @param key Default partner parameter key + * @param value Default partner parameter value + */ ++ (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; + +/** + * Remove default callback parameter from the session packages + * + * @param key Default callback parameter key + */ ++ (void)removeSessionCallbackParameter:(NSString *)key; + +/** + * Remove default partner parameter from the session packages + * + * @param key Default partner parameter key + */ ++ (void)removeSessionPartnerParameter:(NSString *)key; + +/** + * Remove all default callback parameters from the session packages + */ ++ (void)resetSessionCallbackParameters; + +/** + * Remove all default partner parameters from the session packages + */ ++ (void)resetSessionPartnerParameters; + +/** + * Obtain singleton Adjust object + */ ++ (id)getInstance; + +- (void)appDidLaunch:(ADJConfig *)adjustConfig; +- (void)trackEvent:(ADJEvent *)event; +- (void)setEnabled:(BOOL)enabled; +- (void)teardown:(BOOL)deleteState; +- (void)appWillOpenUrl:(NSURL *)url; +- (void)setOfflineMode:(BOOL)enabled; +- (void)setDeviceToken:(NSData *)deviceToken; + +- (BOOL)isEnabled; +- (NSString *)idfa; +- (NSURL *)convertUniversalLink:(NSURL *)url scheme:(NSString *)scheme; + +- (void)sendFirstPackages; +- (void)sendAdWordsRequest; +- (void)trackSubsessionEnd; +- (void)trackSubsessionStart; +- (void)resetSessionPartnerParameters; +- (void)resetSessionCallbackParameters; +- (void)removeSessionPartnerParameter:(NSString *)key; +- (void)removeSessionCallbackParameter:(NSString *)key; +- (void)addSessionPartnerParameter:(NSString *)key value:(NSString *)value; +- (void)addSessionCallbackParameter:(NSString *)key value:(NSString *)value; + +@end diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/AdjustSdkTV.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/AdjustSdkTV.h new file mode 100644 index 000000000..bf083fa5a --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Headers/AdjustSdkTV.h @@ -0,0 +1,27 @@ +// +// AdjustSdkTv.h +// AdjustSdkTv +// +// Created by Uglješa Erceg on 29/08/16. +// Copyright © 2016 adjust GmbH. All rights reserved. +// + +#import + +//! Project version number for AdjustSdkTv. +FOUNDATION_EXPORT double AdjustSdkTvVersionNumber; + +//! Project version string for AdjustSdkTv. +FOUNDATION_EXPORT const unsigned char AdjustSdkTvVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Info.plist b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Info.plist new file mode 100644 index 000000000..49c229f9a Binary files /dev/null and b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Info.plist differ diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Modules/module.modulemap b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Modules/module.modulemap new file mode 100644 index 000000000..a85ddab7c --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTV.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module AdjustSdkTv { + umbrella header "AdjustSdkTv.h" + + export * + module * { export * } +} diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTv.framework/_CodeSignature/CodeResources b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTv.framework/_CodeSignature/CodeResources new file mode 100644 index 000000000..c6fcedc29 --- /dev/null +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/Adjust/AdjustSdkTv.framework/_CodeSignature/CodeResources @@ -0,0 +1,276 @@ + + + + + files + + Headers/ADJAttribution.h + + yebFF2FRfBwbCqjWTgTuMQAlCUA= + + Headers/ADJConfig.h + + +cpAu7hZIJHXmyLcyVkRbMCXpag= + + Headers/ADJEvent.h + + deuJbUUnULcOktAAWPkDnWwN5MQ= + + Headers/ADJEventFailure.h + + 5pjoyUKRgwpvv61Jv90UV4tOl4g= + + Headers/ADJEventSuccess.h + + kJnkpNREqCGMLp/KOt91avboeSE= + + Headers/ADJLogger.h + + wa8twtnqRtDwyeQl99fRFb/ONA8= + + Headers/ADJSessionFailure.h + + +S92Sypoo3GznEN3SIJpYSggnMU= + + Headers/ADJSessionSuccess.h + + ZC4oXvXhL/9zfBjw4w22BYWsMw4= + + Headers/Adjust.h + + 8pP5E4STEEAfY0teOpJc/8EiuSc= + + Headers/AdjustSdkTv.h + + bsPqO/1acqYnrpfUPnF8HTbszfE= + + Info.plist + + WLbRA2Rav+ah1h/Ze2Yoz0slD6c= + + Modules/module.modulemap + + RYOq6TAofvU6FudBmRynjQjLibk= + + + files2 + + Headers/ADJAttribution.h + + hash + + yebFF2FRfBwbCqjWTgTuMQAlCUA= + + hash2 + + DCPXSilyv7VHVa/ESg+jithmPvSjsvKfl+4UCmky4zY= + + + Headers/ADJConfig.h + + hash + + +cpAu7hZIJHXmyLcyVkRbMCXpag= + + hash2 + + kxYlIyQ3ccsEDJxk8MPrbQ2S9Rbm4X5MjgKKpm0rLwQ= + + + Headers/ADJEvent.h + + hash + + deuJbUUnULcOktAAWPkDnWwN5MQ= + + hash2 + + L9IOxDS6Nyno39n8muBk2hO1reib3Ox5ZuhA8RdzlDk= + + + Headers/ADJEventFailure.h + + hash + + 5pjoyUKRgwpvv61Jv90UV4tOl4g= + + hash2 + + EL9nXgt/dp9lZwgVe6Thss53U8NxHMqY+qcUbaoAdho= + + + Headers/ADJEventSuccess.h + + hash + + kJnkpNREqCGMLp/KOt91avboeSE= + + hash2 + + 04HIJDmevhvp2taV7v5pmydKPbFQsQlrnjbHwZbN46o= + + + Headers/ADJLogger.h + + hash + + wa8twtnqRtDwyeQl99fRFb/ONA8= + + hash2 + + J1t0g8KczDTft0dVJt/+bYwD7mt/9bv/vF31P/msQ0I= + + + Headers/ADJSessionFailure.h + + hash + + +S92Sypoo3GznEN3SIJpYSggnMU= + + hash2 + + NN9GsaFVqYUb1XclTLaNpk0b15gYTef7ld+w3O7qDmI= + + + Headers/ADJSessionSuccess.h + + hash + + ZC4oXvXhL/9zfBjw4w22BYWsMw4= + + hash2 + + m4TbwxoYuykXhft3CKFJjX4jA/R88VehRPIG2ct9VnU= + + + Headers/Adjust.h + + hash + + 8pP5E4STEEAfY0teOpJc/8EiuSc= + + hash2 + + T5b+v1w+ZDCByi3zzU7oeQ5VcX9x/u1+1mQzEIMPfDk= + + + Headers/AdjustSdkTv.h + + hash + + bsPqO/1acqYnrpfUPnF8HTbszfE= + + hash2 + + LFZq28ZFCvaRtFwU1MLoA4rltVZmSaEHORFSzzVCCNo= + + + Modules/module.modulemap + + hash + + RYOq6TAofvU6FudBmRynjQjLibk= + + hash2 + + xSanbXlaKKREfmidijXwxyaFz/FKrv3QPq76gwm5TIw= + + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h b/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h index 92f41ce6c..5c85b88e0 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/AppDelegate.h @@ -7,8 +7,7 @@ // #import - -#import "Adjust.h" +#import @interface AppDelegate : UIResponder diff --git a/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.m b/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.m index df13e9b51..c64f6e2e0 100644 --- a/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.m +++ b/examples/AdjustExample-tvOS/AdjustExample-tvOS/ViewControllertvOS.m @@ -6,7 +6,8 @@ // Copyright © 2015 adjust. All rights reserved. // -#import "Adjust.h" +#import + #import "Constants.h" #import "URLRequest.h" #import "ViewControllertvOS.h"