diff --git a/.gitignore b/.gitignore index a8136797..79fc7672 100755 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,9 @@ build/ .jira-url atlassian-ide-plugin.xml +# node 5 +package-lock.json + # exceptions !*adjust-android.jar !android/libs/adjust*.jar diff --git a/CHANGELOG.md b/CHANGELOG.md index be7859ed..f15a9b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +### Version 4.11.6 (28th September 2017) +#### Added +- **[iOS]** Improved iOS 11 support. + +#### Changed +- **[iOS]** Removed iOS connection validity checks. +- **[iOS]** Updated native iOS SDK to version **4.11.5**. + +#### Native SDKs +- **[iOS]** [iOS@v4.11.5][ios_sdk_v4.11.5] +- **[AND]** [Android@v4.11.4][android_sdk_v4.11.4] + +--- + ### Version 4.11.5 (22nd August 2017) #### Added - **[iOS]** Added `Podspec` file for Cocoapods support (thanks to @pietropizzi, @tecbot and @dan-manges). @@ -118,6 +132,7 @@ [ios_sdk_v4.11.0]: https://github.com/adjust/ios_sdk/tree/v4.11.0 [ios_sdk_v4.11.3]: https://github.com/adjust/ios_sdk/tree/v4.11.3 [ios_sdk_v4.11.4]: https://github.com/adjust/ios_sdk/tree/v4.11.4 +[ios_sdk_v4.11.5]: https://github.com/adjust/ios_sdk/tree/v4.11.5 [android_sdk_v4.10.4]: https://github.com/adjust/android_sdk/tree/v4.10.4 [android_sdk_v4.11.0]: https://github.com/adjust/android_sdk/tree/v4.11.0 diff --git a/VERSION b/VERSION index ad2c17ed..ebd9d93f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.11.5 +4.11.6 diff --git a/example/ios/Example.xcodeproj/project.pbxproj b/example/ios/Example.xcodeproj/project.pbxproj index 4c07c7de..2f920812 100644 --- a/example/ios/Example.xcodeproj/project.pbxproj +++ b/example/ios/Example.xcodeproj/project.pbxproj @@ -511,6 +511,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */, 00E356EF1AD99517003FC87E /* exampleTests */, 83CBBA001A601CBA00E9B192 /* Products */, + 9DDA88861F7A61A200C66612 /* Recovered References */, ); indentWidth = 2; sourceTree = ""; @@ -527,6 +528,14 @@ name = Products; sourceTree = ""; }; + 9DDA88861F7A61A200C66612 /* Recovered References */ = { + isa = PBXGroup; + children = ( + BFC922DBF74D4E2EB5C22FAE /* libAdjustSdk.a */, + ); + name = "Recovered References"; + sourceTree = ""; + }; 9DEF02161F33221100B0FA1B /* Products */ = { isa = PBXGroup; children = ( diff --git a/ext/iOS/sdk b/ext/iOS/sdk index 686d8c77..7a6f3159 160000 --- a/ext/iOS/sdk +++ b/ext/iOS/sdk @@ -1 +1 @@ -Subproject commit 686d8c771d3778e8b0cf2558e1299af945df2dda +Subproject commit 7a6f3159409d8251da89e34ea304c8f7c06aa268 diff --git a/index.js b/index.js index be4d6621..cce24f83 100755 --- a/index.js +++ b/index.js @@ -111,7 +111,7 @@ var AdjustConfig = function(appToken, environment) { this.appToken = appToken; this.environment = environment; - this.sdkPrefix = "react_native4.11.5"; + this.sdkPrefix = "react_native4.11.6"; this.logLevel = null; this.eventBufferingEnabled = null; diff --git a/ios/Adjust/ADJActivityState.m b/ios/Adjust/ADJActivityState.m index 150f3fc9..3dbd054b 100644 --- a/ios/Adjust/ADJActivityState.m +++ b/ios/Adjust/ADJActivityState.m @@ -82,35 +82,40 @@ - (BOOL)findTransactionId:(NSString *)transactionId { #pragma mark - Private & helper methods - (void)assignUuid:(NSString *)uuid { - // First check if there's any UUID written in keychain. - // If yes, use keychain value and flag it. - // If not, use given UUID and store it to keychain. - // If successfully written, flag it. - // If writing failed, don't flat it. - // Small addition as of iOS 10.3: - // Keychain needs to be written in different way in order to persist value between (un)installs. - - // Check if device supports new writing method. - // kSecAttrAccessGroupToken available since iOS 10.0. - if (NULL == &kSecAttrAccessGroupToken) { - // This device's iOS version doesn't support new writing method. - [self assignUuidOldMethod:uuid]; - return; - } else { - // This device's iOS version supports new writing method. - [self assignUuidNewMethod:uuid]; - return; + // 1. Check if UUID is written to keychain in v2 way. + // 1.1 If yes, take stored UUID and send it to v1 check. + // 1.2 If not, take given UUID and send it to v1 check. + // v1 check: + // 2.1 If given UUID is found in v1 way, use it. + // 2.2 If given UUID is not found in v1 way, write it in v1 way and use it. + + // First check if we have the key written with app's unique key name. + NSString *uniqueKey = [self generateUniqueKey]; + NSString *persistedUuidUnique = [ADJKeychain valueForKeychainKeyV2:uniqueKey service:@"deviceInfo"]; + + if (persistedUuidUnique != nil) { + // Check if value has UUID format. + if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuidUnique]) { + [[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain v2 way"]; + + // If we read the key with v2 way, write it back in v1 way since in iOS 11, that's the only one that it works. + [self assignUuidOldMethod:persistedUuidUnique]; + } } + + // At this point, UUID was not persisted in v2 way or if persisted, didn't have proper UUID format. + // Try the v1 way with given UUID. + [self assignUuidOldMethod:uuid]; } - (void)assignUuidOldMethod:(NSString *)uuid { - NSString *persistedUuid = [ADJKeychain valueForKeychainKeyOld:@"adjust_persisted_uuid" service:@"deviceInfo"]; + NSString *persistedUuid = [ADJKeychain valueForKeychainKeyV1:@"adjust_persisted_uuid" service:@"deviceInfo"]; // Check if value exists in keychain. if (persistedUuid != nil) { // Check if value has UUID format. if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuid]) { - [[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain old way"]; + [[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain v1 way"]; // Value written in keychain seems to have UUID format. self.uuid = persistedUuid; @@ -120,10 +125,10 @@ - (void)assignUuidOldMethod:(NSString *)uuid { } } - // At this point, UUID was not persisted or if persisted, didn't have proper UUID format. + // At this point, UUID was not persisted in v1 way or if persisted, didn't have proper UUID format. // Since we don't have anything in the keychain, we'll use the passed UUID value. - // Try to save that value to the keychain and flag if successfully written. + // Try to save that value to the keychain in v1 way and flag if successfully written. self.uuid = uuid; self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:@"adjust_persisted_uuid" inService:@"deviceInfo"]; } @@ -144,49 +149,6 @@ - (NSString *)generateUniqueKey { return [joinedKey adjSha1]; } -- (void)assignUuidNewMethod:(NSString *)uuid { - // First check if we have the key written with app's unique key name. - NSString *uniqueKey = [self generateUniqueKey]; - NSString *persistedUuidUnique = [ADJKeychain valueForKeychainKeyNew:uniqueKey service:@"deviceInfo"]; - - if (persistedUuidUnique != nil) { - // Check if value has UUID format. - if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuidUnique]) { - [[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain new way"]; - - // Value written in keychain seems to have UUID format. - self.uuid = persistedUuidUnique; - self.isPersisted = YES; - - return; - } - } - - // At this point, UUID was not persisted with unique key or if persisted, didn't have proper UUID format. - - // Check if it's still saved in the keychain with old writing method. - NSString *persistedUuidOld = [ADJKeychain valueForKeychainKeyOld:@"adjust_persisted_uuid" service:@"deviceInfo"]; - - if (persistedUuidOld != nil) { - // Check if value has UUID format. - if ((bool)[[NSUUID alloc] initWithUUIDString:persistedUuidOld]) { - [[ADJAdjustFactory logger] verbose:@"Value found and read from the keychain old way"]; - - // Since we have the value in the keychain written with old method, we'll use it to save it with new one. - self.uuid = persistedUuidOld; - } else { - // Since found value in the keychain doesn't have propper UUID format, we'll use passed UUID value. - self.uuid = uuid; - } - } else { - // Since we didn't find anything in the keychain with old method as well, we'll use the passed UUID value. - self.uuid = uuid; - } - - // Try to save that value to the keychain and flag if successfully written. - self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:uniqueKey inService:@"deviceInfo"]; -} - - (NSString *)description { return [NSString stringWithFormat:@"ec:%d sc:%d ssc:%d ask:%d sl:%.1f ts:%.1f la:%.1f dt:%@", self.eventCount, self.sessionCount, self.subsessionCount, self.askingAttribution, self.sessionLength, diff --git a/ios/Adjust/ADJConnectionValidator.h b/ios/Adjust/ADJConnectionValidator.h deleted file mode 100644 index 96a938a1..00000000 --- a/ios/Adjust/ADJConnectionValidator.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// ADJConnectionValidator.h -// Adjust -// -// Created by Uglješa Erceg on 14/02/2017. -// Copyright © 2017 adjust GmbH. All rights reserved. -// - -#import - -@interface ADJConnectionValidator : NSObject - -@property (nonatomic, assign) int expectedTce; - -@property (nonatomic, assign) BOOL didValidationHappen; - -@property (nonatomic, assign, readonly) BOOL validationResult; - -@end diff --git a/ios/Adjust/ADJConnectionValidator.m b/ios/Adjust/ADJConnectionValidator.m deleted file mode 100644 index a154e877..00000000 --- a/ios/Adjust/ADJConnectionValidator.m +++ /dev/null @@ -1,88 +0,0 @@ -// -// ADJConnectionValidator.m -// Adjust -// -// Created by Uglješa Erceg on 14/02/2017. -// Copyright © 2017 adjust GmbH. All rights reserved. -// - -#import - -#import "ADJConnectionValidator.h" - -@implementation ADJConnectionValidator - -#pragma mark - Object lifecycle - -- (id)init { - self = [super init]; - - if (self == nil) { - return nil; - } - - return self; -} - -#pragma mark - NSURLSessionDelegate protocol - -- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler { - NSString *trustedThumbprint = @"5fb7ee0633e259dbad0c4c9ae6d38f1a61c7dc25"; - - SecTrustRef serverTrust = challenge.protectionSpace.serverTrust; - SecTrustEvaluate(serverTrust, NULL); - CFIndex count = SecTrustGetCertificateCount(serverTrust); - - SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, count - 1); - CFDataRef certData = SecCertificateCopyData(certificate); - - NSData *data = (__bridge_transfer NSData *)certData; - NSString *thumbprint = [self getThumbprintAsSha1:data]; - - if ([[trustedThumbprint uppercaseString] isEqualToString:[thumbprint uppercaseString]]) { - // tce = 0 - - if (0 == self.expectedTce) { - NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust]; - completionHandler(NSURLSessionAuthChallengeUseCredential, credential); - - _validationResult = YES; - } else { - completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, NULL); - - _validationResult = NO; - } - } else { - // tce = 1++ - - if (0 < self.expectedTce) { - NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust]; - completionHandler(NSURLSessionAuthChallengeUseCredential, credential); - - _validationResult = YES; - } else { - completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, NULL); - - _validationResult = NO; - } - } - - // mark validation as done - self.didValidationHappen = YES; -} - -#pragma mark - Private & helper methods - -- (NSString *)getThumbprintAsSha1:(NSData *)certData { - unsigned char sha1Buffer[CC_SHA1_DIGEST_LENGTH]; - CC_SHA1(certData.bytes, (CC_LONG)certData.length, sha1Buffer); - NSMutableString *fingerprint = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 3]; - - for (int i = 0; i < CC_SHA1_DIGEST_LENGTH; ++i) { - [fingerprint appendFormat:@"%02x",sha1Buffer[i]]; - } - - return [fingerprint stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; -} - -@end diff --git a/ios/Adjust/ADJKeychain.h b/ios/Adjust/ADJKeychain.h index 5510e435..9e85dfea 100644 --- a/ios/Adjust/ADJKeychain.h +++ b/ios/Adjust/ADJKeychain.h @@ -10,8 +10,8 @@ @interface ADJKeychain : NSObject -+ (NSString *)valueForKeychainKeyOld:(NSString *)key service:(NSString *)service; -+ (NSString *)valueForKeychainKeyNew:(NSString *)key service:(NSString *)service; ++ (NSString *)valueForKeychainKeyV1:(NSString *)key service:(NSString *)service; ++ (NSString *)valueForKeychainKeyV2:(NSString *)key service:(NSString *)service; + (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service; @end diff --git a/ios/Adjust/ADJKeychain.m b/ios/Adjust/ADJKeychain.m index 98831772..42639f02 100644 --- a/ios/Adjust/ADJKeychain.m +++ b/ios/Adjust/ADJKeychain.m @@ -9,6 +9,7 @@ #import "ADJLogger.h" #import "ADJKeychain.h" #import "ADJAdjustFactory.h" +#include @implementation ADJKeychain @@ -41,21 +42,29 @@ + (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSS if (key == nil) { return NO; } + return [[ADJKeychain getInstance] setValue:value forKeychainKey:key inService:service]; } -+ (NSString *)valueForKeychainKeyOld:(NSString *)key service:(NSString *)service { ++ (NSString *)valueForKeychainKeyV1:(NSString *)key service:(NSString *)service { if (key == nil) { return nil; } - return [[ADJKeychain getInstance] valueForKeychainKeyOld:key service:service]; + + return [[ADJKeychain getInstance] valueForKeychainKeyV1:key service:service]; } -+ (NSString *)valueForKeychainKeyNew:(NSString *)key service:(NSString *)service { ++ (NSString *)valueForKeychainKeyV2:(NSString *)key service:(NSString *)service { if (key == nil) { return nil; } - return [[ADJKeychain getInstance] valueForKeychainKeyNew:key service:service]; + + return [[ADJKeychain getInstance] valueForKeychainKeyV2:key service:service]; +} + ++ (CFStringRef *)getSecAttrAccessGroupToken { + CFStringRef *stringRef = dlsym(RTLD_SELF, "kSecAttrAccessGroupToken"); + return stringRef; } #pragma mark - Private & helper methods @@ -64,11 +73,7 @@ - (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSS OSStatus status = [self setValueWithStatus:value forKeychainKey:key inService:service]; if (status != noErr) { - if (NULL == &kSecAttrAccessGroupToken) { - [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain old way"]; - } else { - [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain new way"]; - } + [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain v1 way"]; return NO; } else { @@ -76,36 +81,30 @@ - (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSS BOOL wasSuccessful = [self wasWritingSuccessful:value forKeychainKey:key inService:service]; if (wasSuccessful) { - if (NULL == &kSecAttrAccessGroupToken) { - [[ADJAdjustFactory logger] verbose:@"Value successfully written to the keychain old way"]; - } else { - [[ADJAdjustFactory logger] verbose:@"Value successfully written to the keychain new way"]; - } - } else { - if (NULL == &kSecAttrAccessGroupToken) { - [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain after the check old way"]; - } else { - [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain after the check new way"]; - } + [[ADJAdjustFactory logger] warn:@"Value successfully written in v1 way to the keychain after the check"]; } return wasSuccessful; } } -- (NSString *)valueForKeychainKeyNew:(NSString *)key service:(NSString *)service { - NSMutableDictionary *newKeychainItem = [self keychainItemForKeyNew:key service:service]; +- (NSString *)valueForKeychainKeyV2:(NSString *)key service:(NSString *)service { + NSMutableDictionary *v2KeychainItem = [self keychainItemForKeyV2:key service:service]; - return [self valueForKeychainItem:newKeychainItem key:key service:service]; + return [self valueForKeychainItem:v2KeychainItem key:key service:service]; } -- (NSString *)valueForKeychainKeyOld:(NSString *)key service:(NSString *)service { - NSMutableDictionary *oldKeychainItem = [self keychainItemForKeyOld:key service:service]; +- (NSString *)valueForKeychainKeyV1:(NSString *)key service:(NSString *)service { + NSMutableDictionary *v1KeychainItem = [self keychainItemForKeyV1:key service:service]; - return [self valueForKeychainItem:oldKeychainItem key:key service:service]; + return [self valueForKeychainItem:v1KeychainItem key:key service:service]; } - (NSString *)valueForKeychainItem:(NSMutableDictionary *)keychainItem key:(NSString *)key service:(NSString *)service { + if (!keychainItem) { + return nil; + } + CFDictionaryRef result = nil; keychainItem[(__bridge id)kSecReturnData] = (__bridge id)kCFBooleanTrue; @@ -127,16 +126,22 @@ - (NSString *)valueForKeychainItem:(NSMutableDictionary *)keychainItem key:(NSSt return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; } -- (NSMutableDictionary *)keychainItemForKeyNew:(NSString *)key service:(NSString *)service { +- (NSMutableDictionary *)keychainItemForKeyV2:(NSString *)key service:(NSString *)service { NSMutableDictionary *keychainItem = [[NSMutableDictionary alloc] init]; - keychainItem[(__bridge id)kSecAttrAccessGroup] = (__bridge id)kSecAttrAccessGroupToken; + CFStringRef *cStringSecAttrAccessGroupToken = [ADJKeychain getSecAttrAccessGroupToken]; + + if (!cStringSecAttrAccessGroupToken) { + return nil; + } + + keychainItem[(__bridge id)kSecAttrAccessGroup] = (__bridge id)(* cStringSecAttrAccessGroupToken); [self keychainItemForKey:keychainItem key:key service:service]; return keychainItem; } -- (NSMutableDictionary *)keychainItemForKeyOld:(NSString *)key service:(NSString *)service { +- (NSMutableDictionary *)keychainItemForKeyV1:(NSString *)key service:(NSString *)service { NSMutableDictionary *keychainItem = [[NSMutableDictionary alloc] init]; keychainItem[(__bridge id)kSecAttrAccessible] = (__bridge id)kSecAttrAccessibleAlways; @@ -154,12 +159,7 @@ - (void)keychainItemForKey:(NSMutableDictionary *)keychainItem key:(NSString *)k - (OSStatus)setValueWithStatus:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { NSMutableDictionary *keychainItem; - if (NULL == &kSecAttrAccessGroupToken) { - keychainItem = [self keychainItemForKeyOld:key service:service]; - } else { - keychainItem = [self keychainItemForKeyNew:key service:service]; - } - + keychainItem = [self keychainItemForKeyV1:key service:service]; keychainItem[(__bridge id)kSecValueData] = [value dataUsingEncoding:NSUTF8StringEncoding]; return SecItemAdd((__bridge CFDictionaryRef)keychainItem, NULL); @@ -168,11 +168,7 @@ - (OSStatus)setValueWithStatus:(NSString *)value forKeychainKey:(NSString *)key - (BOOL)wasWritingSuccessful:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { NSString *writtenValue; - if (NULL == &kSecAttrAccessGroupToken) { - writtenValue = [self valueForKeychainKeyOld:key service:service]; - } else { - writtenValue = [self valueForKeychainKeyNew:key service:service]; - } + writtenValue = [self valueForKeychainKeyV1:key service:service]; if ([writtenValue isEqualToString:value]) { return YES; diff --git a/ios/Adjust/ADJPackageBuilder.m b/ios/Adjust/ADJPackageBuilder.m index 15224ad8..ccc6676c 100644 --- a/ios/Adjust/ADJPackageBuilder.m +++ b/ios/Adjust/ADJPackageBuilder.m @@ -72,7 +72,6 @@ - (ADJActivityPackage *)buildEventPackage:(ADJEvent *)event isInDelay:(BOOL)isInDelay { NSMutableDictionary *parameters = [self defaultParameters]; - [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; [ADJPackageBuilder parameters:parameters setInt:self.activityState.eventCount forKey:@"event_count"]; [ADJPackageBuilder parameters:parameters setNumber:event.revenue forKey:@"revenue"]; [ADJPackageBuilder parameters:parameters setString:event.currency forKey:@"currency"]; @@ -149,7 +148,6 @@ - (ADJActivityPackage *)buildClickPackage:(NSString *)clickSource - (ADJActivityPackage *)buildInfoPackage:(NSString *)infoSource { NSMutableDictionary *parameters = [self idsParameters]; - [ADJPackageBuilder parameters:parameters setInt:0 forKey:@"tce"]; [ADJPackageBuilder parameters:parameters setString:infoSource forKey:@"source"]; [self injectPushToken:self.activityState intoParamters:parameters]; @@ -198,7 +196,6 @@ - (NSMutableDictionary *)idsParameters { - (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"]; diff --git a/ios/Adjust/ADJRequestHandler.m b/ios/Adjust/ADJRequestHandler.m index 6c37a0f1..80b6ff1e 100644 --- a/ios/Adjust/ADJRequestHandler.m +++ b/ios/Adjust/ADJRequestHandler.m @@ -77,24 +77,6 @@ - (void)sendI:(ADJRequestHandler *)selfI activityPackage:(ADJActivityPackage *)a suffixErrorMessage:@"Will retry later" activityPackage:activityPackage responseDataHandler:^(ADJResponseData *responseData) { - if (NO == responseData.validationResult) { - NSString *previousValue = [activityPackage.parameters objectForKey:@"tce"]; - - if (nil == previousValue) { - [ADJPackageBuilder parameters:activityPackage.parameters setString:@"1" forKey:@"tce"]; - } else { - if ([previousValue isEqualToString:@"0"]) { - [ADJPackageBuilder parameters:activityPackage.parameters setString:@"1" forKey:@"tce"]; - } else { - [ADJPackageBuilder parameters:activityPackage.parameters setString:@"0" forKey:@"tce"]; - } - } - - [self sendPackage:activityPackage queueSize:queueSize]; - - return; - } - if (responseData.jsonResponse == nil) { [selfI.packageHandler closeFirstPackage:responseData activityPackage:activityPackage]; diff --git a/ios/Adjust/ADJResponseData.h b/ios/Adjust/ADJResponseData.h index 2d74f34a..378a9bb0 100644 --- a/ios/Adjust/ADJResponseData.h +++ b/ios/Adjust/ADJResponseData.h @@ -29,8 +29,6 @@ @property (nonatomic, assign) BOOL willRetry; -@property (nonatomic, assign) BOOL validationResult; - @property (nonatomic, strong) NSDictionary *jsonResponse; @property (nonatomic, copy) ADJAttribution *attribution; diff --git a/ios/Adjust/ADJResponseData.m b/ios/Adjust/ADJResponseData.m index 2363daca..9ca71e45 100644 --- a/ios/Adjust/ADJResponseData.m +++ b/ios/Adjust/ADJResponseData.m @@ -75,7 +75,6 @@ - (id)copyWithZone:(NSZone *)zone { copy.adid = [self.adid copyWithZone:zone]; copy.success = self.success; copy.willRetry = self.willRetry; - copy.validationResult = self.validationResult; copy.jsonResponse = [self.jsonResponse copyWithZone:zone]; copy.attribution = [self.attribution copyWithZone:zone]; } diff --git a/ios/Adjust/ADJUtil.m b/ios/Adjust/ADJUtil.m index a4eda1d9..3e1f5c6a 100644 --- a/ios/Adjust/ADJUtil.m +++ b/ios/Adjust/ADJUtil.m @@ -18,7 +18,6 @@ #import "ADJAdjustFactory.h" #import "UIDevice+ADJAdditions.h" #import "NSString+ADJAdditions.h" -#import "ADJConnectionValidator.h" static const double kRequestTimeout = 60; // 60 seconds @@ -31,7 +30,7 @@ static NSString *userAgent = nil; -static NSString * const kClientSdk = @"ios4.11.4"; +static NSString * const kClientSdk = @"ios4.11.5"; static NSString * const kDeeplinkParam = @"deep_link="; static NSString * const kSchemeDelimiter = @"://"; static NSString * const kDefaultScheme = @"AdjustUniversalScheme"; @@ -428,24 +427,7 @@ + (void)sendNSURLSessionRequest:(NSMutableURLRequest *)request suffixErrorMessage:(NSString *)suffixErrorMessage activityPackage:(ADJActivityPackage *)activityPackage responseDataHandler:(void (^)(ADJResponseData *responseData))responseDataHandler { - NSURLSession *session; - ADJConnectionValidator *connectionValidator; - - if (activityPackage.activityKind == ADJActivityKindEvent || - activityPackage.activityKind == ADJActivityKindSession || - activityPackage.activityKind == ADJActivityKindInfo) { - int tce = [[activityPackage.parameters objectForKey:@"tce"] intValue]; - - connectionValidator = [[ADJConnectionValidator alloc] init]; - [connectionValidator setExpectedTce:tce]; - [connectionValidator setDidValidationHappen:NO]; - - session = [NSURLSession sessionWithConfiguration:urlSessionConfiguration - delegate:connectionValidator - delegateQueue:nil]; - } else { - session = [NSURLSession sessionWithConfiguration:urlSessionConfiguration]; - } + NSURLSession *session = [NSURLSession sessionWithConfiguration:urlSessionConfiguration]; NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler: @@ -457,14 +439,6 @@ + (void)sendNSURLSessionRequest:(NSMutableURLRequest *)request suffixErrorMessage:suffixErrorMessage activityPackage:activityPackage]; - if (nil != connectionValidator) { - if (NO == connectionValidator.didValidationHappen) { - responseData.validationResult = YES; - } else { - responseData.validationResult = connectionValidator.validationResult; - } - } - responseDataHandler(responseData); }]; diff --git a/ios/Adjust/Adjust.h b/ios/Adjust/Adjust.h index 3ca9b626..d96ef5a8 100644 --- a/ios/Adjust/Adjust.h +++ b/ios/Adjust/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust // -// V4.11.4 +// V4.11.5 // Created by Christian Wellenbrock on 2012-07-23. // Copyright (c) 2012-2014 adjust GmbH. All rights reserved. // diff --git a/ios/AdjustSdk.xcodeproj/project.pbxproj b/ios/AdjustSdk.xcodeproj/project.pbxproj index f64884e0..99ccf091 100644 --- a/ios/AdjustSdk.xcodeproj/project.pbxproj +++ b/ios/AdjustSdk.xcodeproj/project.pbxproj @@ -40,7 +40,6 @@ 9D9741D01E49E2DF0016F8D4 /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9741AE1E49E2DF0016F8D4 /* ADJTimerOnce.m */; }; 9D9741D11E49E2DF0016F8D4 /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9741B01E49E2DF0016F8D4 /* Adjust.m */; }; 9D9741D21E49E2DF0016F8D4 /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D9741B21E49E2DF0016F8D4 /* ADJUtil.m */; }; - 9DB413561E9B691500F688C8 /* ADJConnectionValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DB413551E9B691500F688C8 /* ADJConnectionValidator.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -124,8 +123,6 @@ 9D9741B11E49E2DF0016F8D4 /* ADJUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJUtil.h; sourceTree = ""; }; 9D9741B21E49E2DF0016F8D4 /* ADJUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJUtil.m; sourceTree = ""; }; 9D9741B31E49E2DF0016F8D4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9DB413541E9B691500F688C8 /* ADJConnectionValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJConnectionValidator.h; sourceTree = ""; }; - 9DB413551E9B691500F688C8 /* ADJConnectionValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJConnectionValidator.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -227,8 +224,6 @@ 9D9741B01E49E2DF0016F8D4 /* Adjust.m */, 9D9741B11E49E2DF0016F8D4 /* ADJUtil.h */, 9D9741B21E49E2DF0016F8D4 /* ADJUtil.m */, - 9DB413541E9B691500F688C8 /* ADJConnectionValidator.h */, - 9DB413551E9B691500F688C8 /* ADJConnectionValidator.m */, 9D9741B31E49E2DF0016F8D4 /* Info.plist */, ); path = Adjust; @@ -323,7 +318,6 @@ 9D9741C21E49E2DF0016F8D4 /* ADJEventFailure.m in Sources */, 9D9741BB1E49E2DF0016F8D4 /* ADJAdjustFactory.m in Sources */, 9D9741CC1E49E2DF0016F8D4 /* ADJSessionParameters.m in Sources */, - 9DB413561E9B691500F688C8 /* ADJConnectionValidator.m in Sources */, 9D9741B61E49E2DF0016F8D4 /* ADJActivityPackage.m in Sources */, 9D9741D01E49E2DF0016F8D4 /* ADJTimerOnce.m in Sources */, 9D9741BF1E49E2DF0016F8D4 /* ADJConfig.m in Sources */, diff --git a/package.json b/package.json index 96ba9c70..f52ccaac 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-adjust", "description": "Adjust React Native SDK", - "version": "4.11.5", + "version": "4.11.6", "main": "index.js", "author": "adjust GmbH", "license": "MIT",