Skip to content

Commit

Permalink
Merge pull request adjust#414 from adjust/v4210
Browse files Browse the repository at this point in the history
Version 4.21.0
  • Loading branch information
uerceg authored Mar 19, 2020
2 parents c308f13 + 07793e4 commit 08c9931
Show file tree
Hide file tree
Showing 35 changed files with 457 additions and 160 deletions.
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.20.0"
s.version = "4.21.0"
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.20.0" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.21.0" }
s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
s.framework = 'SystemConfiguration'
Expand Down
2 changes: 1 addition & 1 deletion Adjust.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@
9679920518BBAE2800394606 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1100;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = "adjust GmbH";
TargetAttributes = {
9615158E1CD2CB2C0022D336 = {
Expand Down
6 changes: 1 addition & 5 deletions Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdk.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1030"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:Adjust.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
6 changes: 1 addition & 5 deletions Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdkIm.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1030"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:Adjust.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
6 changes: 1 addition & 5 deletions Adjust.xcodeproj/xcshareddata/xcschemes/AdjustSdkTv.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1030"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:Adjust.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1030"
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -29,8 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -51,8 +49,6 @@
ReferencedContainer = "container:Adjust.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
22 changes: 17 additions & 5 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
static double kSubSessionInterval;

// number of tries
static const int kTryIadV3 = 2;
static const int kTryIadV3 = 2;
static const uint64_t kDelayRetryIad = 2 * NSEC_PER_SEC; // 1 second

@implementation ADJInternalState
Expand Down Expand Up @@ -123,8 +123,7 @@ @implementation ADJActivityHandler
}

- (id)initWithConfig:(ADJConfig *)adjustConfig
savedPreLaunch:(ADJSavedPreLaunch *)savedPreLaunch
{
savedPreLaunch:(ADJSavedPreLaunch *)savedPreLaunch {
self = [super init];
if (self == nil) return nil;

Expand All @@ -137,6 +136,14 @@ - (id)initWithConfig:(ADJConfig *)adjustConfig
[ADJAdjustFactory.logger error:@"AdjustConfig not initialized correctly"];
return nil;
}

// check if ASA and IDFA tracking were switched off and warn just in case
if (adjustConfig.allowIdfaReading == NO) {
[ADJAdjustFactory.logger warn:@"IDFA reading has been switched off"];
}
if (adjustConfig.allowiAdInfoReading == NO) {
[ADJAdjustFactory.logger warn:@"iAd info reading has been switched off"];
}

self.adjustConfig = adjustConfig;
self.adjustDelegate = adjustConfig.delegate;
Expand Down Expand Up @@ -749,7 +756,9 @@ - (void)initI:(ADJActivityHandler *)selfI
startsSending:[selfI toSendI:selfI
sdkClickHandlerOnly:YES]];

[[UIDevice currentDevice] adjSetIad:selfI triesV3Left:kTryIadV3];
if (self.adjustConfig.allowiAdInfoReading == YES) {
[[UIDevice currentDevice] adjSetIad:selfI triesV3Left:kTryIadV3];
}

[selfI preLaunchActionsI:selfI preLaunchActionsArray:preLaunchActionsArray];

Expand Down Expand Up @@ -1251,7 +1260,9 @@ - (void)setEnabledI:(ADJActivityHandler *)selfI enabled:(BOOL)enabled {
} else if ([ADJUserDefaults getDisableThirdPartySharing]) {
[selfI disableThirdPartySharing];
}
[[UIDevice currentDevice] adjSetIad:selfI triesV3Left:kTryIadV3];
if (self.adjustConfig.allowiAdInfoReading == YES) {
[[UIDevice currentDevice] adjSetIad:selfI triesV3Left:kTryIadV3];
}
}

