From 49499922ba1f4314c0055009941563b0645fcb2e Mon Sep 17 00:00:00 2001 From: nonelse Date: Mon, 12 Feb 2018 16:07:26 +0100 Subject: [PATCH 01/14] Add launch in main thread with isInactive --- Adjust/ADJUtil.h | 7 +++++++ Adjust/ADJUtil.m | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Adjust/ADJUtil.h b/Adjust/ADJUtil.h index 131c6e43c..74abbf764 100644 --- a/Adjust/ADJUtil.h +++ b/Adjust/ADJUtil.h @@ -16,6 +16,7 @@ #import "ADJBackoffStrategy.h" typedef void (^selfInjectedBlock)(id); +typedef void (^isInactiveInjected)(BOOL); @interface ADJUtil : NSObject @@ -31,6 +32,12 @@ typedef void (^selfInjectedBlock)(id); + (void)launchInMainThread:(dispatch_block_t)block; ++ (BOOL)isMainThread; + ++ (BOOL)isInactive; + ++ (void)launchInMainThreadWithInactive:(isInactiveInjected)isInactiveblock; + + (void)updateUrlSessionConfiguration:(ADJConfig *)config; + (void)writeObject:(id)object diff --git a/Adjust/ADJUtil.m b/Adjust/ADJUtil.m index 2f38d2c24..0d75e2d35 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -1163,6 +1163,34 @@ + (void)launchInMainThread:(dispatch_block_t)block { } } ++ (BOOL)isMainThread { + return [[NSThread currentThread] isMainThread]; +} + ++ (BOOL)isInactive { + return [[UIApplication sharedApplication] applicationState] != UIApplicationStateActive; +} + ++ (void)launchInMainThreadWithInactive:(isInactiveInjected)isInactiveblock { + dispatch_block_t block = ^void(void) { + __block BOOL isInactive = [ADJUtil isInactive]; + isInactiveblock(isInactive); + }; + + if ([ADJUtil isMainThread]) { + block(); + return; + } + + if (ADJAdjustFactory.testing) { + [ADJAdjustFactory.logger debug:@"Launching in the background for testing"]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), block); + } else { + dispatch_async(dispatch_get_main_queue(), block); + } +} + + + (BOOL)isValidParameter:(NSString *)attribute attributeType:(NSString *)attributeType parameterName:(NSString *)parameterName { From 294a5bd0e8f4761a8666f9f47fb6b3fbeb88e2c2 Mon Sep 17 00:00:00 2001 From: nonelse Date: Tue, 13 Feb 2018 11:34:18 +0100 Subject: [PATCH 02/14] Check isInactive to start sdk --- Adjust/ADJActivityHandler.m | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index 14d919c74..2102dcd07 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -194,12 +194,16 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig } self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); - [ADJUtil launchInQueue:self.internalQueue - selfInject:self - block:^(ADJActivityHandler * selfI) { - [selfI initI:selfI - preLaunchActionsArray:savedPreLaunch.preLaunchActionsArray]; - }]; + [ADJUtil launchInMainThreadWithInactive:^(BOOL isInactive) { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI initI:selfI + preLaunchActionsArray:savedPreLaunch.preLaunchActionsArray + isInactive:isInactive]; + }]; + + }]; // self.deviceTokenData = savedPreLaunch.deviceTokenData; if (self.activityState != nil) { @@ -599,10 +603,10 @@ + (void)deleteSessionPartnerParameter { [ADJUtil deleteFileWithName:kSessionPartnerParametersFilename]; } - #pragma mark - internal - (void)initI:(ADJActivityHandler *)selfI preLaunchActionsArray:(NSArray*)preLaunchActionsArray + isInactive:(BOOL) isInactive { // get session values kSessionInterval = ADJAdjustFactory.sessionInterval; @@ -698,7 +702,12 @@ - (void)initI:(ADJActivityHandler *)selfI [selfI preLaunchActionsI:selfI preLaunchActionsArray:preLaunchActionsArray]; - [selfI startI:selfI]; + if (!isInactive) { + [selfI.logger debug:@"Start sdk, since the app is already in the foreground"]; + [selfI startI:selfI]; + } else { + [selfI.logger debug:@"Wait for the app to go to the foreground to start the sdk"]; + } } - (void)startI:(ADJActivityHandler *)selfI { From e4086a4cbae9e3a62f35e43956753faf904858d3 Mon Sep 17 00:00:00 2001 From: uerceg Date: Fri, 16 Feb 2018 14:42:09 +0100 Subject: [PATCH 03/14] Track session triggered in delayed SDK initialisation --- Adjust/ADJActivityHandler.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index 2102dcd07..d95096546 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -704,6 +704,7 @@ - (void)initI:(ADJActivityHandler *)selfI if (!isInactive) { [selfI.logger debug:@"Start sdk, since the app is already in the foreground"]; + selfI.internalState.background = NO; [selfI startI:selfI]; } else { [selfI.logger debug:@"Wait for the app to go to the foreground to start the sdk"]; From 32117305fe59e7a20d4c8267dce50ee0217dddcc Mon Sep 17 00:00:00 2001 From: nonelse Date: Tue, 20 Feb 2018 12:21:55 +0100 Subject: [PATCH 04/14] Move isInactive inject to end of init --- Adjust/ADJActivityHandler.m | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index d95096546..a7e50747c 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -194,16 +194,13 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig } self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); - [ADJUtil launchInMainThreadWithInactive:^(BOOL isInactive) { - [ADJUtil launchInQueue:self.internalQueue - selfInject:self - block:^(ADJActivityHandler * selfI) { - [selfI initI:selfI - preLaunchActionsArray:savedPreLaunch.preLaunchActionsArray - isInactive:isInactive]; - }]; + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI initI:selfI + preLaunchActionsArray:savedPreLaunch.preLaunchActionsArray]; + }]; - }]; // self.deviceTokenData = savedPreLaunch.deviceTokenData; if (self.activityState != nil) { @@ -606,7 +603,6 @@ + (void)deleteSessionPartnerParameter { #pragma mark - internal - (void)initI:(ADJActivityHandler *)selfI preLaunchActionsArray:(NSArray*)preLaunchActionsArray - isInactive:(BOOL) isInactive { // get session values kSessionInterval = ADJAdjustFactory.sessionInterval; @@ -702,13 +698,17 @@ - (void)initI:(ADJActivityHandler *)selfI [selfI preLaunchActionsI:selfI preLaunchActionsArray:preLaunchActionsArray]; - if (!isInactive) { - [selfI.logger debug:@"Start sdk, since the app is already in the foreground"]; - selfI.internalState.background = NO; - [selfI startI:selfI]; - } else { - [selfI.logger debug:@"Wait for the app to go to the foreground to start the sdk"]; - } + [ADJUtil launchInMainThreadWithInactive:^(BOOL isInactive) { + [ADJUtil launchInQueue:self.internalQueue selfInject:self block:^(ADJActivityHandler * selfI) { + if (!isInactive) { + [selfI.logger debug:@"Start sdk, since the app is already in the foreground"]; + selfI.internalState.background = NO; + [selfI startI:selfI]; + } else { + [selfI.logger debug:@"Wait for the app to go to the foreground to start the sdk"]; + } + }]; + }]; } - (void)startI:(ADJActivityHandler *)selfI { From 995b10764258844eb94186945cb5fcf924a2a8ad Mon Sep 17 00:00:00 2001 From: uerceg Date: Wed, 21 Feb 2018 13:55:50 +0100 Subject: [PATCH 05/14] Don't send sdk_info in absence of activity state --- Adjust/ADJActivityHandler.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index a7e50747c..6a3a32b4e 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -1263,6 +1263,9 @@ - (void)setDeviceTokenI:(ADJActivityHandler *)selfI if (![selfI isEnabledI:selfI]) { return; } + if (!selfI.activityState) { + return; + } NSString *deviceTokenString = [ADJUtil convertDeviceToken:deviceToken]; From f7cbbbda3eea2cf27448bde834f910f06934110b Mon Sep 17 00:00:00 2001 From: Obaied Date: Wed, 21 Feb 2018 15:29:40 +0100 Subject: [PATCH 06/14] Nullify AdjustTestOptions parameters --- Adjust/Adjust.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Adjust/Adjust.m b/Adjust/Adjust.m index 9a4fddaca..a264d1e6e 100644 --- a/Adjust/Adjust.m +++ b/Adjust/Adjust.m @@ -22,6 +22,25 @@ NSString * const ADJEnvironmentProduction = @"production"; @implementation AdjustTestOptions + +-(id) init { + self = [super init]; + if (self == nil) { + return nil; + } + + self.timerIntervalInMilliseconds = nil; + self.timerStartInMilliseconds = nil; + self.sessionIntervalInMilliseconds = nil; + self.subsessionIntervalInMilliseconds = nil; + self.basePath = nil; + self.baseUrl = nil; + self.teardown = NO; + self.deleteState = NO; + + return self; +} + @end @interface Adjust() From d25a733da069141bcd278389d40b57e00912d0e4 Mon Sep 17 00:00:00 2001 From: Obaied Date: Wed, 21 Feb 2018 15:30:09 +0100 Subject: [PATCH 07/14] Add AdjustTestLibraryStatic build target --- .../project.pbxproj | 86 +++++++++++++++++++ .../contents.xcworkspacedata | 7 ++ 2 files changed, 93 insertions(+) create mode 100644 AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj index b217045f1..bb870b71c 100644 --- a/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj +++ b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj @@ -6,7 +6,27 @@ objectVersion = 48; objects = { +/* Begin PBXAggregateTarget section */ + 20E71745203B162B0073AC91 /* AdjustTestLibraryStatic */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 20E71748203B162B0073AC91 /* Build configuration list for PBXAggregateTarget "AdjustTestLibraryStatic" */; + buildPhases = ( + 20E71749203B163A0073AC91 /* Run Script */, + ); + dependencies = ( + ); + name = AdjustTestLibraryStatic; + productName = UniversalLib; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ + 20AC303F203C205B00CD9DA8 /* ATLTestLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842572007782600568A31 /* ATLTestLibrary.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 20AC3040203C205D00CD9DA8 /* ATLTestInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842522007782500568A31 /* ATLTestInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 20AC3041203C206100CD9DA8 /* ATLControlChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842502007782500568A31 /* ATLControlChannel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 20AC3042203C206300CD9DA8 /* ATLConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842592007782600568A31 /* ATLConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 20AC3043203C206600CD9DA8 /* ATLUtilNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842552007782500568A31 /* ATLUtilNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 20AC3044203C206800CD9DA8 /* ATLBlockingQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FFCFE732007AE0000467F01 /* ATLBlockingQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6F08425A2007782600568A31 /* ATLControlChannel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F08424D2007782500568A31 /* ATLControlChannel.m */; }; 6F08425C2007782600568A31 /* ATLTestLibrary.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F08424F2007782500568A31 /* ATLTestLibrary.m */; }; 6F08425D2007782600568A31 /* ATLTestInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F0842532007782500568A31 /* ATLTestInfo.m */; }; @@ -93,6 +113,22 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 20AC303E203C204600CD9DA8 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 20AC3040203C205D00CD9DA8 /* ATLTestInfo.h in Headers */, + 20AC303F203C205B00CD9DA8 /* ATLTestLibrary.h in Headers */, + 20AC3042203C206300CD9DA8 /* ATLConstants.h in Headers */, + 20AC3043203C206600CD9DA8 /* ATLUtilNetworking.h in Headers */, + 20AC3044203C206800CD9DA8 /* ATLBlockingQueue.h in Headers */, + 20AC3041203C206100CD9DA8 /* ATLControlChannel.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ 6F08420B2007766700568A31 /* AdjustTestLibrary */ = { isa = PBXNativeTarget; @@ -101,6 +137,7 @@ 6F0842082007766700568A31 /* Sources */, 6F0842092007766700568A31 /* Frameworks */, 6F08420A2007766700568A31 /* CopyFiles */, + 20AC303E203C204600CD9DA8 /* Headers */, ); buildRules = ( ); @@ -120,6 +157,10 @@ LastUpgradeCheck = 0920; ORGANIZATIONNAME = adjust; TargetAttributes = { + 20E71745203B162B0073AC91 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; 6F08420B2007766700568A31 = { CreatedOnToolsVersion = 9.2; ProvisioningStyle = Automatic; @@ -139,10 +180,28 @@ projectRoot = ""; targets = ( 6F08420B2007766700568A31 /* AdjustTestLibrary */, + 20E71745203B162B0073AC91 /* AdjustTestLibraryStatic */, ); }; /* End PBXProject section */ +/* Begin PBXShellScriptBuildPhase section */ + 20E71749203B163A0073AC91 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\n# define output folder environment variable\nUNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal\n\n# Step 1. Build Device and Simulator versions\nxcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\"\nxcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\"\n\n# make sure the output directory exists\nmkdir -p \"${UNIVERSAL_OUTPUTFOLDER}\"\n\n# Step 2. Create universal binary file using lipo\nlipo -create -output \"${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a\" \"${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a\" \"${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a\"\n\nexport FRAMEWORK_LOC=\"${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework\"\nexport SOURCES_DIR=\"${BUILD_DIR}/../${PROJECT_NAME}\"\nexport STATIC_LIB_LOC=\"${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a\"\n\n# Delete framework if exists\nrm -rfv \"${FRAMEWORK_LOC}\"\n\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOC}/Headers\"\n\n# Copy all header files\nfind \"${SOURCES_DIR}/\" -name \"*.h\" -exec /bin/cp {} \"${FRAMEWORK_LOC}/Headers/\" \\;\n\n# Copy static library\n/bin/cp \"${STATIC_LIB_LOC}\" \"${FRAMEWORK_LOC}/${PROJECT_NAME}\"\n\necho \"Universal library can be found here:\"\necho \"${FRAMEWORK_LOC}\"\n\n# # Create the required symlinks\n# /bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n# /bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n# /bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \\\n# \"${FRAMEWORK_LOCN}/${PRODUCT_NAME}\"\n#\n# # Copy the public headers into the framework\n# #/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n# \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 6F0842082007766700568A31 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -160,6 +219,24 @@ /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ + 20E71746203B162B0073AC91 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = QGUGW9AUMK; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 20E71747203B162B0073AC91 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = QGUGW9AUMK; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 6F0842132007766700568A31 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -291,6 +368,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 20E71748203B162B0073AC91 /* Build configuration list for PBXAggregateTarget "AdjustTestLibraryStatic" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 20E71746203B162B0073AC91 /* Debug */, + 20E71747203B162B0073AC91 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 6F0842072007766700568A31 /* Build configuration list for PBXProject "AdjustTestLibrary" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + From 3bc9dcbb2b8bd46afd6de0d70e2d21c9f5dcb04c Mon Sep 17 00:00:00 2001 From: Obaied Date: Thu, 22 Feb 2018 10:19:06 +0100 Subject: [PATCH 08/14] Remove AdjustTestOptions constructor --- Adjust/Adjust.m | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/Adjust/Adjust.m b/Adjust/Adjust.m index a264d1e6e..79114d974 100644 --- a/Adjust/Adjust.m +++ b/Adjust/Adjust.m @@ -23,24 +23,6 @@ @implementation AdjustTestOptions --(id) init { - self = [super init]; - if (self == nil) { - return nil; - } - - self.timerIntervalInMilliseconds = nil; - self.timerStartInMilliseconds = nil; - self.sessionIntervalInMilliseconds = nil; - self.subsessionIntervalInMilliseconds = nil; - self.basePath = nil; - self.baseUrl = nil; - self.teardown = NO; - self.deleteState = NO; - - return self; -} - @end @interface Adjust() From 231c9be617c437283b0cb72b920d4867f13055d1 Mon Sep 17 00:00:00 2001 From: uerceg Date: Thu, 22 Feb 2018 11:55:02 +0100 Subject: [PATCH 09/14] No need for file change --- Adjust/Adjust.m | 1 - 1 file changed, 1 deletion(-) diff --git a/Adjust/Adjust.m b/Adjust/Adjust.m index 79114d974..9a4fddaca 100644 --- a/Adjust/Adjust.m +++ b/Adjust/Adjust.m @@ -22,7 +22,6 @@ NSString * const ADJEnvironmentProduction = @"production"; @implementation AdjustTestOptions - @end @interface Adjust() From f32030849d77a09d254082254e7f6a38a5178e77 Mon Sep 17 00:00:00 2001 From: uerceg Date: Thu, 22 Feb 2018 18:03:18 +0100 Subject: [PATCH 10/14] AdjustTestLibrary mutliplatform build script update --- .../project.pbxproj | 49 +++++++++++++++++-- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj index bb870b71c..e47c351ab 100644 --- a/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj +++ b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj @@ -11,9 +11,10 @@ isa = PBXAggregateTarget; buildConfigurationList = 20E71748203B162B0073AC91 /* Build configuration list for PBXAggregateTarget "AdjustTestLibraryStatic" */; buildPhases = ( - 20E71749203B163A0073AC91 /* Run Script */, + 20E71749203B163A0073AC91 /* Multiplatform Build */, ); dependencies = ( + 9D8AB2BF203F24360015DA32 /* PBXTargetDependency */, ); name = AdjustTestLibraryStatic; productName = UniversalLib; @@ -35,6 +36,16 @@ 6FFCFE752007AE0000467F01 /* ATLBlockingQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 6FFCFE742007AE0000467F01 /* ATLBlockingQueue.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 9D8AB2BE203F24360015DA32 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6F0842042007766700568A31 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6F08420B2007766700568A31; + remoteInfo = AdjustTestLibrary; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXCopyFilesBuildPhase section */ 6F08420A2007766700568A31 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; @@ -138,6 +149,7 @@ 6F0842092007766700568A31 /* Frameworks */, 6F08420A2007766700568A31 /* CopyFiles */, 20AC303E203C204600CD9DA8 /* Headers */, + 9D8AB2B6203F202B0015DA32 /* Build Framework */, ); buildRules = ( ); @@ -186,19 +198,33 @@ /* End PBXProject section */ /* Begin PBXShellScriptBuildPhase section */ - 20E71749203B163A0073AC91 /* Run Script */ = { + 20E71749203B163A0073AC91 /* Multiplatform Build */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Run Script"; + name = "Multiplatform Build"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\n# define output folder environment variable\nUNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal\n\n# Step 1. Build Device and Simulator versions\nxcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\"\nxcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\"\n\n# make sure the output directory exists\nmkdir -p \"${UNIVERSAL_OUTPUTFOLDER}\"\n\n# Step 2. Create universal binary file using lipo\nlipo -create -output \"${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a\" \"${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a\" \"${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a\"\n\nexport FRAMEWORK_LOC=\"${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework\"\nexport SOURCES_DIR=\"${BUILD_DIR}/../${PROJECT_NAME}\"\nexport STATIC_LIB_LOC=\"${UNIVERSAL_OUTPUTFOLDER}/lib${PROJECT_NAME}.a\"\n\n# Delete framework if exists\nrm -rfv \"${FRAMEWORK_LOC}\"\n\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOC}/Headers\"\n\n# Copy all header files\nfind \"${SOURCES_DIR}/\" -name \"*.h\" -exec /bin/cp {} \"${FRAMEWORK_LOC}/Headers/\" \\;\n\n# Copy static library\n/bin/cp \"${STATIC_LIB_LOC}\" \"${FRAMEWORK_LOC}/${PROJECT_NAME}\"\n\necho \"Universal library can be found here:\"\necho \"${FRAMEWORK_LOC}\"\n\n# # Create the required symlinks\n# /bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n# /bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n# /bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \\\n# \"${FRAMEWORK_LOCN}/${PRODUCT_NAME}\"\n#\n# # Copy the public headers into the framework\n# #/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n# \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n"; + 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}.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}\"\n\n# Ensure that the framework is present in both platform's build directories\ncp -a \"${RW_FRAMEWORK_LOCATION}/Versions/A/${RW_FRAMEWORK_NAME}\" \\\n\"${RW_OTHER_BUILT_PRODUCTS_DIR}/Static/${RW_FRAMEWORK_NAME}.framework/Versions/A/${RW_FRAMEWORK_NAME}\"\n\n# Copy the framework to the project directory\nditto \"${RW_FRAMEWORK_LOCATION}\" \"${SRCROOT}/../../Frameworks/Static/${RW_FRAMEWORK_NAME}.framework\""; + }; + 9D8AB2B6203F202B0015DA32 /* Build Framework */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Build Framework"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "set -e\n\nexport FRAMEWORK_LOCN=\"${BUILT_PRODUCTS_DIR}/Static/${PRODUCT_NAME}.framework\"\n\n# Create the path to the real Headers die\nmkdir -p \"${FRAMEWORK_LOCN}/Versions/A/Headers\"\n\n# Create the required symlinks\n/bin/ln -sfh A \"${FRAMEWORK_LOCN}/Versions/Current\"\n/bin/ln -sfh Versions/Current/Headers \"${FRAMEWORK_LOCN}/Headers\"\n/bin/ln -sfh \"Versions/Current/${PRODUCT_NAME}\" \\\n\"${FRAMEWORK_LOCN}/${PRODUCT_NAME}\"\n\n# Copy the public headers into the framework\n/bin/cp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \\\n\"${FRAMEWORK_LOCN}/Versions/A/Headers\""; }; /* End PBXShellScriptBuildPhase section */ @@ -218,12 +244,22 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 9D8AB2BF203F24360015DA32 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6F08420B2007766700568A31 /* AdjustTestLibrary */; + targetProxy = 9D8AB2BE203F24360015DA32 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 20E71746203B162B0073AC91 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = QGUGW9AUMK; + ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -232,7 +268,9 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = QGUGW9AUMK; + ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -336,6 +374,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 11.2; MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -346,6 +385,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = QGUGW9AUMK; + ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -358,6 +398,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = QGUGW9AUMK; + ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; From 4143b8f1b73fc844cc2070710c833441b2c7dadc Mon Sep 17 00:00:00 2001 From: uerceg Date: Thu, 22 Feb 2018 18:03:42 +0100 Subject: [PATCH 11/14] Added building of AdjustTestLibraryStatic target into build.sh --- Scripts/build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Scripts/build.sh b/Scripts/build.sh index 9b013d0c9..68e498de6 100755 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -38,3 +38,7 @@ carthage build --no-skip-current # Copy build Carthage framework to Frameworks folder cp -R Carthage/Build/iOS/* Frameworks/Dynamic/ + +# Build static AdjustTestLibrary.framework +cd AdjustTests/AdjustTestLibrary +xcodebuild -target AdjustTestLibraryStatic -configuration Debug clean build From 0e35dfa38816774c88033af8a7cc13463c2e97a1 Mon Sep 17 00:00:00 2001 From: Obaied Date: Fri, 23 Feb 2018 10:02:52 +0100 Subject: [PATCH 12/14] Add ATLUtil.h --- .../AdjustTestLibrary.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj index e47c351ab..490dfccc1 100644 --- a/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj +++ b/AdjustTests/AdjustTestLibrary/AdjustTestLibrary.xcodeproj/project.pbxproj @@ -22,6 +22,7 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 20412650203FF86300CC40DB /* ATLUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842542007782500568A31 /* ATLUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20AC303F203C205B00CD9DA8 /* ATLTestLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842572007782600568A31 /* ATLTestLibrary.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20AC3040203C205D00CD9DA8 /* ATLTestInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842522007782500568A31 /* ATLTestInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20AC3041203C206100CD9DA8 /* ATLControlChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0842502007782500568A31 /* ATLControlChannel.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -134,6 +135,7 @@ 20AC3042203C206300CD9DA8 /* ATLConstants.h in Headers */, 20AC3043203C206600CD9DA8 /* ATLUtilNetworking.h in Headers */, 20AC3044203C206800CD9DA8 /* ATLBlockingQueue.h in Headers */, + 20412650203FF86300CC40DB /* ATLUtil.h in Headers */, 20AC3041203C206100CD9DA8 /* ATLControlChannel.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; From df8fe2d5f4826b6260d2b1387db4038695474a55 Mon Sep 17 00:00:00 2001 From: uerceg Date: Fri, 23 Feb 2018 13:43:15 +0100 Subject: [PATCH 13/14] New version 4.12.3 --- Adjust.podspec | 4 ++-- Adjust/ADJUtil.m | 2 +- Adjust/Adjust.h | 2 +- AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m | 2 +- AdjustTests/AdjustUnitTests/ADJPackageFields.m | 2 +- README.md | 4 ++-- VERSION | 2 +- doc/english/migrate.md | 2 +- doc/japanese/migrate_ja.md | 2 +- doc/migrate.md | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Adjust.podspec b/Adjust.podspec index 0944652f9..445c89093 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "Adjust" - s.version = "4.12.2" + s.version = "4.12.3" s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com." s.homepage = "https://github.com/adjust/ios_sdk" 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.12.2" } + s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.12.3" } s.ios.deployment_target = '6.0' s.tvos.deployment_target = '9.0' s.framework = 'SystemConfiguration' diff --git a/Adjust/ADJUtil.m b/Adjust/ADJUtil.m index 0d75e2d35..d796ba92b 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -41,7 +41,7 @@ static NSString *userAgent = nil; -static NSString * const kClientSdk = @"ios4.12.2"; +static NSString * const kClientSdk = @"ios4.12.3"; static NSString * const kDeeplinkParam = @"deep_link="; static NSString * const kSchemeDelimiter = @"://"; static NSString * const kDefaultScheme = @"AdjustUniversalScheme"; diff --git a/Adjust/Adjust.h b/Adjust/Adjust.h index f9e9101dd..c5706bdb1 100644 --- a/Adjust/Adjust.h +++ b/Adjust/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust // -// V4.12.2 +// V4.12.3 // Created by Christian Wellenbrock (wellle) on 23rd July 2013. // Copyright © 2012-2017 Adjust GmbH. All rights reserved. // diff --git a/AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m b/AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m index 4be36a6bb..80552bd99 100644 --- a/AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m +++ b/AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m @@ -37,7 +37,7 @@ - (void)viewDidLoad { } - (void)startTestSession { - [self.testLibrary startTestSession:@"ios4.12.2"]; + [self.testLibrary startTestSession:@"ios4.12.3"]; } - (void)didReceiveMemoryWarning { diff --git a/AdjustTests/AdjustUnitTests/ADJPackageFields.m b/AdjustTests/AdjustUnitTests/ADJPackageFields.m index 4f913dad9..068da236a 100644 --- a/AdjustTests/AdjustUnitTests/ADJPackageFields.m +++ b/AdjustTests/AdjustUnitTests/ADJPackageFields.m @@ -16,7 +16,7 @@ - (id) init { // default values self.appToken = @"qwerty123456"; - self.clientSdk = @"ios4.12.2"; + self.clientSdk = @"ios4.12.3"; self.suffix = @""; self.environment = @"sandbox"; diff --git a/README.md b/README.md index 41a82d5c1..fd47d8f2a 100644 --- a/README.md +++ b/README.md @@ -67,13 +67,13 @@ We will describe the steps to integrate the adjust SDK into your iOS project. We 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.12.2' +pod 'Adjust', '~> 4.12.3' ``` or: ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.12.2' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.12.3' ``` --- diff --git a/VERSION b/VERSION index f1cd7de1d..d140ced1c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.12.2 +4.12.3 diff --git a/doc/english/migrate.md b/doc/english/migrate.md index 8156a1e9a..b3fca2602 100644 --- a/doc/english/migrate.md +++ b/doc/english/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.12.2 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.12.3 from v3.4.0 ### Initial setup diff --git a/doc/japanese/migrate_ja.md b/doc/japanese/migrate_ja.md index 3a1c2024c..2c7766780 100644 --- a/doc/japanese/migrate_ja.md +++ b/doc/japanese/migrate_ja.md @@ -1,4 +1,4 @@ -## iOS用adjust SDKのv3.4.0からv.4.12.2への移行 +## iOS用adjust SDKのv3.4.0からv4.12.3への移行 ### 初期設定 diff --git a/doc/migrate.md b/doc/migrate.md index 8156a1e9a..b3fca2602 100644 --- a/doc/migrate.md +++ b/doc/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.12.2 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.12.3 from v3.4.0 ### Initial setup From fb60140944c93f3443447b782798133a757f7ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uglje=C5=A1a=20Erceg?= Date: Fri, 23 Feb 2018 13:55:13 +0100 Subject: [PATCH 14/14] Version 4.12.3 changes --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f80ce9278..ca27be8b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +### Version 4.12.3 (23rd February 2018) +#### Added +- Added `AdjustTestLibraryStatic` target to the project. + +#### Changed +- Stopped creating session packages in case SDK is initialised in suspended app state. +- Started to send install session package right away in case of delayed SDK initialisation. + +--- + ### Version 4.12.2 (13th February 2018) #### Changed - Improved SDK logging to indicate the presence/absence of `iAd.framework` inside of the app.