Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 4.21.3 #425

Merged
merged 14 commits into from
Apr 22, 2020
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.21.2"
s.version = "4.21.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.21.2" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.21.3" }
s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
s.framework = 'SystemConfiguration'
Expand Down
32 changes: 3 additions & 29 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
static NSString * const kForegroundTimerName = @"Foreground timer";
static NSString * const kBackgroundTimerName = @"Background timer";
static NSString * const kDelayStartTimerName = @"Delay Start timer";
static NSString * const kiAdTimeoutTimerName = @"iAd Timeout timer";

static NSTimeInterval kForegroundTimerInterval;
static NSTimeInterval kForegroundTimerStart;
Expand Down Expand Up @@ -87,7 +86,6 @@ @interface ADJActivityHandler()
@property (nonatomic, strong) ADJActivityState *activityState;
@property (nonatomic, strong) ADJTimerCycle *foregroundTimer;
@property (nonatomic, strong) ADJTimerOnce *backgroundTimer;
@property (nonatomic, strong) ADJTimerOnce *iAdTimeoutTimer;
@property (nonatomic, assign) NSInteger iAdRetriesLeft;
@property (nonatomic, strong) ADJInternalState *internalState;
@property (nonatomic, strong) ADJDeviceInfo *deviceInfo;
Expand All @@ -110,7 +108,6 @@ typedef NS_ENUM(NSInteger, AdjADClientError) {
AdjADClientErrorLimitAdTracking = 1,
AdjADClientErrorMissingData = 2,
AdjADClientErrorCorruptResponse = 3,
AdjCustomErrorTimeout = 100,
};

#pragma mark -
Expand Down Expand Up @@ -400,9 +397,6 @@ - (void)setTrackingStateOptedOut {
- (void)setAttributionDetails:(NSDictionary *)attributionDetails
error:(NSError *)error
{
if (self.iAdTimeoutTimer) {
[self.iAdTimeoutTimer cancel];
}
if (![ADJUtil isNull:error]) {
[self.logger warn:@"Unable to read iAd details"];

Expand All @@ -415,16 +409,14 @@ - (void)setAttributionDetails:(NSDictionary *)attributionDetails
// - AdjADClientErrorUnknown
// - AdjADClientErrorMissingData
// - AdjADClientErrorCorruptResponse
// - AdjCustomErrorTimeout
// apply following retry logic:
// - 1st retry after 5 seconds
// - 2nd retry after 2 seconds
// - 3rd retry after 2 seconds
switch (error.code) {
case AdjADClientErrorUnknown:
case AdjADClientErrorMissingData:
case AdjADClientErrorCorruptResponse:
case AdjCustomErrorTimeout: {
case AdjADClientErrorCorruptResponse: {
int64_t iAdRetryDelay = 0;
switch (self.iAdRetriesLeft) {
case 2:
Expand Down Expand Up @@ -638,9 +630,6 @@ - (void)teardown
if (self.backgroundTimer != nil) {
[self.backgroundTimer cancel];
}
if (self.iAdTimeoutTimer != nil) {
[self.iAdTimeoutTimer cancel];
}
if (self.foregroundTimer != nil) {
[self.foregroundTimer cancel];
}
Expand Down Expand Up @@ -668,7 +657,6 @@ - (void)teardown
self.sdkClickHandler = nil;
self.foregroundTimer = nil;
self.backgroundTimer = nil;
self.iAdTimeoutTimer = nil;
self.adjustDelegate = nil;
self.adjustConfig = nil;
self.internalState = nil;
Expand Down Expand Up @@ -1320,21 +1308,7 @@ - (void)checkForiAd {
}

- (void)checkForiAdI:(ADJActivityHandler *)selfI {
if (selfI.iAdTimeoutTimer == nil) {
selfI.iAdTimeoutTimer =
[ADJTimerOnce
timerWithBlock:^{
[selfI setAttributionDetails:nil
error:[NSError errorWithDomain:@"com.adjust.sdk.iAd"
code:100
userInfo:@{@"Error reason": @"iAd request timed out"}]];

}
queue:selfI.internalQueue
name:kiAdTimeoutTimerName];
}

[[UIDevice currentDevice] adjCheckForiAd:selfI iAdTimeoutTimer:selfI.iAdTimeoutTimer];
[[UIDevice currentDevice] adjCheckForiAd:selfI];
}

- (void)setOfflineModeI:(ADJActivityHandler *)selfI
Expand Down Expand Up @@ -1446,7 +1420,7 @@ - (void)appWillOpenUrlI:(ADJActivityHandler *)selfI
config:selfI.adjustConfig
sessionParameters:selfI.sessionParameters
createdAt:now];
clickBuilder.deeplinkParameters = adjustDeepLinks;
clickBuilder.deeplinkParameters = [adjustDeepLinks copy];
clickBuilder.attribution = deeplinkAttribution;
clickBuilder.clickTime = clickTime;
clickBuilder.deeplink = [url absoluteString];
Expand Down
3 changes: 1 addition & 2 deletions Adjust/ADJAdditions/UIDevice+ADJAdditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
- (NSString *)adjDeviceName;
- (NSString *)adjCreateUuid;
- (NSString *)adjVendorId;
- (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler
iAdTimeoutTimer:(ADJTimerOnce *)iAdTimeoutTimer;
- (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler;
@end
14 changes: 3 additions & 11 deletions Adjust/ADJAdditions/UIDevice+ADJAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ - (NSString *)adjVendorId {
return @"";
}

- (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler
iAdTimeoutTimer:(ADJTimerOnce *)iAdTimeoutTimer
{
- (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler {
// if no tries for iad v3 left, stop trying
id<ADJLogger> logger = [ADJAdjustFactory logger];

Expand Down Expand Up @@ -192,8 +190,7 @@ - (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler
[logger debug:@"iAd framework successfully found in user's app"];

BOOL iAdInformationAvailable = [self setiAdWithDetails:activityHandler
adcClientSharedInstance:ADClientSharedClientInstance
iAdTimeoutTimer:iAdTimeoutTimer];
adcClientSharedInstance:ADClientSharedClientInstance];

if (!iAdInformationAvailable) {
[logger warn:@"iAd information not available"];
Expand All @@ -204,9 +201,7 @@ - (void)adjCheckForiAd:(ADJActivityHandler *)activityHandler
}

- (BOOL)setiAdWithDetails:(ADJActivityHandler *)activityHandler
adcClientSharedInstance:(id)ADClientSharedClientInstance
iAdTimeoutTimer:(ADJTimerOnce *)iAdTimeoutTimer
{
adcClientSharedInstance:(id)ADClientSharedClientInstance {
SEL iAdDetailsSelector = NSSelectorFromString(@"requestAttributionDetailsWithBlock:");
if (![ADClientSharedClientInstance respondsToSelector:iAdDetailsSelector]) {
return NO;
Expand All @@ -220,9 +215,6 @@ - (BOOL)setiAdWithDetails:(ADJActivityHandler *)activityHandler
error:error];
}];
#pragma clang diagnostic pop
if (iAdTimeoutTimer) {
[iAdTimeoutTimer startIn:5.0];
}
return YES;
}

Expand Down
Loading