[selfI checkStatusI:selfI
Expand Down Expand Up @@ -1396,6 +1407,7 @@ - (BOOL)readDeeplinkQueryStringI:(ADJActivityHandler *)selfI
if (value.length == 0) return NO;

NSString* valueDecoded = [value adjUrlDecode];
if (!valueDecoded) return NO;

NSString* keyWOutPrefix = [keyDecoded substringFromIndex:kAdjustPrefix.length];
if (keyWOutPrefix.length == 0) return NO;
Expand Down
4 changes: 4 additions & 0 deletions Adjust/ADJAdjustFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
+ (NSTimeInterval)timerStart;
+ (ADJBackoffStrategy *)packageHandlerBackoffStrategy;
+ (ADJBackoffStrategy *)sdkClickHandlerBackoffStrategy;
+ (ADJBackoffStrategy *)installSessionBackoffStrategy;

+ (id<ADJAttributionHandler>)attributionHandlerForActivityHandler:(id<ADJActivityHandler>)activityHandler
startsSending:(BOOL)startsSending;
Expand Down Expand Up @@ -61,5 +62,8 @@
+ (void)setBaseUrl:(NSString *)baseUrl;
+ (void)setGdprUrl:(NSString *)gdprUrl;

+ (void)enableSigning;
+ (void)disableSigning;

+ (void)teardown:(BOOL)deleteState;
@end
50 changes: 50 additions & 0 deletions Adjust/ADJAdjustFactory.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
static NSTimeInterval intervalTimerStart = -1;
static ADJBackoffStrategy * packageHandlerBackoffStrategy = nil;
static ADJBackoffStrategy * sdkClickHandlerBackoffStrategy = nil;
static ADJBackoffStrategy * installSessionBackoffStrategy = nil;
static BOOL internalTesting = NO;
static NSTimeInterval internalMaxDelayStart = -1;
static BOOL internaliAdFrameworkEnabled = YES;
Expand Down Expand Up @@ -113,6 +114,13 @@ + (ADJBackoffStrategy *)sdkClickHandlerBackoffStrategy {
return sdkClickHandlerBackoffStrategy;
}

+ (ADJBackoffStrategy *)installSessionBackoffStrategy {
if (installSessionBackoffStrategy == nil) {
return [ADJBackoffStrategy backoffStrategyWithType:ADJShortWait];
}
return installSessionBackoffStrategy;
}

+ (id<ADJAttributionHandler>)attributionHandlerForActivityHandler:(id<ADJActivityHandler>)activityHandler
startsSending:(BOOL)startsSending
{
Expand Down Expand Up @@ -226,6 +234,48 @@ + (void)setGdprUrl:(NSString *)gdprUrl {
internalGdprUrl = gdprUrl;
}

+ (void)enableSigning {
Class signerClass = NSClassFromString(@"ADJSigner");
if (signerClass == nil) {
return;
}

SEL enabledSEL = NSSelectorFromString(@"enableSigning");
if (![signerClass respondsToSelector:enabledSEL]) {
return;
}

IMP enableIMP = [signerClass methodForSelector:enabledSEL];
if (!enableIMP) {
return;
}

void (*enableFunc)(id, SEL) = (void *)enableIMP;

enableFunc(signerClass, enabledSEL);
}

+ (void)disableSigning {
Class signerClass = NSClassFromString(@"ADJSigner");
if (signerClass == nil) {
return;
}

SEL disableSEL = NSSelectorFromString(@"disableSigning");
if (![signerClass respondsToSelector:disableSEL]) {
return;
}

IMP disableIMP = [signerClass methodForSelector:disableSEL];
if (!disableIMP) {
return;
}

void (*disableFunc)(id, SEL) = (void *)disableIMP;

disableFunc(signerClass, disableSEL);
}

+ (void)teardown:(BOOL)deleteState {
if (deleteState) {
[ADJActivityHandler deleteState];
Expand Down
10 changes: 10 additions & 0 deletions Adjust/ADJConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@
*/
@property (nonatomic, assign) BOOL sendInBackground;

/**
* @brief Enables/disables reading of iAd framework data needed for ASA tracking.
*/
@property (nonatomic, assign) BOOL allowiAdInfoReading;

/**
* @brief Enables/disables reading of IDFA parameter.
*/
@property (nonatomic, assign) BOOL allowIdfaReading;

/**
* @brief Enables delayed start of the SDK.
*/
Expand Down
6 changes: 6 additions & 0 deletions Adjust/ADJConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ - (id)initWithAppToken:(NSString *)appToken

_appToken = appToken;
_environment = environment;

// default values
self.sendInBackground = NO;
self.eventBufferingEnabled = NO;
self.allowIdfaReading = YES;
self.allowiAdInfoReading = YES;

return self;
}
Expand Down Expand Up @@ -190,6 +194,8 @@ -(id)copyWithZone:(NSZone *)zone
copy.defaultTracker = [self.defaultTracker copyWithZone:zone];
copy.eventBufferingEnabled = self.eventBufferingEnabled;
copy.sendInBackground = self.sendInBackground;
copy.allowIdfaReading = self.allowIdfaReading;
copy.allowiAdInfoReading = self.allowiAdInfoReading;
copy.delayStart = self.delayStart;
copy.userAgent = [self.userAgent copyWithZone:zone];
copy.externalDeviceId = [self.externalDeviceId copyWithZone:zone];
Expand Down
Loading

0 comments on commit 08c9931

Please sign in to comment.