From 8cf53e3a88416c8dea55a7b9db0996c6702cb786 Mon Sep 17 00:00:00 2001 From: nonelse Date: Mon, 24 Apr 2017 15:48:03 +0200 Subject: [PATCH 01/17] Change assert log to warn in production --- Adjust/ADJConfig.m | 22 ++++------------------ Adjust/ADJLogger.h | 3 ++- Adjust/ADJLogger.m | 20 ++++++++++++++++++-- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Adjust/ADJConfig.m b/Adjust/ADJConfig.m index 9417606a6..74f4df2be 100644 --- a/Adjust/ADJConfig.m +++ b/Adjust/ADJConfig.m @@ -70,24 +70,10 @@ - (void)setLogLevel:(ADJLogLevel)logLevel { - (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]; + [self.logger setLogLevel:self.logLevel + isProductionEnvironment:[environment isEqualToString:ADJEnvironmentProduction]]; } - - (void)setDelegate:(NSObject *)delegate { BOOL hasResponseDelegate = NO; BOOL implementsDeeplinkCallback = NO; @@ -151,10 +137,10 @@ - (BOOL)checkEnvironment:(NSString *)environment return NO; } if ([environment isEqualToString:ADJEnvironmentSandbox]) { - [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"]; + [self.logger warnInProduction:@"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]) { - [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!"]; + [self.logger warnInProduction:@"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; } [self.logger error:@"Unknown environment '%@'", environment]; diff --git a/Adjust/ADJLogger.h b/Adjust/ADJLogger.h index a5a79c11e..20be0d952 100644 --- a/Adjust/ADJLogger.h +++ b/Adjust/ADJLogger.h @@ -27,7 +27,7 @@ typedef enum { * * @param logLevel Level of the logs to be displayed. */ -- (void)setLogLevel:(ADJLogLevel)logLevel; +- (void)setLogLevel:(ADJLogLevel)logLevel isProductionEnvironment:(BOOL)isProductionEnvironment; /** * @brief Prevent log level changes. @@ -53,6 +53,7 @@ typedef enum { * @brief Print warn logs. */ - (void)warn:(nonnull NSString *)message, ...; +- (void)warnInProduction:(nonnull NSString *)message, ...; /** * @brief Print error logs. diff --git a/Adjust/ADJLogger.m b/Adjust/ADJLogger.m index 002e7ef71..f31ad1ec1 100644 --- a/Adjust/ADJLogger.m +++ b/Adjust/ADJLogger.m @@ -14,6 +14,7 @@ @interface ADJLogger() @property (nonatomic, assign) ADJLogLevel loglevel; @property (nonatomic, assign) BOOL logLevelLocked; +@property (nonatomic, assign) BOOL isProductionEnvironment; @end @@ -25,17 +26,21 @@ - (id)init { if (self == nil) return nil; //default values - self.logLevelLocked = NO; _loglevel = ADJLogLevelInfo; + self.logLevelLocked = NO; + self.isProductionEnvironment = NO; return self; } -- (void)setLogLevel:(ADJLogLevel)logLevel { +- (void)setLogLevel:(ADJLogLevel)logLevel +isProductionEnvironment:(BOOL)isProductionEnvironment +{ if (self.logLevelLocked) { return; } _loglevel = logLevel; + self.isProductionEnvironment = isProductionEnvironment; } - (void)lockLogLevel { @@ -43,36 +48,47 @@ - (void)lockLogLevel { } - (void)verbose:(NSString *)format, ... { + if (self.isProductionEnvironment) return; if (self.loglevel > ADJLogLevelVerbose) return; va_list parameters; va_start(parameters, format); [self logLevel:@"v" format:format parameters:parameters]; } - (void)debug:(NSString *)format, ... { + if (self.isProductionEnvironment) return; if (self.loglevel > ADJLogLevelDebug) return; va_list parameters; va_start(parameters, format); [self logLevel:@"d" format:format parameters:parameters]; } - (void)info:(NSString *)format, ... { + if (self.isProductionEnvironment) return; if (self.loglevel > ADJLogLevelInfo) return; va_list parameters; va_start(parameters, format); [self logLevel:@"i" format:format parameters:parameters]; } - (void)warn:(NSString *)format, ... { + if (self.isProductionEnvironment) return; + if (self.loglevel > ADJLogLevelWarn) return; + va_list parameters; va_start(parameters, format); + [self logLevel:@"w" format:format parameters:parameters]; +} +- (void)warnInProduction:(nonnull NSString *)format, ... { if (self.loglevel > ADJLogLevelWarn) return; va_list parameters; va_start(parameters, format); [self logLevel:@"w" format:format parameters:parameters]; } - (void)error:(NSString *)format, ... { + if (self.isProductionEnvironment) return; if (self.loglevel > ADJLogLevelError) return; va_list parameters; va_start(parameters, format); [self logLevel:@"e" format:format parameters:parameters]; } - (void)assert:(NSString *)format, ... { + if (self.isProductionEnvironment) return; if (self.loglevel > ADJLogLevelAssert) return; va_list parameters; va_start(parameters, format); [self logLevel:@"a" format:format parameters:parameters]; From f3902a60df9299a1c3af94a19a283793de932af2 Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 26 Apr 2017 11:46:58 +0200 Subject: [PATCH 02/17] Check attribution from click response --- Adjust/ADJActivityHandler.h | 1 + Adjust/ADJActivityHandler.m | 32 +++++++++++++++++++++++++++++++- Adjust/ADJAdjustFactory.h | 3 ++- Adjust/ADJAdjustFactory.m | 7 ++++--- Adjust/ADJAttributionHandler.h | 2 ++ Adjust/ADJAttributionHandler.m | 16 ++++++++++++++++ Adjust/ADJResponseData.h | 3 +++ Adjust/ADJResponseData.m | 3 +++ Adjust/ADJSdkClickHandler.h | 7 +++++-- Adjust/ADJSdkClickHandler.m | 23 ++++++++++++++++++----- 10 files changed, 85 insertions(+), 12 deletions(-) diff --git a/Adjust/ADJActivityHandler.h b/Adjust/ADJActivityHandler.h index e3a102521..9164abef7 100644 --- a/Adjust/ADJActivityHandler.h +++ b/Adjust/ADJActivityHandler.h @@ -52,6 +52,7 @@ sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray - (void)finishedTracking:(ADJResponseData *)responseData; - (void)launchEventResponseTasks:(ADJEventResponseData *)eventResponseData; - (void)launchSessionResponseTasks:(ADJSessionResponseData *)sessionResponseData; +- (void)launchSdkClickResponseTasks:(ADJSdkClickResponseData *)sdkClickResponseData; - (void)launchAttributionResponseTasks:(ADJAttributionResponseData *)attributionResponseData; - (void)setEnabled:(BOOL)enabled; - (BOOL)isEnabled; diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index 636408f90..26eb82c0a 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -238,6 +238,12 @@ - (void)finishedTracking:(ADJResponseData *)responseData { return; } + // redirect sdk_click responses to attribution handler to check for attribution information + if ([responseData isKindOfClass:[ADJSdkClickResponseData class]]) { + [self.attributionHandler checkSdkClickResponse:(ADJSdkClickResponseData*)responseData]; + return; + } + // check if it's an event response if ([responseData isKindOfClass:[ADJEventResponseData class]]) { [self launchEventResponseTasks:(ADJEventResponseData*)responseData]; @@ -261,6 +267,14 @@ - (void)launchSessionResponseTasks:(ADJSessionResponseData *)sessionResponseData }]; } +- (void)launchSdkClickResponseTasks:(ADJSdkClickResponseData *)sdkClickResponseData { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI launchSdkClickResponseTasksI:selfI sdkClickResponseData:sdkClickResponseData]; + }]; +} + - (void)launchAttributionResponseTasks:(ADJAttributionResponseData *)attributionResponseData { [ADJUtil launchInQueue:self.internalQueue selfInject:self @@ -716,7 +730,8 @@ - (void)initI:(ADJActivityHandler *)selfI startsSending:[selfI toSendI:selfI sdkClickHandlerOnly:NO]]; - selfI.sdkClickHandler = [ADJAdjustFactory sdkClickHandlerWithStartsPaused:[selfI toSendI:selfI + selfI.sdkClickHandler = [ADJAdjustFactory sdkClickHandlerWithStartsPaused:selfI + startsSending:[selfI toSendI:selfI sdkClickHandlerOnly:YES]]; [[UIDevice currentDevice] adjSetIad:selfI triesV3Left:kTryIadV3]; @@ -930,6 +945,21 @@ - (void)launchSessionResponseTasksI:(ADJActivityHandler *)selfI self.internalState.sessionResponseProcessed = YES; } +- (void)launchSdkClickResponseTasksI:(ADJActivityHandler *)selfI + sdkClickResponseData:(ADJSdkClickResponseData *)sdkClickResponseData { + [selfI updateAdidI:selfI adid:sdkClickResponseData.adid]; + + BOOL toLaunchAttributionDelegate = [selfI updateAttributionI:selfI attribution:sdkClickResponseData.attribution]; + + // try to update and launch the attribution changed delegate + if (toLaunchAttributionDelegate) { + [selfI.logger debug:@"Launching attribution changed delegate"]; + [ADJUtil launchInMainThread:selfI.adjustDelegate + selector:@selector(adjustAttributionChanged:) + withObject:sdkClickResponseData.attribution]; + } +} + - (void)launchAttributionResponseTasksI:(ADJActivityHandler *)selfI attributionResponseData:(ADJAttributionResponseData *)attributionResponseData { [selfI updateAdidI:selfI adid:attributionResponseData.adid]; diff --git a/Adjust/ADJAdjustFactory.h b/Adjust/ADJAdjustFactory.h index 8889efc3c..02a6a9fbc 100644 --- a/Adjust/ADJAdjustFactory.h +++ b/Adjust/ADJAdjustFactory.h @@ -24,7 +24,8 @@ + (id)activityHandlerWithConfig:(ADJConfig *)adjustConfig sessionParametersActionsArray:(NSArray*)sessionParametersActionsArray deviceToken:(NSData*)deviceToken; -+ (id)sdkClickHandlerWithStartsPaused:(BOOL)startsSending; ++ (id)sdkClickHandlerWithStartsPaused:(id)activityHandler + startsSending:(BOOL)startsSending; + (id)logger; + (double)sessionInterval; diff --git a/Adjust/ADJAdjustFactory.m b/Adjust/ADJAdjustFactory.m index 06a1022cf..a2de8f731 100644 --- a/Adjust/ADJAdjustFactory.m +++ b/Adjust/ADJAdjustFactory.m @@ -122,13 +122,14 @@ + (ADJBackoffStrategy *)sdkClickHandlerBackoffStrategy { startsSending:startsSending]; } -+ (id)sdkClickHandlerWithStartsPaused:(BOOL)startsSending ++ (id)sdkClickHandlerWithStartsPaused:(id)activityHandler + startsSending:(BOOL)startsSending { if (internalSdkClickHandler == nil) { - return [ADJSdkClickHandler handlerWithStartsSending:startsSending]; + return [ADJSdkClickHandler handlerWithActivityHandler:activityHandler startsSending:startsSending]; } - return [internalSdkClickHandler initWithStartsSending:startsSending]; + return [internalSdkClickHandler initWithActivityHandler:activityHandler startsSending:startsSending]; } + (BOOL)testing { diff --git a/Adjust/ADJAttributionHandler.h b/Adjust/ADJAttributionHandler.h index ea73e90cd..b460c63b7 100644 --- a/Adjust/ADJAttributionHandler.h +++ b/Adjust/ADJAttributionHandler.h @@ -18,6 +18,8 @@ - (void)checkSessionResponse:(ADJSessionResponseData *)sessionResponseData; +- (void)checkSdkClickResponse:(ADJSdkClickResponseData *)sdkClickResponseData; + - (void)checkAttributionResponse:(ADJAttributionResponseData *)attributionResponseData; - (void)getAttribution; diff --git a/Adjust/ADJAttributionHandler.m b/Adjust/ADJAttributionHandler.m index a38f438c6..5f506f8b6 100644 --- a/Adjust/ADJAttributionHandler.m +++ b/Adjust/ADJAttributionHandler.m @@ -74,6 +74,15 @@ - (void)checkSessionResponse:(ADJSessionResponseData *)sessionResponseData { }]; } +- (void)checkSdkClickResponse:(ADJSdkClickResponseData *)sdkClickResponseData { + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJAttributionHandler* selfI) { + [selfI checkSdkClickResponseI:selfI + sdkClickResponseData:sdkClickResponseData]; + }]; +} + - (void)checkAttributionResponse:(ADJAttributionResponseData *)attributionResponseData { [ADJUtil launchInQueue:self.internalQueue selfInject:self @@ -110,6 +119,13 @@ - (void)checkSessionResponseI:(ADJAttributionHandler*)selfI [selfI.activityHandler launchSessionResponseTasks:sessionResponseData]; } +- (void)checkSdkClickResponseI:(ADJAttributionHandler*)selfI + sdkClickResponseData:(ADJSdkClickResponseData *)sdkClickResponseData { + [selfI checkAttributionI:selfI responseData:sdkClickResponseData]; + + [selfI.activityHandler launchSdkClickResponseTasks:sdkClickResponseData]; +} + - (void)checkAttributionResponseI:(ADJAttributionHandler*)selfI attributionResponseData:(ADJAttributionResponseData *)attributionResponseData { [selfI checkAttributionI:selfI responseData:attributionResponseData]; diff --git a/Adjust/ADJResponseData.h b/Adjust/ADJResponseData.h index 8199ba8bc..2d74f34a1 100644 --- a/Adjust/ADJResponseData.h +++ b/Adjust/ADJResponseData.h @@ -51,6 +51,9 @@ @end +@interface ADJSdkClickResponseData : ADJResponseData +@end + @interface ADJEventResponseData : ADJResponseData @property (nonatomic, copy) NSString *eventToken; diff --git a/Adjust/ADJResponseData.m b/Adjust/ADJResponseData.m index c876e1cff..e8433b1ef 100644 --- a/Adjust/ADJResponseData.m +++ b/Adjust/ADJResponseData.m @@ -40,6 +40,9 @@ + (id)buildResponseData:(ADJActivityPackage *)activityPackage { case ADJActivityKindSession: responseData = [[ADJSessionResponseData alloc] init]; break; + case ADJActivityKindClick: + responseData = [[ADJSdkClickResponseData alloc] init]; + break; case ADJActivityKindEvent: responseData = [[ADJEventResponseData alloc] initWithActivityPackage:activityPackage]; break; diff --git a/Adjust/ADJSdkClickHandler.h b/Adjust/ADJSdkClickHandler.h index dcc779c26..3f8c63bcd 100644 --- a/Adjust/ADJSdkClickHandler.h +++ b/Adjust/ADJSdkClickHandler.h @@ -8,10 +8,12 @@ #import #import "ADJActivityPackage.h" +#import "ADJActivityHandler.h" @protocol ADJSdkClickHandler -- (id)initWithStartsSending:(BOOL)startsSending; +- (id)initWithActivityHandler:(id)activityHandler + startsSending:(BOOL)startsSending; - (void)pauseSending; - (void)resumeSending; @@ -22,6 +24,7 @@ @interface ADJSdkClickHandler : NSObject -+ (id)handlerWithStartsSending:(BOOL)startsSending; ++ (id)handlerWithActivityHandler:(id)activityHandler + startsSending:(BOOL)startsSending; @end diff --git a/Adjust/ADJSdkClickHandler.m b/Adjust/ADJSdkClickHandler.m index 2adb30587..de38bd59f 100644 --- a/Adjust/ADJSdkClickHandler.m +++ b/Adjust/ADJSdkClickHandler.m @@ -23,17 +23,21 @@ @interface ADJSdkClickHandler() @property (nonatomic, assign) BOOL paused; @property (nonatomic, strong) NSMutableArray *packageQueue; @property (nonatomic, strong) NSURL *baseUrl; +@property (nonatomic, weak) id activityHandler; @end @implementation ADJSdkClickHandler -+ (id)handlerWithStartsSending:(BOOL)startsSending ++ (id)handlerWithActivityHandler:(id)activityHandler + startsSending:(BOOL)startsSending { - return [[ADJSdkClickHandler alloc] initWithStartsSending:startsSending]; + return [[ADJSdkClickHandler alloc] initWithActivityHandler:activityHandler + startsSending:startsSending]; } -- (id)initWithStartsSending:(BOOL)startsSending +- (id)initWithActivityHandler:(id)activityHandler + startsSending:(BOOL)startsSending { self = [super init]; if (self == nil) return nil; @@ -41,12 +45,13 @@ - (id)initWithStartsSending:(BOOL)startsSending self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); self.logger = ADJAdjustFactory.logger; - self.paused = !startsSending; [ADJUtil launchInQueue:self.internalQueue selfInject:self block:^(ADJSdkClickHandler * selfI) { - [selfI initI:selfI]; + [selfI initI:selfI + activityHandler:activityHandler + startsSending:startsSending]; }]; return self; } @@ -87,11 +92,16 @@ - (void)teardown { self.backoffStrategy = nil; self.packageQueue = nil; self.baseUrl = nil; + self.activityHandler = nil; } #pragma mark - internal - (void)initI:(ADJSdkClickHandler *)selfI +activityHandler:(id)activityHandler +startsSending:(BOOL)startsSending { + selfI.activityHandler = activityHandler; + selfI.paused = !startsSending; selfI.backoffStrategy = [ADJAdjustFactory sdkClickHandlerBackoffStrategy]; selfI.packageQueue = [NSMutableArray array]; selfI.baseUrl = [NSURL URLWithString:ADJUtil.baseUrl]; @@ -138,7 +148,10 @@ - (void)sendNextSdkClickI:(ADJSdkClickHandler *)selfI [selfI.logger error:@"Retrying sdk_click package for the %d time", retries]; [selfI sendSdkClick:sdkClickPackage]; + return; } + + [selfI.activityHandler finishedTracking:responseData]; }]; [selfI sendNextSdkClick]; From e369b39dc1ce0c7a17014a80ab3a886a3c4ab0c1 Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 26 Apr 2017 11:47:13 +0200 Subject: [PATCH 03/17] Remove unused allowSupress var --- Adjust/ADJConfig.m | 2 -- 1 file changed, 2 deletions(-) diff --git a/Adjust/ADJConfig.m b/Adjust/ADJConfig.m index 74f4df2be..fd7a1e43a 100644 --- a/Adjust/ADJConfig.m +++ b/Adjust/ADJConfig.m @@ -15,7 +15,6 @@ @interface ADJConfig() @property (nonatomic, weak) id logger; -@property (nonatomic, assign) BOOL allowSuppressLogLevel; @end @@ -48,7 +47,6 @@ - (id)initWithAppToken:(NSString *)appToken self = [super init]; if (self == nil) return nil; - self.allowSuppressLogLevel = allowSuppressLogLevel; self.logger = ADJAdjustFactory.logger; // default values [self setLogLevel:ADJLogLevelInfo environment:environment]; From d0f14f78786197aaa9835a03d5193f141f944a1a Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 26 Apr 2017 12:08:08 +0200 Subject: [PATCH 04/17] Send attributable parameters with sdk_click --- Adjust/ADJActivityHandler.m | 59 ++++++++++++++++++++++--------------- Adjust/ADJPackageBuilder.h | 3 +- Adjust/ADJPackageBuilder.m | 37 +++++++++++++++-------- 3 files changed, 63 insertions(+), 36 deletions(-) diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index 26eb82c0a..e68766288 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -413,27 +413,14 @@ - (void)setDeviceToken:(NSData *)deviceToken { }]; } -- (void)setIadDate:(NSDate *)iAdImpressionDate withPurchaseDate:(NSDate *)appPurchaseDate { - if (iAdImpressionDate == nil) { - [self.logger debug:@"iAdImpressionDate not received"]; - return; - } - - [self.logger debug:@"iAdImpressionDate received: %@", iAdImpressionDate]; - - - double now = [NSDate.date timeIntervalSince1970]; - ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] - initWithDeviceInfo:self.deviceInfo - activityState:self.activityState - config:self.adjustConfig - createdAt:now]; - - clickBuilder.purchaseTime = appPurchaseDate; - clickBuilder.clickTime = iAdImpressionDate; - - ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"iad"]; - [self.sdkClickHandler sendSdkClick:clickPackage]; +- (void)setIadDate:(NSDate *)iAdImpressionDate + withPurchaseDate:(NSDate *)appPurchaseDate +{ + [ADJUtil launchInQueue:self.internalQueue + selfInject:self + block:^(ADJActivityHandler * selfI) { + [selfI setIadDateI:selfI iAdImpressionDate:iAdImpressionDate withPurchaseDate:appPurchaseDate]; + }]; } - (void)setAttributionDetails:(NSDictionary *)attributionDetails @@ -507,7 +494,7 @@ - (void)sendIad3ClickPackage:(ADJActivityHandler *)selfI clickBuilder.attributionDetails = attributionDetails; - ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"iad3"]; + ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"iad3" sessionParameters:selfI.sessionParameters]; [selfI.sdkClickHandler sendSdkClick:clickPackage]; } @@ -1074,7 +1061,7 @@ - (void)appWillOpenUrlI:(ADJActivityHandler *)selfI clickBuilder.clickTime = [NSDate date]; clickBuilder.deeplink = [url absoluteString]; - ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"deeplink"]; + ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"deeplink" sessionParameters:selfI.sessionParameters]; [selfI.sdkClickHandler sendSdkClick:clickPackage]; } @@ -1163,6 +1150,32 @@ - (void)setDeviceTokenI:(ADJActivityHandler *)selfI [selfI.packageHandler sendFirstPackage]; } +- (void)setIadDateI:(ADJActivityHandler *)selfI + iAdImpressionDate:(NSDate *)iAdImpressionDate + withPurchaseDate:(NSDate *)appPurchaseDate +{ + if (iAdImpressionDate == nil) { + [self.logger debug:@"iAdImpressionDate not received"]; + return; + } + + [self.logger debug:@"iAdImpressionDate received: %@", iAdImpressionDate]; + + double now = [NSDate.date timeIntervalSince1970]; + ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] + initWithDeviceInfo:self.deviceInfo + activityState:self.activityState + config:self.adjustConfig + createdAt:now]; + + clickBuilder.purchaseTime = appPurchaseDate; + clickBuilder.clickTime = iAdImpressionDate; + + ADJActivityPackage *clickPackage = [clickBuilder buildClickPackage:@"iad" sessionParameters:selfI.sessionParameters]; + [self.sdkClickHandler sendSdkClick:clickPackage]; +} + + #pragma mark - private - (BOOL)isEnabledI:(ADJActivityHandler *)selfI { diff --git a/Adjust/ADJPackageBuilder.h b/Adjust/ADJPackageBuilder.h index f7471c30b..b4eab24cd 100644 --- a/Adjust/ADJPackageBuilder.h +++ b/Adjust/ADJPackageBuilder.h @@ -41,7 +41,8 @@ sessionParameters:(ADJSessionParameters *)sessionParameters isInDelay:(BOOL)isInDelay; -- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource; +- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource + sessionParameters:(ADJSessionParameters *)sessionParameters; - (ADJActivityPackage *)buildInfoPackage:(NSString *)infoSource; diff --git a/Adjust/ADJPackageBuilder.m b/Adjust/ADJPackageBuilder.m index cf3b26e5a..15224ad81 100644 --- a/Adjust/ADJPackageBuilder.m +++ b/Adjust/ADJPackageBuilder.m @@ -51,17 +51,11 @@ - (id)initWithDeviceInfo:(ADJDeviceInfo *)deviceInfo - (ADJActivityPackage *)buildSessionPackage:(ADJSessionParameters *)sessionParameters isInDelay:(BOOL)isInDelay { - NSMutableDictionary *parameters = [self defaultParameters]; - - [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; - [ADJPackageBuilder parameters:parameters setString:[ADJUtil getUpdateTime] forKey:@"app_updated_at"]; - [ADJPackageBuilder parameters:parameters setString:[ADJUtil getInstallTime] forKey:@"installed_at"]; - [ADJPackageBuilder parameters:parameters setDuration:self.activityState.lastInterval forKey:@"last_interval"]; - [ADJPackageBuilder parameters:parameters setString:self.adjustConfig.defaultTracker forKey:@"default_tracker"]; - + NSMutableDictionary *parameters; if (!isInDelay) { - [ADJPackageBuilder parameters:parameters setDictionary:sessionParameters.callbackParameters forKey:@"callback_params"]; - [ADJPackageBuilder parameters:parameters setDictionary:sessionParameters.partnerParameters forKey:@"partner_params"]; + parameters = [self attributableParameters:sessionParameters]; + } else { + parameters = [self attributableParameters:nil]; } ADJActivityPackage *sessionPackage = [self defaultActivityPackage]; @@ -123,8 +117,10 @@ - (ADJActivityPackage *)buildEventPackage:(ADJEvent *)event return eventPackage; } -- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource { - NSMutableDictionary *parameters = [self idsParameters]; +- (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource + sessionParameters:(ADJSessionParameters *)sessionParameters +{ + NSMutableDictionary *parameters = [self attributableParameters:sessionParameters]; [ADJPackageBuilder parameters:parameters setString:clickSource forKey:@"source"]; [ADJPackageBuilder parameters:parameters setDictionary:self.deeplinkParameters forKey:@"params"]; @@ -199,6 +195,23 @@ - (NSMutableDictionary *)idsParameters { return parameters; } +- (NSMutableDictionary *)attributableParameters:(ADJSessionParameters *)sessionParameters { + NSMutableDictionary *parameters = [self defaultParameters]; + + [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; + [ADJPackageBuilder parameters:parameters setString:[ADJUtil getUpdateTime] forKey:@"app_updated_at"]; + [ADJPackageBuilder parameters:parameters setString:[ADJUtil getInstallTime] forKey:@"installed_at"]; + [ADJPackageBuilder parameters:parameters setDuration:self.activityState.lastInterval forKey:@"last_interval"]; + [ADJPackageBuilder parameters:parameters setString:self.adjustConfig.defaultTracker forKey:@"default_tracker"]; + + if (sessionParameters != nil) { + [ADJPackageBuilder parameters:parameters setDictionary:sessionParameters.callbackParameters forKey:@"callback_params"]; + [ADJPackageBuilder parameters:parameters setDictionary:sessionParameters.partnerParameters forKey:@"partner_params"]; + } + + return parameters; +} + - (NSMutableDictionary *)defaultParameters { NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; From a78d00905fc9897c8b3feb205e74ea5b9856d07c Mon Sep 17 00:00:00 2001 From: easteracrobat Date: Thu, 27 Apr 2017 10:33:34 +0200 Subject: [PATCH 05/17] alloy-ammendment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dbf01d61c..419f65da4 100644 --- a/README.md +++ b/README.md @@ -346,7 +346,7 @@ You can read more about special partners and these integrations in our [guide to 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. +If you want to send session parameters with the initial install event, they must be called before the Adjust SDK launches via `[Adjust appDidLaunch:]`. 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 behavior. ### Session callback parameters From aa6adf90f4706f022c2ac948a1769a11fec43db7 Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 26 Apr 2017 15:09:12 +0200 Subject: [PATCH 06/17] Update last interval in sdk_click --- Adjust/ADJActivityHandler.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Adjust/ADJActivityHandler.m b/Adjust/ADJActivityHandler.m index e68766288..75d10595c 100644 --- a/Adjust/ADJActivityHandler.m +++ b/Adjust/ADJActivityHandler.m @@ -486,6 +486,10 @@ - (void)sendIad3ClickPackage:(ADJActivityHandler *)selfI attributionDetails:(NSDictionary *)attributionDetails { double now = [NSDate.date timeIntervalSince1970]; + if (selfI.activityState != nil) { + double lastInterval = now - selfI.activityState.lastActivity; + selfI.activityState.lastInterval = lastInterval; + } ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:selfI.deviceInfo activityState:selfI.activityState @@ -1051,6 +1055,9 @@ - (void)appWillOpenUrlI:(ADJActivityHandler *)selfI } double now = [NSDate.date timeIntervalSince1970]; + double lastInterval = now - selfI.activityState.lastActivity; + selfI.activityState.lastInterval = lastInterval; + ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:selfI.deviceInfo activityState:selfI.activityState @@ -1162,6 +1169,11 @@ - (void)setIadDateI:(ADJActivityHandler *)selfI [self.logger debug:@"iAdImpressionDate received: %@", iAdImpressionDate]; double now = [NSDate.date timeIntervalSince1970]; + if (selfI.activityState != nil) { + double lastInterval = now - selfI.activityState.lastActivity; + selfI.activityState.lastInterval = lastInterval; + } + ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo activityState:self.activityState From 3051267ddb7544fc308b485190263b1fc310b96c Mon Sep 17 00:00:00 2001 From: uerceg Date: Wed, 3 May 2017 13:43:54 +0200 Subject: [PATCH 07/17] Adding test host app --- Adjust.xcodeproj/project.pbxproj | 176 ++++++++++++++++++ AdjustExampleTests/AppDelegate.h | 17 ++ AdjustExampleTests/AppDelegate.m | 51 +++++ .../AppIcon.appiconset/Contents.json | 48 +++++ .../Base.lproj/LaunchScreen.storyboard | 27 +++ AdjustExampleTests/Base.lproj/Main.storyboard | 26 +++ AdjustExampleTests/Info.plist | 38 ++++ AdjustExampleTests/ViewController.h | 15 ++ AdjustExampleTests/ViewController.m | 29 +++ AdjustExampleTests/main.m | 16 ++ 10 files changed, 443 insertions(+) create mode 100644 AdjustExampleTests/AppDelegate.h create mode 100644 AdjustExampleTests/AppDelegate.m create mode 100644 AdjustExampleTests/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 AdjustExampleTests/Base.lproj/LaunchScreen.storyboard create mode 100644 AdjustExampleTests/Base.lproj/Main.storyboard create mode 100644 AdjustExampleTests/Info.plist create mode 100644 AdjustExampleTests/ViewController.h create mode 100644 AdjustExampleTests/ViewController.m create mode 100644 AdjustExampleTests/main.m diff --git a/Adjust.xcodeproj/project.pbxproj b/Adjust.xcodeproj/project.pbxproj index 32a211f62..0b484443d 100644 --- a/Adjust.xcodeproj/project.pbxproj +++ b/Adjust.xcodeproj/project.pbxproj @@ -134,6 +134,12 @@ 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, ); }; }; + 9D7431EA1EB9F9B700969F14 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D7431E91EB9F9B700969F14 /* main.m */; }; + 9D7431ED1EB9F9B700969F14 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D7431EC1EB9F9B700969F14 /* AppDelegate.m */; }; + 9D7431F01EB9F9B700969F14 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D7431EF1EB9F9B700969F14 /* ViewController.m */; }; + 9D7431F31EB9F9B700969F14 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9D7431F11EB9F9B700969F14 /* Main.storyboard */; }; + 9D7431F51EB9F9B700969F14 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9D7431F41EB9F9B700969F14 /* Assets.xcassets */; }; + 9D7431F81EB9F9B700969F14 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9D7431F61EB9F9B700969F14 /* LaunchScreen.storyboard */; }; 9DB457B01D743704004D69E8 /* ADJBackoffStrategy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8DF1D6F3CA5008E362F /* ADJBackoffStrategy.m */; }; 9DB457B11D743704004D69E8 /* ADJSdkClickHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DF9C8F71D6F3CA5008E362F /* ADJSdkClickHandler.m */; }; 9DCAE04B1E5334F4009DD542 /* ADJConnectionValidator.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DCAE0491E5334F4009DD542 /* ADJConnectionValidator.h */; }; @@ -324,6 +330,13 @@ remoteGlobalIDString = 9D1082A41CFDAF8E0050568B; remoteInfo = "AdjustExample-WebView"; }; + 9D7432041EB9F9CF00969F14 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9679920518BBAE2800394606 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9D7431E51EB9F9B700969F14; + remoteInfo = AdjustExampleTests; + }; 9DE7C8FF1AE68EF1001556E5 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9679920518BBAE2800394606 /* Project object */; @@ -492,6 +505,16 @@ 9D449DBF1E6ED23900E7E80B /* AdjustExample-Swift.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-Swift.xcodeproj"; path = "examples/AdjustExample-Swift/AdjustExample-Swift.xcodeproj"; sourceTree = ""; }; 9D449DC51E6ED24000E7E80B /* AdjustExample-tvOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-tvOS.xcodeproj"; path = "examples/AdjustExample-tvOS/AdjustExample-tvOS.xcodeproj"; sourceTree = ""; }; 9D449DCB1E6ED24400E7E80B /* AdjustExample-WebView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "AdjustExample-WebView.xcodeproj"; path = "examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj"; sourceTree = ""; }; + 9D7431E61EB9F9B700969F14 /* AdjustExampleTests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AdjustExampleTests.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9D7431E91EB9F9B700969F14 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 9D7431EB1EB9F9B700969F14 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 9D7431EC1EB9F9B700969F14 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9D7431EE1EB9F9B700969F14 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 9D7431EF1EB9F9B700969F14 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 9D7431F21EB9F9B700969F14 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 9D7431F41EB9F9B700969F14 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 9D7431F71EB9F9B700969F14 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 9D7431F91EB9F9B700969F14 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; 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 = ""; }; @@ -669,6 +692,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9D7431E31EB9F9B700969F14 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9DFA37A91C0F219400782607 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -738,6 +768,7 @@ 9DFA37AD1C0F219400782607 /* AdjustSdk.framework */, 9615158F1CD2CB2C0022D336 /* libAdjustBridge.a */, 9DFB06101D747070006D48FC /* AdjustSdkTv.framework */, + 9D7431E61EB9F9B700969F14 /* AdjustExampleTests.app */, ); name = Products; sourceTree = ""; @@ -838,6 +869,7 @@ 96E5E39A18BBB49E008E7B30 /* AdjustTests */ = { isa = PBXGroup; children = ( + 9D7431E71EB9F9B700969F14 /* AdjustExampleTests */, 96E5E39B18BBB49E008E7B30 /* Adjust-Prefix.pch */, 96E5E39C18BBB49E008E7B30 /* AdjustTests-Info.plist */, 96E5E39D18BBB49E008E7B30 /* ADJActivityHandlerMock.h */, @@ -942,6 +974,31 @@ name = Products; sourceTree = ""; }; + 9D7431E71EB9F9B700969F14 /* AdjustExampleTests */ = { + isa = PBXGroup; + children = ( + 9D7431EB1EB9F9B700969F14 /* AppDelegate.h */, + 9D7431EC1EB9F9B700969F14 /* AppDelegate.m */, + 9D7431EE1EB9F9B700969F14 /* ViewController.h */, + 9D7431EF1EB9F9B700969F14 /* ViewController.m */, + 9D7431F11EB9F9B700969F14 /* Main.storyboard */, + 9D7431F41EB9F9B700969F14 /* Assets.xcassets */, + 9D7431F61EB9F9B700969F14 /* LaunchScreen.storyboard */, + 9D7431F91EB9F9B700969F14 /* Info.plist */, + 9D7431E81EB9F9B700969F14 /* Supporting Files */, + ); + name = AdjustExampleTests; + path = ../AdjustExampleTests; + sourceTree = ""; + }; + 9D7431E81EB9F9B700969F14 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9D7431E91EB9F9B700969F14 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; 9DF9C8C81D6F3CA5008E362F /* Adjust */ = { isa = PBXGroup; children = ( @@ -1295,12 +1352,30 @@ ); dependencies = ( 9679922418BBAE2800394606 /* PBXTargetDependency */, + 9D7432051EB9F9CF00969F14 /* PBXTargetDependency */, ); name = AdjustTests; productName = AdjustTests; productReference = 9679921D18BBAE2800394606 /* AdjustTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 9D7431E51EB9F9B700969F14 /* AdjustExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9D7432031EB9F9B700969F14 /* Build configuration list for PBXNativeTarget "AdjustExampleTests" */; + buildPhases = ( + 9D7431E21EB9F9B700969F14 /* Sources */, + 9D7431E31EB9F9B700969F14 /* Frameworks */, + 9D7431E41EB9F9B700969F14 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AdjustExampleTests; + productName = AdjustExampleTests; + productReference = 9D7431E61EB9F9B700969F14 /* AdjustExampleTests.app */; + productType = "com.apple.product-type.application"; + }; 9DFA37AC1C0F219400782607 /* AdjustSdk */ = { isa = PBXNativeTarget; buildConfigurationList = 9DFA37B21C0F219400782607 /* Build configuration list for PBXNativeTarget "AdjustSdk" */; @@ -1351,9 +1426,17 @@ 9615158E1CD2CB2C0022D336 = { CreatedOnToolsVersion = 7.3.1; }; + 9679921C18BBAE2800394606 = { + TestTargetID = 9D7431E51EB9F9B700969F14; + }; 96BCFBE71AC99FBD005A65C5 = { CreatedOnToolsVersion = 6.2; }; + 9D7431E51EB9F9B700969F14 = { + CreatedOnToolsVersion = 8.3.2; + DevelopmentTeam = QGUGW9AUMK; + ProvisioningStyle = Automatic; + }; 9DFA37AC1C0F219400782607 = { CreatedOnToolsVersion = 7.1.1; }; @@ -1368,6 +1451,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 9679920418BBAE2800394606; productRefGroup = 9679920E18BBAE2800394606 /* Products */; @@ -1402,6 +1486,7 @@ 96BCFBE71AC99FBD005A65C5 /* AdjustStatic */, 9615158E1CD2CB2C0022D336 /* AdjustBridge */, 9679921C18BBAE2800394606 /* AdjustTests */, + 9D7431E51EB9F9B700969F14 /* AdjustExampleTests */, ); }; /* End PBXProject section */ @@ -1467,6 +1552,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9D7431E41EB9F9B700969F14 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9D7431F81EB9F9B700969F14 /* LaunchScreen.storyboard in Resources */, + 9D7431F51EB9F9B700969F14 /* Assets.xcassets in Resources */, + 9D7431F31EB9F9B700969F14 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9DFA37AB1C0F219400782607 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -1631,6 +1726,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 9D7431E21EB9F9B700969F14 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9D7431F01EB9F9B700969F14 /* ViewController.m in Sources */, + 9D7431ED1EB9F9B700969F14 /* AppDelegate.m in Sources */, + 9D7431EA1EB9F9B700969F14 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 9DFA37A81C0F219400782607 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1717,6 +1822,11 @@ target = 9679920C18BBAE2800394606 /* Adjust */; targetProxy = 9679922318BBAE2800394606 /* PBXContainerItemProxy */; }; + 9D7432051EB9F9CF00969F14 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9D7431E51EB9F9B700969F14 /* AdjustExampleTests */; + targetProxy = 9D7432041EB9F9CF00969F14 /* PBXContainerItemProxy */; + }; 9DE7C9001AE68EF1001556E5 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9679920C18BBAE2800394606 /* Adjust */; @@ -1733,6 +1843,22 @@ name = InfoPlist.strings; sourceTree = ""; }; + 9D7431F11EB9F9B700969F14 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9D7431F21EB9F9B700969F14 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 9D7431F61EB9F9B700969F14 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9D7431F71EB9F9B700969F14 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -1922,6 +2048,7 @@ OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "adjust.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AdjustExampleTests.app/AdjustExampleTests"; WRAPPER_EXTENSION = xctest; }; name = Debug; @@ -1939,6 +2066,7 @@ OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "adjust.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AdjustExampleTests.app/AdjustExampleTests"; WRAPPER_EXTENSION = xctest; }; name = Release; @@ -1959,6 +2087,46 @@ }; name = Release; }; + 9D7431FA1EB9F9B700969F14 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = QGUGW9AUMK; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = AdjustExampleTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.examples; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 9D7431FB1EB9F9B700969F14 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = QGUGW9AUMK; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = AdjustExampleTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.adjust.examples; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 9DFA37B31C0F219400782607 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2129,6 +2297,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 9D7432031EB9F9B700969F14 /* Build configuration list for PBXNativeTarget "AdjustExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9D7431FA1EB9F9B700969F14 /* Debug */, + 9D7431FB1EB9F9B700969F14 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 9DFA37B21C0F219400782607 /* Build configuration list for PBXNativeTarget "AdjustSdk" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/AdjustExampleTests/AppDelegate.h b/AdjustExampleTests/AppDelegate.h new file mode 100644 index 000000000..8fc7f4379 --- /dev/null +++ b/AdjustExampleTests/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// AdjustExampleTests +// +// Created by Uglješa Erceg on 03.05.17. +// Copyright © 2017 adjust GmbH. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/AdjustExampleTests/AppDelegate.m b/AdjustExampleTests/AppDelegate.m new file mode 100644 index 000000000..3b819a4e6 --- /dev/null +++ b/AdjustExampleTests/AppDelegate.m @@ -0,0 +1,51 @@ +// +// AppDelegate.m +// AdjustExampleTests +// +// Created by Uglješa Erceg on 03.05.17. +// Copyright © 2017 adjust GmbH. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // 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 invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // 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. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // 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. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + + +@end diff --git a/AdjustExampleTests/Assets.xcassets/AppIcon.appiconset/Contents.json b/AdjustExampleTests/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..b8236c653 --- /dev/null +++ b/AdjustExampleTests/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,48 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/AdjustExampleTests/Base.lproj/LaunchScreen.storyboard b/AdjustExampleTests/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..fdf3f97d1 --- /dev/null +++ b/AdjustExampleTests/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AdjustExampleTests/Base.lproj/Main.storyboard b/AdjustExampleTests/Base.lproj/Main.storyboard new file mode 100644 index 000000000..4529698c4 --- /dev/null +++ b/AdjustExampleTests/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AdjustExampleTests/Info.plist b/AdjustExampleTests/Info.plist new file mode 100644 index 000000000..38e98af23 --- /dev/null +++ b/AdjustExampleTests/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/AdjustExampleTests/ViewController.h b/AdjustExampleTests/ViewController.h new file mode 100644 index 000000000..bedda2517 --- /dev/null +++ b/AdjustExampleTests/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// AdjustExampleTests +// +// Created by Uglješa Erceg on 03.05.17. +// Copyright © 2017 adjust GmbH. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/AdjustExampleTests/ViewController.m b/AdjustExampleTests/ViewController.m new file mode 100644 index 000000000..1e67ec8c7 --- /dev/null +++ b/AdjustExampleTests/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// AdjustExampleTests +// +// Created by Uglješa Erceg on 03.05.17. +// Copyright © 2017 adjust GmbH. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +@end diff --git a/AdjustExampleTests/main.m b/AdjustExampleTests/main.m new file mode 100644 index 000000000..e596e1273 --- /dev/null +++ b/AdjustExampleTests/main.m @@ -0,0 +1,16 @@ +// +// main.m +// AdjustExampleTests +// +// Created by Uglješa Erceg on 03.05.17. +// Copyright © 2017 adjust GmbH. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} From 16c8e5377ea4dbd6ed667b10b3ed24a1d4dfbe33 Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 3 May 2017 14:27:07 +0200 Subject: [PATCH 08/17] Update tests --- AdjustTests/ADJActivityHandlerTests.m | 36 +++++++++++++----------- AdjustTests/ADJAttributionHandlerTests.m | 22 +++++++++------ AdjustTests/ADJPackageHandlerTests.m | 8 ++++-- AdjustTests/ADJSdkClickHandlerMock.m | 6 ++-- AdjustTests/ADJSdkClickHandlerTests.m | 30 +++++++++++++------- 5 files changed, 64 insertions(+), 38 deletions(-) diff --git a/AdjustTests/ADJActivityHandlerTests.m b/AdjustTests/ADJActivityHandlerTests.m index 47126c069..9839ec667 100644 --- a/AdjustTests/ADJActivityHandlerTests.m +++ b/AdjustTests/ADJActivityHandlerTests.m @@ -425,14 +425,16 @@ - (void)testChecks // activity handler created with a nil config id nilConfigActivityHandler = [ADJActivityHandler handlerWithConfig:nil - sessionParametersActionsArray:nil]; + sessionParametersActionsArray:nil + deviceToken:nil]; aError(@"AdjustConfig missing"); aNil(nilConfigActivityHandler); // activity handler created with an invalid config id invalidConfigActivityHandler = [ADJActivityHandler handlerWithConfig:nilAppTokenConfig - sessionParametersActionsArray:nil]; + sessionParametersActionsArray:nil + deviceToken:nil]; aError(@"AdjustConfig not initialized correctly"); aNil(invalidConfigActivityHandler); @@ -1169,13 +1171,13 @@ - (void)testIadDetails NSError * errorCode0 = [[NSError alloc] initWithDomain:@"adjust" code:0 userInfo:nil]; NSError * errorCode1 = [[NSError alloc] initWithDomain:@"adjust" code:1 userInfo:nil]; - [activityHandler setIadDetails:nil error:errorCode0 retriesLeft:-1]; + [activityHandler setAttributionDetails:nil error:errorCode0 retriesLeft:-1]; [NSThread sleepForTimeInterval:1]; aWarn(@"Unable to read iAd details"); aWarn(@"Limit number of retry for iAd v3 surpassed"); - [activityHandler setIadDetails:nil error:errorCode0 retriesLeft:0]; + [activityHandler setAttributionDetails:nil error:errorCode0 retriesLeft:0]; [NSThread sleepForTimeInterval:4]; aWarn(@"Unable to read iAd details"); @@ -1184,7 +1186,7 @@ - (void)testIadDetails aDebug(@"iAd with 0 tries to read v3"); aWarn(@"Reached limit number of retry for iAd v3. Trying iAd v2"); - [activityHandler setIadDetails:nil error:errorCode0 retriesLeft:1]; + [activityHandler setAttributionDetails:nil error:errorCode0 retriesLeft:1]; [NSThread sleepForTimeInterval:4]; aWarn(@"Unable to read iAd details"); @@ -1192,13 +1194,13 @@ - (void)testIadDetails aDebug(@"iAd with 1 tries to read v3"); anWarn(@"Reached limit number of retry for iAd v3. Trying iAd v2"); - [activityHandler setIadDetails:nil error:errorCode1 retriesLeft:1]; + [activityHandler setAttributionDetails:nil error:errorCode1 retriesLeft:1]; [NSThread sleepForTimeInterval:4]; aWarn(@"Unable to read iAd details"); anDebug(@"iAd with 1 tries to read v3"); - [activityHandler setIadDetails:nil error:nil retriesLeft:1]; + [activityHandler setAttributionDetails:nil error:nil retriesLeft:1]; [NSThread sleepForTimeInterval:4]; anWarn(@"Unable to read iAd details"); @@ -1214,7 +1216,7 @@ - (void)testIadDetails @"decimal" : [NSNumber numberWithDouble:0.1], @"string" : @"value"} }; - [activityHandler setIadDetails:attributionDetails error:nil retriesLeft:1]; + [activityHandler setAttributionDetails:attributionDetails error:nil retriesLeft:1]; [NSThread sleepForTimeInterval:2]; aTest(@"SdkClickHandler sendSdkClick"); @@ -1463,7 +1465,7 @@ - (void)testUpdateAttribution id activityHandler = [self startAndCheckFirstSession:config]; // check if Attribution is not created with nil - ADJAttribution * nilAttribution = [[ADJAttribution alloc] initWithJsonDict:nil]; + ADJAttribution * nilAttribution = [[ADJAttribution alloc] initWithJsonDict:nil adid:nil]; aNil(nilAttribution); @@ -1472,13 +1474,13 @@ - (void)testUpdateAttribution // create an empty attribution NSMutableDictionary * emptyJsonDictionary = [[NSMutableDictionary alloc] init]; - ADJAttribution * emptyAttribution = [[ADJAttribution alloc] initWithJsonDict:emptyJsonDictionary]; + ADJAttribution * emptyAttribution = [[ADJAttribution alloc] initWithJsonDict:emptyJsonDictionary adid:nil]; // check that updates attribution 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]; + emptyAttribution = [[ADJAttribution alloc] initWithJsonDict:emptyJsonDictionary adid:nil]; // test first session package ADJActivityPackage * firstSessionPackage = self.packageHandlerMock.packageQueue[0]; @@ -1541,7 +1543,8 @@ - (void)testUpdateAttribution anNil(firstAttributionDictionary); - ADJAttribution * firstAttribution = [[ADJAttribution alloc] initWithJsonDict:firstAttributionDictionary]; + ADJAttribution * firstAttribution = [[ADJAttribution alloc] initWithJsonDict:firstAttributionDictionary + adid:nil]; //check that it updates sessionResponseDataWithAttribution.attribution = firstAttribution; @@ -1611,7 +1614,8 @@ - (void)testUpdateAttribution anNil(secondAttributionDictionary); - ADJAttribution * secondAttribution = [[ADJAttribution alloc] initWithJsonDict:secondAttributionDictionary]; + ADJAttribution * secondAttribution = [[ADJAttribution alloc] initWithJsonDict:secondAttributionDictionary + adid:nil]; //check that it updates attributionResponseDataWithAttribution.attribution = secondAttribution; @@ -1875,7 +1879,7 @@ - (void)testGetAttribution anNil(attributionDictionary); - ADJAttribution * attribution = [[ADJAttribution alloc] initWithJsonDict:attributionDictionary]; + ADJAttribution * attribution = [[ADJAttribution alloc] initWithJsonDict:attributionDictionary adid:nil]; // update the attribution [activityHandler updateAttributionI:activityHandler attribution:attribution]; @@ -3074,7 +3078,7 @@ - (void)stopActivity:(id)activityHandler { - (id)getActivityHandler:(ADJActivityHandlerConstructorState *)cState { id activityHandler = [ADJActivityHandler handlerWithConfig:cState.config - sessionParametersActionsArray:cState.sessionParametersActionsArray]; + sessionParametersActionsArray:cState.sessionParametersActionsArray deviceToken:nil]; if (activityHandler != nil) { aTest(@"ADJLogger lockLogLevel"); @@ -3441,7 +3445,7 @@ - (void)checkFinishTasks:(NSObject *)delegateTest // test sdk_click response data ADJActivityPackage * sdkClickPackage = self.sdkClickHandlerMock.packageQueue[0]; - ADJClickResponseData * sdkClickResponseData = [ADJResponseData buildResponseData:sdkClickPackage]; + ADJSdkClickResponseData * sdkClickResponseData = [ADJResponseData buildResponseData:sdkClickPackage]; [activityHandler finishedTracking:sdkClickResponseData]; [NSThread sleepForTimeInterval:1.0]; diff --git a/AdjustTests/ADJAttributionHandlerTests.m b/AdjustTests/ADJAttributionHandlerTests.m index 1ad69aaa5..145ed72de 100644 --- a/AdjustTests/ADJAttributionHandlerTests.m +++ b/AdjustTests/ADJAttributionHandlerTests.m @@ -55,7 +55,8 @@ - (void)reset { ADJConfig * config = [ADJConfig configWithAppToken:@"qwerty123456" environment:ADJEnvironmentSandbox]; self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config - sessionParametersActionsArray:nil]; + sessionParametersActionsArray:nil + deviceToken:nil]; [self savePackages:config]; [NSURLConnection reset]; } @@ -75,7 +76,9 @@ - (void)savePackages:(ADJConfig *)config { [ADJTestsUtil deleteFile:@"AdjustIoActivityState" logger:self.loggerMock]; [ADJTestsUtil deleteFile:@"AdjustIoAttribution" logger:self.loggerMock]; - id activityHandler = [ADJActivityHandler handlerWithConfig:config sessionParametersActionsArray:nil]; + id activityHandler = [ADJActivityHandler handlerWithConfig:config + sessionParametersActionsArray:nil + deviceToken:nil]; [activityHandler applicationDidBecomeActive]; [NSThread sleepForTimeInterval:5.0]; @@ -97,7 +100,10 @@ - (void)testGetAttribution // reseting to make the test order independent [self reset]; - id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES hasAttributionChangedDelegate:YES]; + id attributionHandler = [ADJAttributionHandler + handlerWithActivityHandler:self.activityHandlerMock + withAttributionPackage:self.attributionPackage + startsSending:YES]; // test null response without error [self checkGetAttributionResponse:attributionHandler responseType:ADJSessionResponseTypeNil]; @@ -158,7 +164,7 @@ - (void)testCheckSessionResponse // reseting to make the test order independent [self reset]; - id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES hasAttributionChangedDelegate:YES]; + id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES]; NSMutableDictionary * attributionDictionary = [[NSMutableDictionary alloc] init]; [attributionDictionary setObject:@"ttValue" forKey:@"tracker_token"]; @@ -196,7 +202,7 @@ - (void)testAskIn // reseting to make the test order independent [self reset]; - id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES hasAttributionChangedDelegate:YES]; + id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES]; NSMutableDictionary * askIn4sDictionary = [[NSMutableDictionary alloc] init]; [askIn4sDictionary setObject:@"4000" forKey:@"ask_in"]; @@ -260,7 +266,7 @@ - (void)testPause // reseting to make the test order independent [self reset]; - id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:NO hasAttributionChangedDelegate:YES]; + id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:NO]; [NSURLSession setResponseType:ADJSessionResponseTypeMessage]; @@ -282,7 +288,7 @@ - (void)testWithoutListener // reseting to make the test order independent [self reset]; - id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES hasAttributionChangedDelegate:NO]; + id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES]; [NSURLConnection setResponseType:ADJResponseTypeMessage]; @@ -303,7 +309,7 @@ - (void)testDeeplink { // reseting to make the test order independent [self reset]; - id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES hasAttributionChangedDelegate:YES]; + id attributionHandler = [ADJAttributionHandler handlerWithActivityHandler:self.activityHandlerMock withAttributionPackage:self.attributionPackage startsSending:YES]; NSMutableDictionary * attributionDictionary = [[NSMutableDictionary alloc] init]; [attributionDictionary setObject:@"testDeeplinkAttribution://" forKey:@"deeplink"]; diff --git a/AdjustTests/ADJPackageHandlerTests.m b/AdjustTests/ADJPackageHandlerTests.m index 7ae1811ac..f6d41bcaa 100644 --- a/AdjustTests/ADJPackageHandlerTests.m +++ b/AdjustTests/ADJPackageHandlerTests.m @@ -60,7 +60,9 @@ - (void)reset { [ADJAdjustFactory setRequestHandler:self.requestHandlerMock]; ADJConfig * config = [ADJConfig configWithAppToken:@"123456789012" environment:ADJEnvironmentSandbox]; - self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config sessionParametersActionsArray:nil]; + self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config + sessionParametersActionsArray:nil + deviceToken:nil]; // delete previously created Package queue file to make a new queue XCTAssert([ADJTestsUtil deleteFile:@"AdjustIoPackageQueue" logger:self.loggerMock], @"%@", self.loggerMock); @@ -467,7 +469,9 @@ - (NSArray *)createDelayPackages { [config setDelayStart:4]; - id activityHandler = [ADJActivityHandler handlerWithConfig:config sessionParametersActionsArray:nil]; + id activityHandler = [ADJActivityHandler handlerWithConfig:config + sessionParametersActionsArray:nil + deviceToken:nil]; [activityHandler addSessionCallbackParameter:@"scpKey" value:@"scpValue"]; [activityHandler addSessionPartnerParameter:@"sppKey" value:@"sppValue"]; diff --git a/AdjustTests/ADJSdkClickHandlerMock.m b/AdjustTests/ADJSdkClickHandlerMock.m index 65422e758..173800362 100644 --- a/AdjustTests/ADJSdkClickHandlerMock.m +++ b/AdjustTests/ADJSdkClickHandlerMock.m @@ -21,13 +21,15 @@ @interface ADJSdkClickHandlerMock() @implementation ADJSdkClickHandlerMock -- (id)initWithStartsSending:(BOOL)startsSending { +- (id)initWithActivityHandler:(id)activityHandler + startsSending:(BOOL)startsSending +{ self = [super init]; if (self == nil) return nil; self.loggerMock = (ADJLoggerMock *) [ADJAdjustFactory logger]; - [self.loggerMock test:[prefix stringByAppendingFormat:@"initWithStartsSending, startsSending: %d", startsSending]]; + [self.loggerMock test:[prefix stringByAppendingFormat:@"initWithActivityHandler, startsSending: %d", startsSending]]; self.packageQueue = [NSMutableArray array]; diff --git a/AdjustTests/ADJSdkClickHandlerTests.m b/AdjustTests/ADJSdkClickHandlerTests.m index f42f88a8d..e5e9e46d7 100644 --- a/AdjustTests/ADJSdkClickHandlerTests.m +++ b/AdjustTests/ADJSdkClickHandlerTests.m @@ -53,7 +53,9 @@ - (void)reset { ADJConfig * config = [ADJConfig configWithAppToken:@"qwerty123456" environment:ADJEnvironmentSandbox]; - self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config sessionParametersActionsArray:nil]; + self.activityHandlerMock = [[ADJActivityHandlerMock alloc] initWithConfig:config + sessionParametersActionsArray:nil + deviceToken:nil]; self.sdkClickPackage = [self getClickPackage]; [NSURLSession reset]; @@ -70,7 +72,7 @@ - (void) testPaused { [ADJAdjustFactory setSdkClickHandlerBackoffStrategy:[ADJBackoffStrategy backoffStrategyWithType:ADJNoWait]]; - id sdkClickHandler = [ADJSdkClickHandler handlerWithStartsSending:NO]; + id sdkClickHandler = [ADJSdkClickHandler handlerWithActivityHandler:self.activityHandlerMock startsSending:NO]; [NSURLSession setResponseType:ADJSessionResponseTypeConnError]; @@ -113,7 +115,8 @@ - (void)testNullResponse { [ADJAdjustFactory setSdkClickHandlerBackoffStrategy:[ADJBackoffStrategy backoffStrategyWithType:ADJNoRetry]]; - id sdkClickHandler = [ADJSdkClickHandler handlerWithStartsSending:YES]; + id sdkClickHandler = [ADJSdkClickHandler handlerWithActivityHandler:self.activityHandlerMock + startsSending:YES]; [NSURLSession setResponseType:ADJSessionResponseTypeNil]; @@ -143,7 +146,8 @@ - (void)testClientException { [ADJAdjustFactory setSdkClickHandlerBackoffStrategy:[ADJBackoffStrategy backoffStrategyWithType:ADJNoRetry]]; - id sdkClickHandler = [ADJSdkClickHandler handlerWithStartsSending:YES]; + id sdkClickHandler = [ADJSdkClickHandler handlerWithActivityHandler:self.activityHandlerMock + startsSending:YES]; [NSURLSession setResponseType:ADJSessionResponseTypeConnError]; @@ -171,7 +175,8 @@ - (void)testServerError { [ADJAdjustFactory setSdkClickHandlerBackoffStrategy:[ADJBackoffStrategy backoffStrategyWithType:ADJNoWait]]; - id sdkClickHandler = [ADJSdkClickHandler handlerWithStartsSending:YES]; + id sdkClickHandler = [ADJSdkClickHandler handlerWithActivityHandler:self.activityHandlerMock + startsSending:YES]; [NSURLSession setResponseType:ADJSessionResponseTypeServerError]; @@ -191,7 +196,8 @@ - (void)testWrongJson { [ADJAdjustFactory setSdkClickHandlerBackoffStrategy:[ADJBackoffStrategy backoffStrategyWithType:ADJNoRetry]]; - id sdkClickHandler = [ADJSdkClickHandler handlerWithStartsSending:YES]; + id sdkClickHandler = [ADJSdkClickHandler handlerWithActivityHandler:self.activityHandlerMock + startsSending:YES]; [NSURLSession setResponseType:ADJSessionResponseTypeWrongJson]; @@ -211,7 +217,8 @@ - (void)testEmptyJson { [ADJAdjustFactory setSdkClickHandlerBackoffStrategy:[ADJBackoffStrategy backoffStrategyWithType:ADJNoRetry]]; - id sdkClickHandler = [ADJSdkClickHandler handlerWithStartsSending:YES]; + id sdkClickHandler = [ADJSdkClickHandler handlerWithActivityHandler:self.activityHandlerMock + startsSending:YES]; [NSURLSession setResponseType:ADJSessionResponseTypeEmptyJson]; @@ -231,7 +238,8 @@ - (void)testMessage { [ADJAdjustFactory setSdkClickHandlerBackoffStrategy:[ADJBackoffStrategy backoffStrategyWithType:ADJNoRetry]]; - id sdkClickHandler = [ADJSdkClickHandler handlerWithStartsSending:YES]; + id sdkClickHandler = [ADJSdkClickHandler handlerWithActivityHandler:self.activityHandlerMock + startsSending:YES]; [NSURLSession setResponseType:ADJSessionResponseTypeMessage]; @@ -262,7 +270,7 @@ - (void)checkSendPackage:(id)sdkClickHandler //assertUtil.test("MockHttpsURLConnection setRequestProperty, field Client-SDK, newValue Test-Second-Click"); // and that it will try to send it again - NSString * errorLog = [NSString stringWithFormat:@"Retrying sdk_click package for the %ld time", retries]; + NSString * errorLog = [NSString stringWithFormat:@"Retrying sdk_click package for the %ld time", (long)retries]; aError(errorLog); // second package added again on the end of the queue @@ -292,7 +300,9 @@ - (ADJActivityPackage *) getClickPackage { ADJConfig * config = [ADJConfig configWithAppToken:@"qwerty123456" environment:@"sandbox"]; // start activity handler with config - id activityHandler = [ADJActivityHandler handlerWithConfig:config sessionParametersActionsArray:nil]; + id activityHandler = [ADJActivityHandler handlerWithConfig:config + sessionParametersActionsArray:nil + deviceToken:nil]; [activityHandler applicationDidBecomeActive]; [activityHandler appWillOpenUrl:[NSURL URLWithString:@"AdjustTests://"]]; [NSThread sleepForTimeInterval:2.0]; From f58f28539f9d4c636894a2df637dba5495516d42 Mon Sep 17 00:00:00 2001 From: uerceg Date: Wed, 3 May 2017 15:33:42 +0200 Subject: [PATCH 09/17] Project file update --- Adjust.xcodeproj/project.pbxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Adjust.xcodeproj/project.pbxproj b/Adjust.xcodeproj/project.pbxproj index 0b484443d..2aaae33f2 100644 --- a/Adjust.xcodeproj/project.pbxproj +++ b/Adjust.xcodeproj/project.pbxproj @@ -2304,6 +2304,7 @@ 9D7431FB1EB9F9B700969F14 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9DFA37B21C0F219400782607 /* Build configuration list for PBXNativeTarget "AdjustSdk" */ = { isa = XCConfigurationList; From 48d5defe6dca3da1d653e99f360fa2f55e365734 Mon Sep 17 00:00:00 2001 From: uerceg Date: Wed, 3 May 2017 16:23:36 +0200 Subject: [PATCH 10/17] Adding empty implementation of ADJSdkClickResponseData --- Adjust/ADJResponseData.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Adjust/ADJResponseData.m b/Adjust/ADJResponseData.m index e8433b1ef..2363daca3 100644 --- a/Adjust/ADJResponseData.m +++ b/Adjust/ADJResponseData.m @@ -127,6 +127,10 @@ - (id)copyWithZone:(NSZone *)zone { @end +@implementation ADJSdkClickResponseData + +@end + @implementation ADJEventResponseData + (ADJEventResponseData *)responseDataWithActivityPackage:(ADJActivityPackage *)activityPackage { @@ -211,3 +215,4 @@ - (NSString *)description { } @end + From dbac8fbe54da5abab075f2d3a7c27b885770bfaa Mon Sep 17 00:00:00 2001 From: uerceg Date: Wed, 3 May 2017 16:24:04 +0200 Subject: [PATCH 11/17] Increasing deployment target for tests --- Adjust.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Adjust.xcodeproj/project.pbxproj b/Adjust.xcodeproj/project.pbxproj index 2aaae33f2..26b6f2437 100644 --- a/Adjust.xcodeproj/project.pbxproj +++ b/Adjust.xcodeproj/project.pbxproj @@ -2044,6 +2044,7 @@ "$(inherited)", ); INFOPLIST_FILE = "AdjustTests/AdjustTests-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "adjust.${PRODUCT_NAME:rfc1034identifier}"; @@ -2063,6 +2064,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AdjustTests/Adjust-Prefix.pch"; INFOPLIST_FILE = "AdjustTests/AdjustTests-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "adjust.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; From 96aba2bf728e291421eb2c2fe4857fe954b19161 Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 3 May 2017 16:42:46 +0200 Subject: [PATCH 12/17] Make allowSuppress overwrite default log level --- Adjust/ADJConfig.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Adjust/ADJConfig.m b/Adjust/ADJConfig.m index fd7a1e43a..2f0741533 100644 --- a/Adjust/ADJConfig.m +++ b/Adjust/ADJConfig.m @@ -49,7 +49,11 @@ - (id)initWithAppToken:(NSString *)appToken self.logger = ADJAdjustFactory.logger; // default values - [self setLogLevel:ADJLogLevelInfo environment:environment]; + if (allowSuppressLogLevel && [ADJEnvironmentProduction isEqualToString:environment]) { + [self setLogLevel:ADJLogLevelSuppress environment:environment]; + } else { + [self setLogLevel:ADJLogLevelInfo environment:environment]; + } if (![self checkEnvironment:environment]) return self; if (![self checkAppToken:appToken]) return self; @@ -67,9 +71,10 @@ - (void)setLogLevel:(ADJLogLevel)logLevel { } - (void)setLogLevel:(ADJLogLevel)logLevel - environment:(NSString *)environment{ + environment:(NSString *)environment +{ [self.logger setLogLevel:self.logLevel - isProductionEnvironment:[environment isEqualToString:ADJEnvironmentProduction]]; + isProductionEnvironment:[ADJEnvironmentProduction isEqualToString:environment]]; } - (void)setDelegate:(NSObject *)delegate { From 63dce8966ee7d3e6ea299488dbf7fd53f6531503 Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 3 May 2017 17:03:20 +0200 Subject: [PATCH 13/17] Fix mock interfaces --- AdjustTests/ADJAttributionHandlerMock.m | 7 ++++--- AdjustTests/ADJLoggerMock.m | 10 ++++++++-- AdjustTests/ADJPackageFields.h | 1 - 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/AdjustTests/ADJAttributionHandlerMock.m b/AdjustTests/ADJAttributionHandlerMock.m index fb7fddb3a..7bbfaae4d 100644 --- a/AdjustTests/ADJAttributionHandlerMock.m +++ b/AdjustTests/ADJAttributionHandlerMock.m @@ -16,7 +16,6 @@ @interface ADJAttributionHandlerMock() @property (nonatomic, strong) ADJLoggerMock *loggerMock; @property (nonatomic, assign) BOOL startsSending; -@property (nonatomic, assign) BOOL hasDelegate; @end @@ -26,13 +25,11 @@ @implementation ADJAttributionHandlerMock - (id)initWithActivityHandler:(id) activityHandler withAttributionPackage:(ADJActivityPackage *) attributionPackage startsSending:(BOOL)startsSending -hasAttributionChangedDelegate:(BOOL)hasDelegate { self = [super init]; if (self == nil) return nil; self.startsSending = startsSending; - self.hasDelegate = hasDelegate; self.loggerMock = (ADJLoggerMock *) [ADJAdjustFactory logger]; self.attributionPackage = attributionPackage; @@ -45,6 +42,10 @@ - (void)checkSessionResponse:(ADJSessionResponseData *)sessionResponseData { [self.loggerMock test:[prefix stringByAppendingFormat:@"checkSessionResponse, responseData: %@", sessionResponseData]]; } +- (void)checkSdkClickResponse:(ADJSdkClickResponseData *)sdkClickResponseData { + [self.loggerMock test:[prefix stringByAppendingFormat:@"checkSdkClickResponse, responseData: %@", sdkClickResponseData]]; +} + - (void)checkAttributionResponse:(ADJAttributionResponseData *)attributionResponseData { [self.loggerMock test:[prefix stringByAppendingFormat:@"checkAttributionResponse, responseData: %@", attributionResponseData]]; } diff --git a/AdjustTests/ADJLoggerMock.m b/AdjustTests/ADJLoggerMock.m index 8d399192c..fe627121b 100644 --- a/AdjustTests/ADJLoggerMock.m +++ b/AdjustTests/ADJLoggerMock.m @@ -68,8 +68,9 @@ - (NSString *)containsMessage:(NSInteger)logLevel beginsWith:(NSString *)beginsW return nil; } -- (void)setLogLevel:(ADJLogLevel)logLevel { - [self test:@"ADJLogger setLogLevel: %d", logLevel]; +- (void)setLogLevel:(ADJLogLevel)logLevel isProductionEnvironment:(BOOL)isProductionEnvironment +{ + [self test:@"ADJLogger setLogLevel: %d, isProductionEnvironment: %d", logLevel, isProductionEnvironment]; } - (void)lockLogLevel { @@ -106,6 +107,11 @@ - (void)warn: (NSString *)format, ... { [self logLevel:ADJLogLevelWarn logPrefix:@"w" format:format parameters:parameters]; } +- (void)warnInProduction: (NSString *)format, ... { + va_list parameters; va_start(parameters, format); + [self logLevel:ADJLogLevelWarn logPrefix:@"w" format:format parameters:parameters]; +} + - (void)error: (NSString *)format, ... { va_list parameters; va_start(parameters, format); [self logLevel:ADJLogLevelError logPrefix:@"e" format:format parameters:parameters]; diff --git a/AdjustTests/ADJPackageFields.h b/AdjustTests/ADJPackageFields.h index 93752fe1e..e04eba607 100644 --- a/AdjustTests/ADJPackageFields.h +++ b/AdjustTests/ADJPackageFields.h @@ -23,7 +23,6 @@ @property (nonatomic, copy) NSString *appToken; @property (nonatomic, copy) NSString *environment; @property (nonatomic, copy) NSString *sdkPrefix; -@property (nonatomic, assign) BOOL hasResponseDelegate; @property (nonatomic, copy) NSString *defaultTracker; @property (nonatomic, assign) BOOL eventBufferingEnabled; // ADJDeviceInfo From d9cf73c8341904cf4addb68eb444b96e61ca309f Mon Sep 17 00:00:00 2001 From: nonelse Date: Wed, 3 May 2017 17:06:07 +0200 Subject: [PATCH 14/17] New version v4.11.4 --- Adjust.podspec | 4 ++-- Adjust/ADJUtil.m | 2 +- Adjust/Adjust.h | 2 +- AdjustTests/ADJPackageFields.m | 2 +- README.md | 4 ++-- VERSION | 2 +- doc/english/migrate.md | 2 +- doc/japanese/migrate_ja.md | 2 +- doc/migrate.md | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Adjust.podspec b/Adjust.podspec index df5eaa01d..d950642e4 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "Adjust" - s.version = "4.11.3" + s.version = "4.11.4" 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.11.3" } + s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.11.4" } 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 9fe736388..a4eda1d90 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -31,7 +31,7 @@ static NSString *userAgent = nil; -static NSString * const kClientSdk = @"ios4.11.3"; +static NSString * const kClientSdk = @"ios4.11.4"; 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 974fb69a9..3ca9b6261 100644 --- a/Adjust/Adjust.h +++ b/Adjust/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust // -// V4.11.3 +// V4.11.4 // Created by Christian Wellenbrock on 2012-07-23. // Copyright (c) 2012-2014 adjust GmbH. All rights reserved. // diff --git a/AdjustTests/ADJPackageFields.m b/AdjustTests/ADJPackageFields.m index 7dd1c04f3..845dd66be 100644 --- a/AdjustTests/ADJPackageFields.m +++ b/AdjustTests/ADJPackageFields.m @@ -16,7 +16,7 @@ - (id) init { // default values self.appToken = @"qwerty123456"; - self.clientSdk = @"ios4.11.3"; + self.clientSdk = @"ios4.11.4"; self.suffix = @""; self.environment = @"sandbox"; diff --git a/README.md b/README.md index 419f65da4..348fe5edf 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ In the dialog `Choose options for adding these files` make sure to check the che 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.11.3' +pod 'Adjust', '~> 4.11.4' ``` or: ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.11.3' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.11.4' ``` -- diff --git a/VERSION b/VERSION index e9fdaa8c8..0ce5c18e9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.11.3 +4.11.4 diff --git a/doc/english/migrate.md b/doc/english/migrate.md index 7b829cd29..45153b834 100644 --- a/doc/english/migrate.md +++ b/doc/english/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.11.3 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.11.4 from v3.4.0 ### Initial setup diff --git a/doc/japanese/migrate_ja.md b/doc/japanese/migrate_ja.md index b70a3c28a..6f33cb540 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.11.3への移行 +## iOS用adjust SDKのv3.4.0からv.4.11.4への移行 ### 初期設定 diff --git a/doc/migrate.md b/doc/migrate.md index 7b829cd29..45153b834 100644 --- a/doc/migrate.md +++ b/doc/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.11.3 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.11.4 from v3.4.0 ### Initial setup From 5017a4b80fef527b2e09cc4aee0271f14e1c41f3 Mon Sep 17 00:00:00 2001 From: nonelse Date: Thu, 4 May 2017 11:09:04 +0200 Subject: [PATCH 15/17] Use injected log level --- Adjust/ADJConfig.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adjust/ADJConfig.m b/Adjust/ADJConfig.m index 2f0741533..78f883c06 100644 --- a/Adjust/ADJConfig.m +++ b/Adjust/ADJConfig.m @@ -73,7 +73,7 @@ - (void)setLogLevel:(ADJLogLevel)logLevel { - (void)setLogLevel:(ADJLogLevel)logLevel environment:(NSString *)environment { - [self.logger setLogLevel:self.logLevel + [self.logger setLogLevel:logLevel isProductionEnvironment:[ADJEnvironmentProduction isEqualToString:environment]]; } From 607aec67e2f93b99e73222dfbd9457510411fc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uglje=C5=A1a=20Erceg?= Date: Fri, 5 May 2017 14:59:54 +0200 Subject: [PATCH 16/17] Update CHANGELOG.md --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32d1e27fa..e04ceda7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +### Version 4.11.4 (5th May 2017) +#### Added +- Added check if `sdk_click` package response contains attribution information. +- Added sending of attributable parameters with every `sdk_click` package. + +#### Changed +- Replaced `assert` level logs with `warn` level. + +--- + ### Version 4.11.3 (23rd March 2017) #### Changed - Performing connection validity checks only on main package queue. From a6fa9aa139da8e5a012206ae876159d8dc7f7cb2 Mon Sep 17 00:00:00 2001 From: uerceg Date: Fri, 5 May 2017 15:12:53 +0200 Subject: [PATCH 17/17] Comments cleanup due to pod Swift 3.0 validation warnings --- plugin/Sociomantic/ADJSociomantic.h | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/plugin/Sociomantic/ADJSociomantic.h b/plugin/Sociomantic/ADJSociomantic.h index 41a9eeddd..97e0b3f52 100644 --- a/plugin/Sociomantic/ADJSociomantic.h +++ b/plugin/Sociomantic/ADJSociomantic.h @@ -56,9 +56,8 @@ extern NSString * __nonnull const SCMCustomerTargeting; * Methods uses the given string, stores it into a singleton, it'll be injected into every * further sociomantic event. * - * @param event `NSString` + * @param adpanId `NSString` * - * @return `void` */ + (void)injectPartnerIdIntoSociomanticEvents:(nullable NSString *)adpanId; @@ -68,7 +67,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param event `ADJEvent` * @param data `NSDictionary` * - * @return `void` */ + (void)injectCustomerDataIntoEvent:(nullable ADJEvent *)event withData:(nullable NSDictionary *)data; @@ -79,7 +77,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * * @param event `ADJEvent` * - * @return `void` */ + (void)addPartnerParameter:(nullable ADJEvent *)event; @@ -90,7 +87,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * * @param event `ADJEvent` * - * @return `void` */ + (void)addPartnerParameter:(nullable ADJEvent *)event parameter:(nullable NSString *)parameterName @@ -101,7 +97,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * * @param event `ADJEvent` * - * @return `void` */ + (void)injectHomePageIntoEvent:(nullable ADJEvent *)event; @@ -114,7 +109,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param event `ADJEvent` * @param categories `NSArray` * - * @return `void` */ + (void)injectViewListingIntoEvent:(nullable ADJEvent *)event withCategories:(nullable NSArray *)categories; @@ -128,7 +122,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param categories `NSArray` * @param date `NSString` * - * @return `void` */ + (void)injectViewListingIntoEvent:(nullable ADJEvent *)event withCategories:(nullable NSArray *)categories @@ -140,7 +133,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param event `ADJEvent` * @param productId `NSString` * - * @return `void` */ + (void)injectViewProductIntoEvent:(nullable ADJEvent *)event productId:(nullable NSString *)productId; @@ -156,7 +148,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param productId `NSString` * @param parameters `NSDictionary` * - * @return `void` */ + (void)injectViewProductIntoEvent:(nullable ADJEvent *)event productId:(nullable NSString *)productId @@ -171,7 +162,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param event `ADJEvent` * @param products `NSArray` * - * @return `void` */ + (void)injectCartIntoEvent:(nullable ADJEvent *)event cart:(nullable NSArray *)products; @@ -186,7 +176,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param transactionID `NSString` * @param products `NSArray` * - * @return `void` */ + (void)injectConfirmedTransactionIntoEvent:(nullable ADJEvent *)event transactionId:(nullable NSString *)transactionID @@ -204,7 +193,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param products `NSArray` * @param parameters `NSDictionary` * - * @return `void` */ + (void)injectConfirmedTransactionIntoEvent:(nullable ADJEvent *)event transactionId:(nullable NSString *)transactionID @@ -222,7 +210,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param transactionID `NSString` * @param products `NSArray` * - * @return `void` */ + (void)injectTransactionIntoEvent:(nullable ADJEvent *)event transactionId:(nullable NSString *)transactionID @@ -239,7 +226,6 @@ extern NSString * __nonnull const SCMCustomerTargeting; * @param products `NSArray` * @param parameters `NSDictionary` * - * @return `void` */ + (void)injectTransactionIntoEvent:(nullable ADJEvent *)event transactionId:(nullable NSString *)transactionID @@ -250,9 +236,8 @@ extern NSString * __nonnull const SCMCustomerTargeting; * Method injects a lead page into an Adjust event. * * @param event `ADJEvent` - * @param leadID `NSString` + * @param transactionID `NSString` * - * @return `void` */ + (void)injectLeadIntoEvent:(nullable ADJEvent *)event leadID:(nullable NSString *)transactionID; @@ -262,9 +247,8 @@ extern NSString * __nonnull const SCMCustomerTargeting; * It can be confirmed or not. * * @param event `ADJEvent` - * @param leadID `NSString` + * @param transactionID `NSString` * - * @return `void` */ + (void)injectLeadIntoEvent:(nullable ADJEvent *)event leadID:(nullable NSString *)transactionID