Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Adjust.podspec
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
19 changes: 16 additions & 3 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig
selfInject:self
block:^(ADJActivityHandler * selfI) {
[selfI initI:selfI
preLaunchActionsArray:savedPreLaunch.preLaunchActionsArray];
preLaunchActionsArray:savedPreLaunch.preLaunchActionsArray];
}];


// self.deviceTokenData = savedPreLaunch.deviceTokenData;
if (self.activityState != nil) {
[self setDeviceToken:[ADJUserDefaults getPushToken]];
Expand Down Expand Up @@ -599,7 +600,6 @@ + (void)deleteSessionPartnerParameter {
[ADJUtil deleteFileWithName:kSessionPartnerParametersFilename];
}


#pragma mark - internal
- (void)initI:(ADJActivityHandler *)selfI
preLaunchActionsArray:(NSArray*)preLaunchActionsArray
Expand Down Expand Up @@ -698,7 +698,17 @@ - (void)initI:(ADJActivityHandler *)selfI

[selfI preLaunchActionsI:selfI preLaunchActionsArray:preLaunchActionsArray];

[selfI startI:selfI];
[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 {
Expand Down Expand Up @@ -1253,6 +1263,9 @@ - (void)setDeviceTokenI:(ADJActivityHandler *)selfI
if (![selfI isEnabledI:selfI]) {
return;
}
if (!selfI.activityState) {
return;
}

NSString *deviceTokenString = [ADJUtil convertDeviceToken:deviceToken];

Expand Down
7 changes: 7 additions & 0 deletions Adjust/ADJUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#import "ADJBackoffStrategy.h"

typedef void (^selfInjectedBlock)(id);
typedef void (^isInactiveInjected)(BOOL);

@interface ADJUtil : NSObject

Expand All @@ -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
Expand Down
30 changes: 29 additions & 1 deletion Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion AdjustTests/AdjustTestApp/AdjustTestApp/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ - (void)viewDidLoad {
}

- (void)startTestSession {
[self.testLibrary startTestSession:@"ios4.12.2"];
[self.testLibrary startTestSession:@"ios4.12.3"];
}

- (void)didReceiveMemoryWarning {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@
objectVersion = 48;
objects = {

/* Begin PBXAggregateTarget section */
20E71745203B162B0073AC91 /* AdjustTestLibraryStatic */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 20E71748203B162B0073AC91 /* Build configuration list for PBXAggregateTarget "AdjustTestLibraryStatic" */;
buildPhases = (
20E71749203B163A0073AC91 /* Multiplatform Build */,
);
dependencies = (
9D8AB2BF203F24360015DA32 /* PBXTargetDependency */,
);
name = AdjustTestLibraryStatic;
productName = UniversalLib;
};
/* 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, ); }; };
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 */; };
Expand All @@ -15,6 +37,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;
Expand Down Expand Up @@ -93,6 +125,23 @@
};
/* 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 */,
20412650203FF86300CC40DB /* ATLUtil.h in Headers */,
20AC3041203C206100CD9DA8 /* ATLControlChannel.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
6F08420B2007766700568A31 /* AdjustTestLibrary */ = {
isa = PBXNativeTarget;
Expand All @@ -101,6 +150,8 @@
6F0842082007766700568A31 /* Sources */,
6F0842092007766700568A31 /* Frameworks */,
6F08420A2007766700568A31 /* CopyFiles */,
20AC303E203C204600CD9DA8 /* Headers */,
9D8AB2B6203F202B0015DA32 /* Build Framework */,
);
buildRules = (
);
Expand All @@ -120,6 +171,10 @@
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = adjust;
TargetAttributes = {
20E71745203B162B0073AC91 = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
};
6F08420B2007766700568A31 = {
CreatedOnToolsVersion = 9.2;
ProvisioningStyle = Automatic;
Expand All @@ -139,10 +194,42 @@
projectRoot = "";
targets = (
6F08420B2007766700568A31 /* AdjustTestLibrary */,
20E71745203B162B0073AC91 /* AdjustTestLibraryStatic */,
);
};
/* End PBXProject section */

/* Begin PBXShellScriptBuildPhase section */
20E71749203B163A0073AC91 /* Multiplatform Build */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Multiplatform Build";
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_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 */

/* Begin PBXSourcesBuildPhase section */
6F0842082007766700568A31 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -159,7 +246,37 @@
};
/* 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;
};
20E71747203B162B0073AC91 /* Release */ = {
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;
};
6F0842132007766700568A31 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -259,6 +376,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;
};
Expand All @@ -269,6 +387,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QGUGW9AUMK;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -281,6 +400,7 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QGUGW9AUMK;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -291,6 +411,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 = (
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AdjustTests/AdjustUnitTests/ADJPackageFields.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Loading