diff --git a/Adjust.podspec b/Adjust.podspec index dc54b39fb..17503f475 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "Adjust" - s.version = "4.18.1" + s.version = "4.18.2" 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.18.1" } + s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.18.2" } s.ios.deployment_target = '6.0' s.tvos.deployment_target = '9.0' s.framework = 'SystemConfiguration' diff --git a/Adjust.xcodeproj/project.pbxproj b/Adjust.xcodeproj/project.pbxproj index f88fe1876..165783ada 100644 --- a/Adjust.xcodeproj/project.pbxproj +++ b/Adjust.xcodeproj/project.pbxproj @@ -40,7 +40,6 @@ 9615159F1CD2CB360022D336 /* libAdjust.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9679920D18BBAE2800394606 /* libAdjust.a */; }; 961515A01CD2CB450022D336 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DE7C8FC1AE688DA001556E5 /* UIKit.framework */; }; 961515A21CD2CB4F0022D336 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961515A11CD2CB4F0022D336 /* WebKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 961515A31CD2CB9D0022D336 /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9648C5E71CD1765E00A3B049 /* WebViewJavascriptBridge.m */; }; 961515A41CD2CBA20022D336 /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 9648C5E91CD1765E00A3B049 /* WebViewJavascriptBridge_JS.m */; }; 961515A51CD2CBA80022D336 /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 9648C5EB1CD1765E00A3B049 /* WebViewJavascriptBridgeBase.m */; }; 961515A61CD2CBAC0022D336 /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9648C5ED1CD1765E00A3B049 /* WKWebViewJavascriptBridge.m */; }; @@ -211,11 +210,9 @@ 9D0E2EAF210B575600133B4F /* AdjustBridgeRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0E2E5D210B575600133B4F /* AdjustBridgeRegister.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9D0E2EB0210B575600133B4F /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0E2E5F210B575600133B4F /* WebViewJavascriptBridgeBase.m */; }; 9D0E2EB2210B575600133B4F /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0E2E61210B575600133B4F /* WKWebViewJavascriptBridge.m */; }; - 9D0E2EB3210B575600133B4F /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0E2E62210B575600133B4F /* WebViewJavascriptBridge.m */; }; 9D0E2EB4210B575600133B4F /* WebViewJavascriptBridge_JS.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0E2E63210B575600133B4F /* WebViewJavascriptBridge_JS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9D0E2EB5210B575600133B4F /* WebViewJavascriptBridgeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0E2E64210B575600133B4F /* WebViewJavascriptBridgeBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9D0E2EB7210B575600133B4F /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0E2E66210B575600133B4F /* WebViewJavascriptBridge_JS.m */; }; - 9D0E2EB8210B575600133B4F /* WebViewJavascriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0E2E67210B575600133B4F /* WebViewJavascriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9D0E2EB9210B575600133B4F /* WKWebViewJavascriptBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0E2E68210B575600133B4F /* WKWebViewJavascriptBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9D0E2EBA210B575600133B4F /* AdjustBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0E2E69210B575600133B4F /* AdjustBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9D0E2EBB210B575600133B4F /* AdjustBridgeRegister.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0E2E6A210B575600133B4F /* AdjustBridgeRegister.m */; }; @@ -625,8 +622,6 @@ 96325E84190E5CD900A97911 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; 96325E86190E5CE400A97911 /* iAd.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = iAd.framework; path = System/Library/Frameworks/iAd.framework; sourceTree = SDKROOT; }; 9644B7EA19F148F3008576FC /* ADJDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJDeviceInfo.h; sourceTree = ""; }; - 9648C5E61CD1765E00A3B049 /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = ""; }; - 9648C5E71CD1765E00A3B049 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = ""; }; 9648C5E81CD1765E00A3B049 /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = ""; }; 9648C5E91CD1765E00A3B049 /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = ""; }; 9648C5EA1CD1765E00A3B049 /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = ""; }; @@ -805,11 +800,9 @@ 9D0E2E5D210B575600133B4F /* AdjustBridgeRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustBridgeRegister.h; sourceTree = ""; }; 9D0E2E5F210B575600133B4F /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridgeBase.m; sourceTree = ""; }; 9D0E2E61210B575600133B4F /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJavascriptBridge.m; sourceTree = ""; }; - 9D0E2E62210B575600133B4F /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = ""; }; 9D0E2E63210B575600133B4F /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = ""; }; 9D0E2E64210B575600133B4F /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = ""; }; 9D0E2E66210B575600133B4F /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = ""; }; - 9D0E2E67210B575600133B4F /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = ""; }; 9D0E2E68210B575600133B4F /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewJavascriptBridge.h; sourceTree = ""; }; 9D0E2E69210B575600133B4F /* AdjustBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustBridge.h; sourceTree = ""; }; 9D0E2E6A210B575600133B4F /* AdjustBridgeRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustBridgeRegister.m; sourceTree = ""; }; @@ -1209,8 +1202,6 @@ 9648C5E51CD1765E00A3B049 /* WebViewJavascriptBridge */ = { isa = PBXGroup; children = ( - 9648C5E61CD1765E00A3B049 /* WebViewJavascriptBridge.h */, - 9648C5E71CD1765E00A3B049 /* WebViewJavascriptBridge.m */, 9648C5E81CD1765E00A3B049 /* WebViewJavascriptBridge_JS.h */, 9648C5E91CD1765E00A3B049 /* WebViewJavascriptBridge_JS.m */, 9648C5EA1CD1765E00A3B049 /* WebViewJavascriptBridgeBase.h */, @@ -1477,8 +1468,6 @@ children = ( 9D0E2E63210B575600133B4F /* WebViewJavascriptBridge_JS.h */, 9D0E2E66210B575600133B4F /* WebViewJavascriptBridge_JS.m */, - 9D0E2E67210B575600133B4F /* WebViewJavascriptBridge.h */, - 9D0E2E62210B575600133B4F /* WebViewJavascriptBridge.m */, 9D0E2E68210B575600133B4F /* WKWebViewJavascriptBridge.h */, 9D0E2E61210B575600133B4F /* WKWebViewJavascriptBridge.m */, 9D0E2E64210B575600133B4F /* WebViewJavascriptBridgeBase.h */, @@ -1894,7 +1883,6 @@ 9D0E2E06210B570600133B4F /* AdjustSdkWebBridge.h in Headers */, 9D0E2EBA210B575600133B4F /* AdjustBridge.h in Headers */, 9D0E2EAF210B575600133B4F /* AdjustBridgeRegister.h in Headers */, - 9D0E2EB8210B575600133B4F /* WebViewJavascriptBridge.h in Headers */, 9D0E2EB9210B575600133B4F /* WKWebViewJavascriptBridge.h in Headers */, 9D0E2EB4210B575600133B4F /* WebViewJavascriptBridge_JS.h in Headers */, 9D0E2EB5210B575600133B4F /* WebViewJavascriptBridgeBase.h in Headers */, @@ -2516,7 +2504,6 @@ files = ( 961515A71CD2CBB00022D336 /* AdjustBridge.m in Sources */, 968595EE1D0B25970011CA2B /* AdjustBridgeRegister.m in Sources */, - 961515A31CD2CB9D0022D336 /* WebViewJavascriptBridge.m in Sources */, 961515A41CD2CBA20022D336 /* WebViewJavascriptBridge_JS.m in Sources */, 961515A61CD2CBAC0022D336 /* WKWebViewJavascriptBridge.m in Sources */, 961515A51CD2CBA80022D336 /* WebViewJavascriptBridgeBase.m in Sources */, @@ -2602,7 +2589,6 @@ buildActionMask = 2147483647; files = ( 9D0E2E93210B575600133B4F /* NSString+ADJAdditions.m in Sources */, - 9D0E2EB3210B575600133B4F /* WebViewJavascriptBridge.m in Sources */, 9D0E2E7E210B575600133B4F /* ADJEventSuccess.m in Sources */, 9D0E2E7C210B575600133B4F /* ADJEventFailure.m in Sources */, 9D0E2E7F210B575600133B4F /* ADJActivityState.m in Sources */, diff --git a/Adjust/ADJActivityState.m b/Adjust/ADJActivityState.m index df58eaeb9..7fc8fe9f4 100644 --- a/Adjust/ADJActivityState.m +++ b/Adjust/ADJActivityState.m @@ -21,27 +21,26 @@ @implementation ADJActivityState - (id)init { self = [super init]; - if (self == nil) { return nil; } - + [self assignUuid:[UIDevice.currentDevice adjCreateUuid]]; - - self.eventCount = 0; - self.sessionCount = 0; - self.subsessionCount = -1; // -1 means unknown - self.sessionLength = -1; - self.timeSpent = -1; - self.lastActivity = -1; - self.lastInterval = -1; - self.enabled = YES; - self.isGdprForgotten = NO; - self.askingAttribution = NO; - self.deviceToken = nil; - self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount]; - self.updatePackages = NO; - + + self.eventCount = 0; + self.sessionCount = 0; + self.subsessionCount = -1; // -1 means unknown + self.sessionLength = -1; + self.timeSpent = -1; + self.lastActivity = -1; + self.lastInterval = -1; + self.enabled = YES; + self.isGdprForgotten = NO; + self.askingAttribution = NO; + self.deviceToken = nil; + self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount]; + self.updatePackages = NO; + return self; } @@ -55,10 +54,10 @@ + (void)saveAppToken:(NSString *)appTokenToSave { - (void)resetSessionAttributes:(double)now { self.subsessionCount = 1; - self.sessionLength = 0; - self.timeSpent = 0; - self.lastInterval = -1; - self.lastActivity = now; + self.sessionLength = 0; + self.timeSpent = 0; + self.lastInterval = -1; + self.lastActivity = now; } - (void)addTransactionId:(NSString *)transactionId { @@ -66,12 +65,12 @@ - (void)addTransactionId:(NSString *)transactionId { if (self.transactionIds == nil) { self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount]; } - + // Make space. if (self.transactionIds.count == kTransactionIdCount) { [self.transactionIds removeObjectAtIndex:0]; } - + // Add the new ID. [self.transactionIds addObject:transactionId]; } @@ -83,55 +82,26 @@ - (BOOL)findTransactionId:(NSString *)transactionId { #pragma mark - Private & helper methods - (void)assignUuid:(NSString *)uuid { - // 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]; -} + NSString *persistedUuid = [ADJKeychain valueForKeychainKey:@"adjust_uuid" service:@"deviceInfo"]; -- (void)assignUuidOldMethod:(NSString *)uuid { - NSString *persistedUuid = [ADJKeychain valueForKeychainKeyV1:@"adjust_persisted_uuid" service:@"deviceInfo"]; - - // Check if value exists in keychain. + // 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 v1 way"]; + [[ADJAdjustFactory logger] verbose:@"Value read from the keychain"]; // Value written in keychain seems to have UUID format. self.uuid = persistedUuid; self.isPersisted = YES; - return; } } - // At this point, UUID was not persisted in v1 way or if persisted, didn't have proper UUID format. - + // At this point, UUID was not persisted in Keychain 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 in v1 way and flag if successfully written. + // Try to save that value to the keychain. self.uuid = uuid; - self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:@"adjust_persisted_uuid" inService:@"deviceInfo"]; + self.isPersisted = [ADJKeychain setValue:self.uuid forKeychainKey:@"adjust_uuid" inService:@"deviceInfo"]; } - (NSString *)generateUniqueKey { @@ -140,13 +110,11 @@ - (NSString *)generateUniqueKey { } NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; - if (bundleIdentifier == nil) { return nil; } NSString *joinedKey = [NSString stringWithFormat:@"%@%@", bundleIdentifier, appToken]; - return [joinedKey adjSha1]; } @@ -160,35 +128,32 @@ - (NSString *)description { - (id)initWithCoder:(NSCoder *)decoder { self = [super init]; - if (self == nil) { return nil; } + + self.eventCount = [decoder decodeIntForKey:@"eventCount"]; + self.sessionCount = [decoder decodeIntForKey:@"sessionCount"]; + self.subsessionCount = [decoder decodeIntForKey:@"subsessionCount"]; + self.sessionLength = [decoder decodeDoubleForKey:@"sessionLength"]; + self.timeSpent = [decoder decodeDoubleForKey:@"timeSpent"]; + self.lastActivity = [decoder decodeDoubleForKey:@"lastActivity"]; - self.eventCount = [decoder decodeIntForKey:@"eventCount"]; - self.sessionCount = [decoder decodeIntForKey:@"sessionCount"]; - self.subsessionCount = [decoder decodeIntForKey:@"subsessionCount"]; - self.sessionLength = [decoder decodeDoubleForKey:@"sessionLength"]; - self.timeSpent = [decoder decodeDoubleForKey:@"timeSpent"]; - self.lastActivity = [decoder decodeDoubleForKey:@"lastActivity"]; - - // Default values for migrating devices + // Default values for migrating devices. if ([decoder containsValueForKey:@"uuid"]) { [self assignUuid:[decoder decodeObjectForKey:@"uuid"]]; } - if (self.uuid == nil) { [self assignUuid:[UIDevice.currentDevice adjCreateUuid]]; } - + if ([decoder containsValueForKey:@"transactionIds"]) { self.transactionIds = [decoder decodeObjectForKey:@"transactionIds"]; } - if (self.transactionIds == nil) { self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount]; } - + if ([decoder containsValueForKey:@"enabled"]) { self.enabled = [decoder decodeBoolForKey:@"enabled"]; } else { @@ -200,51 +165,51 @@ - (id)initWithCoder:(NSCoder *)decoder { } else { self.isGdprForgotten = NO; } - + if ([decoder containsValueForKey:@"askingAttribution"]) { self.askingAttribution = [decoder decodeBoolForKey:@"askingAttribution"]; } else { self.askingAttribution = NO; } - + if ([decoder containsValueForKey:@"deviceToken"]) { - self.deviceToken = [decoder decodeObjectForKey:@"deviceToken"]; + self.deviceToken = [decoder decodeObjectForKey:@"deviceToken"]; } - + if ([decoder containsValueForKey:@"updatePackages"]) { - self.updatePackages = [decoder decodeBoolForKey:@"updatePackages"]; + self.updatePackages = [decoder decodeBoolForKey:@"updatePackages"]; } else { - self.updatePackages = NO; + self.updatePackages = NO; } - + if ([decoder containsValueForKey:@"adid"]) { - self.adid = [decoder decodeObjectForKey:@"adid"]; + self.adid = [decoder decodeObjectForKey:@"adid"]; } - + if ([decoder containsValueForKey:@"attributionDetails"]) { self.attributionDetails = [decoder decodeObjectForKey:@"attributionDetails"]; } - + self.lastInterval = -1; - + return self; } - (void)encodeWithCoder:(NSCoder *)encoder { - [encoder encodeInt:self.eventCount forKey:@"eventCount"]; - [encoder encodeInt:self.sessionCount forKey:@"sessionCount"]; - [encoder encodeInt:self.subsessionCount forKey:@"subsessionCount"]; - [encoder encodeDouble:self.sessionLength forKey:@"sessionLength"]; - [encoder encodeDouble:self.timeSpent forKey:@"timeSpent"]; - [encoder encodeDouble:self.lastActivity forKey:@"lastActivity"]; - [encoder encodeObject:self.uuid forKey:@"uuid"]; - [encoder encodeObject:self.transactionIds forKey:@"transactionIds"]; - [encoder encodeBool:self.enabled forKey:@"enabled"]; - [encoder encodeBool:self.isGdprForgotten forKey:@"isGdprForgotten"]; + [encoder encodeInt:self.eventCount forKey:@"eventCount"]; + [encoder encodeInt:self.sessionCount forKey:@"sessionCount"]; + [encoder encodeInt:self.subsessionCount forKey:@"subsessionCount"]; + [encoder encodeDouble:self.sessionLength forKey:@"sessionLength"]; + [encoder encodeDouble:self.timeSpent forKey:@"timeSpent"]; + [encoder encodeDouble:self.lastActivity forKey:@"lastActivity"]; + [encoder encodeObject:self.uuid forKey:@"uuid"]; + [encoder encodeObject:self.transactionIds forKey:@"transactionIds"]; + [encoder encodeBool:self.enabled forKey:@"enabled"]; + [encoder encodeBool:self.isGdprForgotten forKey:@"isGdprForgotten"]; [encoder encodeBool:self.askingAttribution forKey:@"askingAttribution"]; - [encoder encodeObject:self.deviceToken forKey:@"deviceToken"]; - [encoder encodeBool:self.updatePackages forKey:@"updatePackages"]; - [encoder encodeObject:self.adid forKey:@"adid"]; + [encoder encodeObject:self.deviceToken forKey:@"deviceToken"]; + [encoder encodeBool:self.updatePackages forKey:@"updatePackages"]; + [encoder encodeObject:self.adid forKey:@"adid"]; [encoder encodeObject:self.attributionDetails forKey:@"attributionDetails"]; } @@ -252,22 +217,22 @@ - (void)encodeWithCoder:(NSCoder *)encoder { - (id)copyWithZone:(NSZone *)zone { ADJActivityState *copy = [[[self class] allocWithZone:zone] init]; - + // Copy only values used by package builder. if (copy) { - copy.sessionCount = self.sessionCount; - copy.subsessionCount = self.subsessionCount; - copy.sessionLength = self.sessionLength; - copy.timeSpent = self.timeSpent; - copy.uuid = [self.uuid copyWithZone:zone]; - copy.lastInterval = self.lastInterval; - copy.eventCount = self.eventCount; - copy.enabled = self.enabled; - copy.isGdprForgotten = self.isGdprForgotten; - copy.lastActivity = self.lastActivity; - copy.askingAttribution = self.askingAttribution; - copy.deviceToken = [self.deviceToken copyWithZone:zone]; - copy.updatePackages = self.updatePackages; + copy.sessionCount = self.sessionCount; + copy.subsessionCount = self.subsessionCount; + copy.sessionLength = self.sessionLength; + copy.timeSpent = self.timeSpent; + copy.uuid = [self.uuid copyWithZone:zone]; + copy.lastInterval = self.lastInterval; + copy.eventCount = self.eventCount; + copy.enabled = self.enabled; + copy.isGdprForgotten = self.isGdprForgotten; + copy.lastActivity = self.lastActivity; + copy.askingAttribution = self.askingAttribution; + copy.deviceToken = [self.deviceToken copyWithZone:zone]; + copy.updatePackages = self.updatePackages; } return copy; diff --git a/Adjust/ADJKeychain.h b/Adjust/ADJKeychain.h index 9e85dfead..18ceab0a3 100644 --- a/Adjust/ADJKeychain.h +++ b/Adjust/ADJKeychain.h @@ -10,8 +10,7 @@ @interface ADJKeychain : NSObject -+ (NSString *)valueForKeychainKeyV1:(NSString *)key service:(NSString *)service; -+ (NSString *)valueForKeychainKeyV2:(NSString *)key service:(NSString *)service; ++ (NSString *)valueForKeychainKey:(NSString *)key service:(NSString *)service; + (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service; @end diff --git a/Adjust/ADJKeychain.m b/Adjust/ADJKeychain.m index 2cffe7201..8b2283b5c 100644 --- a/Adjust/ADJKeychain.m +++ b/Adjust/ADJKeychain.m @@ -46,58 +46,48 @@ + (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSS return [[ADJKeychain getInstance] setValue:value forKeychainKey:key inService:service]; } -+ (NSString *)valueForKeychainKeyV1:(NSString *)key service:(NSString *)service { ++ (NSString *)valueForKeychainKey:(NSString *)key service:(NSString *)service { if (key == nil) { return nil; } - return [[ADJKeychain getInstance] valueForKeychainKeyV1:key service:service]; + return [[ADJKeychain getInstance] valueForKeychainKey:key service:service]; } -+ (NSString *)valueForKeychainKeyV2:(NSString *)key service:(NSString *)service { - if (key == nil) { - return nil; - } - - return [[ADJKeychain getInstance] valueForKeychainKeyV2:key service:service]; -} - -+ (CFStringRef *)getSecAttrAccessGroupToken { - CFStringRef *stringRef = dlsym(RTLD_SELF, "kSecAttrAccessGroupToken"); - return stringRef; -} - -#pragma mark - Private & helper methods +#pragma mark - Set Keychain item value - (BOOL)setValue:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { OSStatus status = [self setValueWithStatus:value forKeychainKey:key inService:service]; if (status != noErr) { - [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain v1 way"]; - + [[ADJAdjustFactory logger] warn:@"Value unsuccessfully written to the keychain"]; return NO; } else { // Check was writing successful. BOOL wasSuccessful = [self wasWritingSuccessful:value forKeychainKey:key inService:service]; if (wasSuccessful) { - [[ADJAdjustFactory logger] warn:@"Value successfully written in v1 way to the keychain after the check"]; + [[ADJAdjustFactory logger] warn:@"Value successfully written to the keychain"]; } return wasSuccessful; } } -- (NSString *)valueForKeychainKeyV2:(NSString *)key service:(NSString *)service { - NSMutableDictionary *v2KeychainItem = [self keychainItemForKeyV2:key service:service]; - - return [self valueForKeychainItem:v2KeychainItem key:key service:service]; +- (OSStatus)setValueWithStatus:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { + NSMutableDictionary *keychainItem; + + keychainItem = [self keychainItemForKey:key service:service]; + keychainItem[(__bridge id)kSecValueData] = [value dataUsingEncoding:NSUTF8StringEncoding]; + + return SecItemAdd((__bridge CFDictionaryRef)keychainItem, NULL); } -- (NSString *)valueForKeychainKeyV1:(NSString *)key service:(NSString *)service { - NSMutableDictionary *v1KeychainItem = [self keychainItemForKeyV1:key service:service]; +#pragma mark - Get Keychain item value - return [self valueForKeychainItem:v1KeychainItem key:key service:service]; +- (NSString *)valueForKeychainKey:(NSString *)key service:(NSString *)service { + NSMutableDictionary *keychainItem = [self keychainItemForKey:key service:service]; + return [self valueForKeychainItem:keychainItem key:key service:service]; } - (NSString *)valueForKeychainItem:(NSMutableDictionary *)keychainItem key:(NSString *)key service:(NSString *)service { @@ -105,20 +95,17 @@ - (NSString *)valueForKeychainItem:(NSMutableDictionary *)keychainItem key:(NSSt return nil; } - CFDictionaryRef result = nil; - keychainItem[(__bridge id)kSecReturnData] = (__bridge id)kCFBooleanTrue; keychainItem[(__bridge id)kSecReturnAttributes] = (__bridge id)kCFBooleanTrue; + CFDictionaryRef result = nil; OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)keychainItem, (CFTypeRef *)&result); - if (status != noErr) { return nil; } NSDictionary *resultDict = (__bridge_transfer NSDictionary *)result; NSData *data = resultDict[(__bridge id)kSecValueData]; - if (!data) { return nil; } @@ -126,25 +113,12 @@ - (NSString *)valueForKeychainItem:(NSMutableDictionary *)keychainItem key:(NSSt return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; } -- (NSMutableDictionary *)keychainItemForKeyV2:(NSString *)key service:(NSString *)service { - NSMutableDictionary *keychainItem = [[NSMutableDictionary alloc] init]; - - CFStringRef *cStringSecAttrAccessGroupToken = [ADJKeychain getSecAttrAccessGroupToken]; - - if (!cStringSecAttrAccessGroupToken) { - return nil; - } - - keychainItem[(__bridge id)kSecAttrAccessGroup] = (__bridge id)(* cStringSecAttrAccessGroupToken); - [self keychainItemForKey:keychainItem key:key service:service]; - - return keychainItem; -} +#pragma mark - Build Keychain item -- (NSMutableDictionary *)keychainItemForKeyV1:(NSString *)key service:(NSString *)service { +- (NSMutableDictionary *)keychainItemForKey:(NSString *)key service:(NSString *)service { NSMutableDictionary *keychainItem = [[NSMutableDictionary alloc] init]; - keychainItem[(__bridge id)kSecAttrAccessible] = (__bridge id)kSecAttrAccessibleAlways; + keychainItem[(__bridge id)kSecAttrAccessible] = (__bridge id)kSecAttrAccessibleAfterFirstUnlock; [self keychainItemForKey:keychainItem key:key service:service]; return keychainItem; @@ -156,20 +130,10 @@ - (void)keychainItemForKey:(NSMutableDictionary *)keychainItem key:(NSString *)k keychainItem[(__bridge id)kSecAttrService] = service; } -- (OSStatus)setValueWithStatus:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { - NSMutableDictionary *keychainItem; - - keychainItem = [self keychainItemForKeyV1:key service:service]; - keychainItem[(__bridge id)kSecValueData] = [value dataUsingEncoding:NSUTF8StringEncoding]; - - return SecItemAdd((__bridge CFDictionaryRef)keychainItem, NULL); -} +#pragma mark - Writing validation - (BOOL)wasWritingSuccessful:(NSString *)value forKeychainKey:(NSString *)key inService:(NSString *)service { - NSString *writtenValue; - - writtenValue = [self valueForKeychainKeyV1:key service:service]; - + NSString *writtenValue = [self valueForKeychainKey:key service:service]; if ([writtenValue isEqualToString:value]) { return YES; } else { diff --git a/Adjust/ADJUtil.m b/Adjust/ADJUtil.m index 3a0e656f0..7355102df 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -40,7 +40,7 @@ static CTTelephonyNetworkInfo *networkInfo = nil; #endif -static NSString * const kClientSdk = @"ios4.18.1"; +static NSString * const kClientSdk = @"ios4.18.2"; 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 843d3b1d4..334acefa9 100644 --- a/Adjust/Adjust.h +++ b/Adjust/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust // -// V4.18.1 +// V4.18.2 // Created by Christian Wellenbrock (wellle) on 23rd July 2013. // Copyright © 2012-2017 Adjust GmbH. All rights reserved. // diff --git a/AdjustBridge/AdjustBridge.h b/AdjustBridge/AdjustBridge.h index 39447b448..2de7820ff 100644 --- a/AdjustBridge/AdjustBridge.h +++ b/AdjustBridge/AdjustBridge.h @@ -15,9 +15,7 @@ @property (nonatomic, strong, readonly) AdjustBridgeRegister *bridgeRegister; -- (void)loadUIWebViewBridge:(WVJB_WEBVIEW_TYPE *)webView; - (void)loadWKWebViewBridge:(WKWebView *)wkWebView; -- (void)loadUIWebViewBridge:(WVJB_WEBVIEW_TYPE *)webView webViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE *)webViewDelegate; - (void)loadWKWebViewBridge:(WKWebView *)wkWebView wkWebViewDelegate:(id)wkWebViewDelegate; - (void)augmentHybridWebView; diff --git a/AdjustBridge/AdjustBridge.m b/AdjustBridge/AdjustBridge.m index 643267ee2..d0fcd7f7b 100644 --- a/AdjustBridge/AdjustBridge.m +++ b/AdjustBridge/AdjustBridge.m @@ -13,7 +13,6 @@ #import "AdjustBridge.h" #import "ADJAdjustFactory.h" -#import "WebViewJavascriptBridge.h" #import "WKWebViewJavascriptBridge.h" @interface AdjustBridge() @@ -165,24 +164,10 @@ - (void)augmentHybridWebView { [self registerAugmentedView]; } -- (void)loadUIWebViewBridge:(WVJB_WEBVIEW_TYPE *)webView { - [self loadUIWebViewBridge:webView webViewDelegate:nil]; -} - - (void)loadWKWebViewBridge:(WKWebView *)wkWebView { [self loadWKWebViewBridge:wkWebView wkWebViewDelegate:nil]; } -- (void)loadUIWebViewBridge:(WVJB_WEBVIEW_TYPE *)webView - webViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE *)webViewDelegate { - if (self.bridgeRegister != nil) { - // WebViewBridge already loaded. - return; - } - - [self loadWebViewBridge:webView webViewDelegate:webViewDelegate]; -} - - (void)loadWKWebViewBridge:(WKWebView *)wkWebView wkWebViewDelegate:(id)wkWebViewDelegate { if (self.bridgeRegister != nil) { @@ -190,12 +175,8 @@ - (void)loadWKWebViewBridge:(WKWebView *)wkWebView return; } - [self loadWebViewBridge:wkWebView webViewDelegate:wkWebViewDelegate]; -} - -- (void)loadWebViewBridge:(id)webView webViewDelegate:(id)webViewDelegate { - _bridgeRegister = [[AdjustBridgeRegister alloc] initWithWebView:webView]; - [self.bridgeRegister setWebViewDelegate:webViewDelegate]; + _bridgeRegister = [[AdjustBridgeRegister alloc] initWithWKWebView:wkWebView]; + [self.bridgeRegister setWKWebViewDelegate:wkWebViewDelegate]; [self.bridgeRegister registerHandler:@"adjust_appDidLaunch" handler:^(id data, WVJBResponseCallback responseCallback) { NSString *appToken = [data objectForKey:@"appToken"]; diff --git a/AdjustBridge/AdjustBridgeRegister.h b/AdjustBridge/AdjustBridgeRegister.h index 24074cade..e9a06c61d 100644 --- a/AdjustBridge/AdjustBridgeRegister.h +++ b/AdjustBridge/AdjustBridgeRegister.h @@ -7,14 +7,14 @@ // #import -#import "WebViewJavascriptBridge.h" +#import "WKWebViewJavascriptBridge.h" @interface AdjustBridgeRegister : NSObject + (NSString *)AdjustBridge_js; -- (id)initWithWebView:(id)webView; -- (void)setWebViewDelegate:(id)webViewDelegate; +- (id)initWithWKWebView:(WKWebView*)webView; +- (void)setWKWebViewDelegate:(id)webViewDelegate; - (void)callHandler:(NSString *)handlerName data:(id)data; - (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler; - (void)augmentHybridWebView:(NSString *)fbAppId; diff --git a/AdjustBridge/AdjustBridgeRegister.m b/AdjustBridge/AdjustBridgeRegister.m index d3dbab329..72ce54cc6 100644 --- a/AdjustBridge/AdjustBridgeRegister.m +++ b/AdjustBridge/AdjustBridgeRegister.m @@ -13,32 +13,32 @@ @interface AdjustBridgeRegister() -@property (nonatomic, strong) WebViewJavascriptBridge *wvjb; +@property (nonatomic, strong) WKWebViewJavascriptBridge *wkwvjb; @end @implementation AdjustBridgeRegister -- (id)initWithWebView:(id)webView { +- (id)initWithWKWebView:(WKWebView*)webView { self = [super init]; if (self == nil) { return nil; } - self.wvjb = [WebViewJavascriptBridge bridgeForWebView:webView]; + self.wkwvjb = [WKWebViewJavascriptBridge bridgeForWebView:webView]; return self; } -- (void)setWebViewDelegate:(id)webViewDelegate { - [self.wvjb setWebViewDelegate:webViewDelegate]; +- (void)setWKWebViewDelegate:(id)webViewDelegate { + [self.wkwvjb setWebViewDelegate:webViewDelegate]; } - (void)callHandler:(NSString *)handlerName data:(id)data { - [self.wvjb callHandler:handlerName data:data]; + [self.wkwvjb callHandler:handlerName data:data]; } - (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler { - [self.wvjb registerHandler:handlerName handler:handler]; + [self.wkwvjb registerHandler:handlerName handler:handler]; } - (void)augmentHybridWebView:(NSString *)fbAppId { @@ -211,7 +211,7 @@ + (NSString *)adjust_js { if (this.sdkPrefix) { return this.sdkPrefix; } else { - return 'web-bridge4.18.1'; + return 'web-bridge4.18.2'; } }, setTestOptions: function(testOptions) { diff --git a/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h b/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h index 4e3404fc0..78c21d13d 100644 --- a/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h +++ b/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h @@ -5,12 +5,6 @@ // Copyright (c) 2014 @LokiMeyburg. All rights reserved. // -#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1) -#define supportsWKWebView -#endif - -#if defined supportsWKWebView - #import #import "WebViewJavascriptBridgeBase.h" #import @@ -26,9 +20,7 @@ - (void)callHandler:(NSString*)handlerName data:(id)data; - (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback; - (void)reset; -- (void)setWebViewDelegate:(id)webViewDelegate; +- (void)setWebViewDelegate:(id)webViewDelegate; - (void)disableJavscriptAlertBoxSafetyTimeout; @end - -#endif diff --git a/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m b/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m index e104c7687..6f3e6b3a7 100644 --- a/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m +++ b/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m @@ -8,8 +8,6 @@ #import "WKWebViewJavascriptBridge.h" -#if defined supportsWKWebView - @implementation WKWebViewJavascriptBridge { __weak WKWebView* _webView; __weak id _webViewDelegate; @@ -193,6 +191,3 @@ - (NSString*) _evaluateJavascript:(NSString*)javascriptCommand { @end - - -#endif diff --git a/AdjustBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.h b/AdjustBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.h deleted file mode 100755 index 1b64bb4e9..000000000 --- a/AdjustBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// WebViewJavascriptBridge.h -// ExampleApp-iOS -// -// Created by Marcus Westin on 6/14/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import -#import "WebViewJavascriptBridgeBase.h" - -#if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_9 || __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_1) -#define supportsWKWebView -#endif - -#if defined supportsWKWebView -#import -#endif - -#if defined __MAC_OS_X_VERSION_MAX_ALLOWED - #define WVJB_PLATFORM_OSX - #define WVJB_WEBVIEW_TYPE WebView - #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject - #define WVJB_WEBVIEW_DELEGATE_INTERFACE NSObject -#elif defined __IPHONE_OS_VERSION_MAX_ALLOWED - #import - #define WVJB_PLATFORM_IOS - #define WVJB_WEBVIEW_TYPE UIWebView - #define WVJB_WEBVIEW_DELEGATE_TYPE NSObject - #define WVJB_WEBVIEW_DELEGATE_INTERFACE NSObject -#endif - -@interface WebViewJavascriptBridge : WVJB_WEBVIEW_DELEGATE_INTERFACE - - -+ (instancetype)bridgeForWebView:(id)webView; -+ (instancetype)bridge:(id)webView; - -+ (void)enableLogging; -+ (void)setLogMaxLength:(int)length; - -- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler; -- (void)removeHandler:(NSString*)handlerName; -- (void)callHandler:(NSString*)handlerName; -- (void)callHandler:(NSString*)handlerName data:(id)data; -- (void)callHandler:(NSString*)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback; -- (void)setWebViewDelegate:(id)webViewDelegate; -- (void)disableJavscriptAlertBoxSafetyTimeout; - -@end diff --git a/AdjustBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.m b/AdjustBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.m deleted file mode 100755 index e74a6e24e..000000000 --- a/AdjustBridge/WebViewJavascriptBridge/WebViewJavascriptBridge.m +++ /dev/null @@ -1,211 +0,0 @@ -// -// WebViewJavascriptBridge.m -// ExampleApp-iOS -// -// Created by Marcus Westin on 6/14/13. -// Copyright (c) 2013 Marcus Westin. All rights reserved. -// - -#import "WebViewJavascriptBridge.h" - -#if defined(supportsWKWebView) -#import "WKWebViewJavascriptBridge.h" -#endif - -#if __has_feature(objc_arc_weak) - #define WVJB_WEAK __weak -#else - #define WVJB_WEAK __unsafe_unretained -#endif - -@implementation WebViewJavascriptBridge { - WVJB_WEAK WVJB_WEBVIEW_TYPE* _webView; - WVJB_WEAK id _webViewDelegate; - long _uniqueId; - WebViewJavascriptBridgeBase *_base; -} - -/* API - *****/ - -+ (void)enableLogging { - [WebViewJavascriptBridgeBase enableLogging]; -} -+ (void)setLogMaxLength:(int)length { - [WebViewJavascriptBridgeBase setLogMaxLength:length]; -} - -+ (instancetype)bridgeForWebView:(id)webView { - return [self bridge:webView]; -} -+ (instancetype)bridge:(id)webView { -#if defined supportsWKWebView - if ([webView isKindOfClass:[WKWebView class]]) { - return (WebViewJavascriptBridge*) [WKWebViewJavascriptBridge bridgeForWebView:webView]; - } -#endif - if ([webView isKindOfClass:[WVJB_WEBVIEW_TYPE class]]) { - WebViewJavascriptBridge* bridge = [[self alloc] init]; - [bridge _platformSpecificSetup:webView]; - return bridge; - } - [NSException raise:@"BadWebViewType" format:@"Unknown web view type."]; - return nil; -} - -- (void)setWebViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate { - _webViewDelegate = webViewDelegate; -} - -- (void)send:(id)data { - [self send:data responseCallback:nil]; -} - -- (void)send:(id)data responseCallback:(WVJBResponseCallback)responseCallback { - [_base sendData:data responseCallback:responseCallback handlerName:nil]; -} - -- (void)callHandler:(NSString *)handlerName { - [self callHandler:handlerName data:nil responseCallback:nil]; -} - -- (void)callHandler:(NSString *)handlerName data:(id)data { - [self callHandler:handlerName data:data responseCallback:nil]; -} - -- (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback { - [_base sendData:data responseCallback:responseCallback handlerName:handlerName]; -} - -- (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler { - _base.messageHandlers[handlerName] = [handler copy]; -} - -- (void)removeHandler:(NSString *)handlerName { - [_base.messageHandlers removeObjectForKey:handlerName]; -} - -- (void)disableJavscriptAlertBoxSafetyTimeout { - [_base disableJavscriptAlertBoxSafetyTimeout]; -} - - -/* Platform agnostic internals - *****************************/ - -- (void)dealloc { - [self _platformSpecificDealloc]; - _base = nil; - _webView = nil; - _webViewDelegate = nil; -} - -- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand { - return [_webView stringByEvaluatingJavaScriptFromString:javascriptCommand]; -} - -#if defined WVJB_PLATFORM_OSX -/* Platform specific internals: OSX - **********************************/ - -- (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView { - _webView = webView; - _webView.policyDelegate = self; - _base = [[WebViewJavascriptBridgeBase alloc] init]; - _base.delegate = self; -} - -- (void) _platformSpecificDealloc { - _webView.policyDelegate = nil; -} - -- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id)listener { - if (webView != _webView) { return; } - - NSURL *url = [request URL]; - if ([_base isWebViewJavascriptBridgeURL:url]) { - if ([_base isBridgeLoadedURL:url]) { - [_base injectJavascriptFile]; - } else if ([_base isQueueMessageURL:url]) { - NSString *messageQueueString = [self _evaluateJavascript:[_base webViewJavascriptFetchQueyCommand]]; - [_base flushMessageQueue:messageQueueString]; - } else { - [_base logUnkownMessage:url]; - } - [listener ignore]; - } else if (_webViewDelegate && [_webViewDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:request:frame:decisionListener:)]) { - [_webViewDelegate webView:webView decidePolicyForNavigationAction:actionInformation request:request frame:frame decisionListener:listener]; - } else { - [listener use]; - } -} - - - -#elif defined WVJB_PLATFORM_IOS -/* Platform specific internals: iOS - **********************************/ - -- (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView { - _webView = webView; - _webView.delegate = self; - _base = [[WebViewJavascriptBridgeBase alloc] init]; - _base.delegate = self; -} - -- (void) _platformSpecificDealloc { - _webView.delegate = nil; -} - -- (void)webViewDidFinishLoad:(UIWebView *)webView { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { - [strongDelegate webViewDidFinishLoad:webView]; - } -} - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { - [strongDelegate webView:webView didFailLoadWithError:error]; - } -} - -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { - if (webView != _webView) { return YES; } - - NSURL *url = [request URL]; - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if ([_base isWebViewJavascriptBridgeURL:url]) { - if ([_base isBridgeLoadedURL:url]) { - [_base injectJavascriptFile]; - } else if ([_base isQueueMessageURL:url]) { - NSString *messageQueueString = [self _evaluateJavascript:[_base webViewJavascriptFetchQueyCommand]]; - [_base flushMessageQueue:messageQueueString]; - } else { - [_base logUnkownMessage:url]; - } - return NO; - } else if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) { - return [strongDelegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; - } else { - return YES; - } -} - -- (void)webViewDidStartLoad:(UIWebView *)webView { - if (webView != _webView) { return; } - - __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; - if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidStartLoad:)]) { - [strongDelegate webViewDidStartLoad:webView]; - } -} - -#endif - -@end diff --git a/AdjustSdkWebBridge/AdjustSdkWebBridge.h b/AdjustSdkWebBridge/AdjustSdkWebBridge.h index 41390f6e3..ccebc3f81 100644 --- a/AdjustSdkWebBridge/AdjustSdkWebBridge.h +++ b/AdjustSdkWebBridge/AdjustSdkWebBridge.h @@ -28,7 +28,6 @@ FOUNDATION_EXPORT const unsigned char AdjustSdkWebBridgeVersionString[]; #import // Exposing entire WebViewJavascriptBridge framework -#import #import #import #import diff --git a/AdjustTests/AdjustUnitTests/ADJPackageFields.m b/AdjustTests/AdjustUnitTests/ADJPackageFields.m index e2947ec32..fe1dcbe3b 100644 --- a/AdjustTests/AdjustUnitTests/ADJPackageFields.m +++ b/AdjustTests/AdjustUnitTests/ADJPackageFields.m @@ -16,7 +16,7 @@ - (id) init { // default values self.appToken = @"qwerty123456"; - self.clientSdk = @"ios4.18.1"; + self.clientSdk = @"ios4.18.2"; self.suffix = @""; self.environment = @"sandbox"; diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp.xcodeproj/project.pbxproj b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp.xcodeproj/project.pbxproj index 0230a01d2..5a6a3867c 100644 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp.xcodeproj/project.pbxproj +++ b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp.xcodeproj/project.pbxproj @@ -7,6 +7,26 @@ objects = { /* Begin PBXBuildFile section */ + 6F6F75A223279D4D00F47E64 /* AdjustBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F759723279D4D00F47E64 /* AdjustBridge.m */; }; + 6F6F75A323279D4D00F47E64 /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F759A23279D4D00F47E64 /* WebViewJavascriptBridgeBase.m */; }; + 6F6F75A423279D4D00F47E64 /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F759B23279D4D00F47E64 /* WKWebViewJavascriptBridge.m */; }; + 6F6F75A523279D4D00F47E64 /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F759E23279D4D00F47E64 /* WebViewJavascriptBridge_JS.m */; }; + 6F6F75A623279D4D00F47E64 /* AdjustBridgeRegister.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75A123279D4D00F47E64 /* AdjustBridgeRegister.m */; }; + 6F6F75CB2327C08B00F47E64 /* ATLTestInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75A82327C08B00F47E64 /* ATLTestInfo.m */; }; + 6F6F75CC2327C08B00F47E64 /* ATLControlWebSocketClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75AD2327C08B00F47E64 /* ATLControlWebSocketClient.m */; }; + 6F6F75CD2327C08B00F47E64 /* ATLUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75B02327C08B00F47E64 /* ATLUtil.m */; }; + 6F6F75CE2327C08B00F47E64 /* ATLControlSignal.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75B12327C08B00F47E64 /* ATLControlSignal.m */; }; + 6F6F75CF2327C08B00F47E64 /* PSWebSocketInflater.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75B32327C08B00F47E64 /* PSWebSocketInflater.m */; }; + 6F6F75D02327C08B00F47E64 /* PSWebSocketDeflater.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75B42327C08B00F47E64 /* PSWebSocketDeflater.m */; }; + 6F6F75D12327C08B00F47E64 /* PSWebSocketUTF8Decoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75B72327C08B00F47E64 /* PSWebSocketUTF8Decoder.m */; }; + 6F6F75D22327C08B00F47E64 /* PSWebSocketDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75BB2327C08B00F47E64 /* PSWebSocketDriver.m */; }; + 6F6F75D32327C08B00F47E64 /* PSWebSocketBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75BC2327C08B00F47E64 /* PSWebSocketBuffer.m */; }; + 6F6F75D42327C08B00F47E64 /* PSWebSocketNetworkThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75C02327C08B00F47E64 /* PSWebSocketNetworkThread.m */; }; + 6F6F75D52327C08B00F47E64 /* PSWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75C32327C08B00F47E64 /* PSWebSocket.m */; }; + 6F6F75D62327C08B00F47E64 /* PSWebSocketServer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75C52327C08B00F47E64 /* PSWebSocketServer.m */; }; + 6F6F75D72327C08B00F47E64 /* ATLUtilNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75C72327C08B00F47E64 /* ATLUtilNetworking.m */; }; + 6F6F75D82327C08B00F47E64 /* ATLTestLibrary.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75C92327C08B00F47E64 /* ATLTestLibrary.m */; }; + 6F6F75D92327C08B00F47E64 /* ATLBlockingQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F6F75CA2327C08B00F47E64 /* ATLBlockingQueue.m */; }; 6F7AF62B211878BA00F730B2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF62A211878BA00F730B2 /* AppDelegate.m */; }; 6F7AF631211878BA00F730B2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6F7AF62F211878BA00F730B2 /* Main.storyboard */; }; 6F7AF633211878BC00F730B2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6F7AF632211878BC00F730B2 /* Assets.xcassets */; }; @@ -45,19 +65,6 @@ 6F7AF74F21187CFF00F730B2 /* ADJUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF72921187CFE00F730B2 /* ADJUserDefaults.m */; }; 6F7AF75121187CFF00F730B2 /* ADJActivityHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF72F21187CFF00F730B2 /* ADJActivityHandler.m */; }; 6F7AF75221187CFF00F730B2 /* ADJReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF73021187CFF00F730B2 /* ADJReachability.m */; }; - 6F7AF76321187D0500F730B2 /* AdjustBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF75421187D0500F730B2 /* AdjustBridge.m */; }; - 6F7AF76421187D0500F730B2 /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF75721187D0500F730B2 /* WebViewJavascriptBridgeBase.m */; }; - 6F7AF76621187D0500F730B2 /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF75921187D0500F730B2 /* WKWebViewJavascriptBridge.m */; }; - 6F7AF76721187D0500F730B2 /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF75A21187D0500F730B2 /* WebViewJavascriptBridge.m */; }; - 6F7AF76821187D0500F730B2 /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF75E21187D0500F730B2 /* WebViewJavascriptBridge_JS.m */; }; - 6F7AF76921187D0500F730B2 /* AdjustBridgeRegister.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF76221187D0500F730B2 /* AdjustBridgeRegister.m */; }; - 6F7AF77821187D1C00F730B2 /* ATLTestInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF76B21187D1C00F730B2 /* ATLTestInfo.m */; }; - 6F7AF77921187D1C00F730B2 /* ATLUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF77221187D1C00F730B2 /* ATLUtil.m */; }; - 6F7AF77A21187D1C00F730B2 /* ATLControlChannel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF77421187D1C00F730B2 /* ATLControlChannel.m */; }; - 6F7AF77B21187D1C00F730B2 /* ATLUtilNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF77521187D1C00F730B2 /* ATLUtilNetworking.m */; }; - 6F7AF77C21187D1C00F730B2 /* ATLTestLibrary.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF77621187D1C00F730B2 /* ATLTestLibrary.m */; }; - 6F7AF77D21187D1C00F730B2 /* ATLBlockingQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF77721187D1C00F730B2 /* ATLBlockingQueue.m */; }; - 6F7AF78821187EA400F730B2 /* UIWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF78721187EA400F730B2 /* UIWebViewController.m */; }; 6F7AF78B21187EC500F730B2 /* WKWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF78A21187EC500F730B2 /* WKWebViewController.m */; }; 6F7AF78D2118808400F730B2 /* AdjustTestApp-WebView.html in Resources */ = {isa = PBXBuildFile; fileRef = 6F7AF78C2118808300F730B2 /* AdjustTestApp-WebView.html */; }; 6F7AF790211888B500F730B2 /* TestLibraryBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F7AF78F211888B500F730B2 /* TestLibraryBridge.m */; }; @@ -70,6 +77,50 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 6F6F759723279D4D00F47E64 /* AdjustBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustBridge.m; sourceTree = ""; }; + 6F6F759823279D4D00F47E64 /* AdjustBridgeRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustBridgeRegister.h; sourceTree = ""; }; + 6F6F759A23279D4D00F47E64 /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridgeBase.m; sourceTree = ""; }; + 6F6F759B23279D4D00F47E64 /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJavascriptBridge.m; sourceTree = ""; }; + 6F6F759C23279D4D00F47E64 /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = ""; }; + 6F6F759D23279D4D00F47E64 /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = ""; }; + 6F6F759E23279D4D00F47E64 /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = ""; }; + 6F6F759F23279D4D00F47E64 /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewJavascriptBridge.h; sourceTree = ""; }; + 6F6F75A023279D4D00F47E64 /* AdjustBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustBridge.h; sourceTree = ""; }; + 6F6F75A123279D4D00F47E64 /* AdjustBridgeRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustBridgeRegister.m; sourceTree = ""; }; + 6F6F75A82327C08B00F47E64 /* ATLTestInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLTestInfo.m; sourceTree = ""; }; + 6F6F75A92327C08B00F47E64 /* ATLControlSignal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLControlSignal.h; sourceTree = ""; }; + 6F6F75AA2327C08B00F47E64 /* ATLUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLUtil.h; sourceTree = ""; }; + 6F6F75AB2327C08B00F47E64 /* ATLConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLConstants.h; sourceTree = ""; }; + 6F6F75AC2327C08B00F47E64 /* ATLTestLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLTestLibrary.h; sourceTree = ""; }; + 6F6F75AD2327C08B00F47E64 /* ATLControlWebSocketClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLControlWebSocketClient.m; sourceTree = ""; }; + 6F6F75AE2327C08B00F47E64 /* ATLUtilNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLUtilNetworking.h; sourceTree = ""; }; + 6F6F75AF2327C08B00F47E64 /* ATLBlockingQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLBlockingQueue.h; sourceTree = ""; }; + 6F6F75B02327C08B00F47E64 /* ATLUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLUtil.m; sourceTree = ""; }; + 6F6F75B12327C08B00F47E64 /* ATLControlSignal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLControlSignal.m; sourceTree = ""; }; + 6F6F75B32327C08B00F47E64 /* PSWebSocketInflater.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocketInflater.m; sourceTree = ""; }; + 6F6F75B42327C08B00F47E64 /* PSWebSocketDeflater.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocketDeflater.m; sourceTree = ""; }; + 6F6F75B52327C08B00F47E64 /* PSWebSocketBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketBuffer.h; sourceTree = ""; }; + 6F6F75B62327C08B00F47E64 /* PSWebSocketNetworkThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketNetworkThread.h; sourceTree = ""; }; + 6F6F75B72327C08B00F47E64 /* PSWebSocketUTF8Decoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocketUTF8Decoder.m; sourceTree = ""; }; + 6F6F75B82327C08B00F47E64 /* PSWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocket.h; sourceTree = ""; }; + 6F6F75B92327C08B00F47E64 /* PSWebSocketInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketInternal.h; sourceTree = ""; }; + 6F6F75BA2327C08B00F47E64 /* PSWebSocketServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketServer.h; sourceTree = ""; }; + 6F6F75BB2327C08B00F47E64 /* PSWebSocketDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocketDriver.m; sourceTree = ""; }; + 6F6F75BC2327C08B00F47E64 /* PSWebSocketBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocketBuffer.m; sourceTree = ""; }; + 6F6F75BD2327C08B00F47E64 /* PSWebSocketDeflater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketDeflater.h; sourceTree = ""; }; + 6F6F75BE2327C08B00F47E64 /* PSWebSocketInflater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketInflater.h; sourceTree = ""; }; + 6F6F75BF2327C08B00F47E64 /* PSWebSocketUTF8Decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketUTF8Decoder.h; sourceTree = ""; }; + 6F6F75C02327C08B00F47E64 /* PSWebSocketNetworkThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocketNetworkThread.m; sourceTree = ""; }; + 6F6F75C12327C08B00F47E64 /* PSWebSocketTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketTypes.h; sourceTree = ""; }; + 6F6F75C22327C08B00F47E64 /* PocketSocket-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PocketSocket-Prefix.pch"; sourceTree = ""; }; + 6F6F75C32327C08B00F47E64 /* PSWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocket.m; sourceTree = ""; }; + 6F6F75C42327C08B00F47E64 /* PSWebSocketDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PSWebSocketDriver.h; sourceTree = ""; }; + 6F6F75C52327C08B00F47E64 /* PSWebSocketServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSWebSocketServer.m; sourceTree = ""; }; + 6F6F75C62327C08B00F47E64 /* ATLTestInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLTestInfo.h; sourceTree = ""; }; + 6F6F75C72327C08B00F47E64 /* ATLUtilNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLUtilNetworking.m; sourceTree = ""; }; + 6F6F75C82327C08B00F47E64 /* ATLControlWebSocketClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLControlWebSocketClient.h; sourceTree = ""; }; + 6F6F75C92327C08B00F47E64 /* ATLTestLibrary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLTestLibrary.m; sourceTree = ""; }; + 6F6F75CA2327C08B00F47E64 /* ATLBlockingQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLBlockingQueue.m; sourceTree = ""; }; 6F7AF626211878B900F730B2 /* AdjustWebBridgeTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AdjustWebBridgeTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6F7AF629211878BA00F730B2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 6F7AF62A211878BA00F730B2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -144,33 +195,6 @@ 6F7AF72E21187CFF00F730B2 /* ADJTimerCycle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ADJTimerCycle.h; sourceTree = ""; }; 6F7AF72F21187CFF00F730B2 /* ADJActivityHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJActivityHandler.m; sourceTree = ""; }; 6F7AF73021187CFF00F730B2 /* ADJReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ADJReachability.m; sourceTree = ""; }; - 6F7AF75421187D0500F730B2 /* AdjustBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustBridge.m; sourceTree = ""; }; - 6F7AF75521187D0500F730B2 /* AdjustBridgeRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustBridgeRegister.h; sourceTree = ""; }; - 6F7AF75721187D0500F730B2 /* WebViewJavascriptBridgeBase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridgeBase.m; sourceTree = ""; }; - 6F7AF75921187D0500F730B2 /* WKWebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WKWebViewJavascriptBridge.m; sourceTree = ""; }; - 6F7AF75A21187D0500F730B2 /* WebViewJavascriptBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge.m; sourceTree = ""; }; - 6F7AF75B21187D0500F730B2 /* WebViewJavascriptBridge_JS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge_JS.h; sourceTree = ""; }; - 6F7AF75C21187D0500F730B2 /* WebViewJavascriptBridgeBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridgeBase.h; sourceTree = ""; }; - 6F7AF75E21187D0500F730B2 /* WebViewJavascriptBridge_JS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebViewJavascriptBridge_JS.m; sourceTree = ""; }; - 6F7AF75F21187D0500F730B2 /* WebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewJavascriptBridge.h; sourceTree = ""; }; - 6F7AF76021187D0500F730B2 /* WKWebViewJavascriptBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewJavascriptBridge.h; sourceTree = ""; }; - 6F7AF76121187D0500F730B2 /* AdjustBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdjustBridge.h; sourceTree = ""; }; - 6F7AF76221187D0500F730B2 /* AdjustBridgeRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustBridgeRegister.m; sourceTree = ""; }; - 6F7AF76B21187D1C00F730B2 /* ATLTestInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLTestInfo.m; sourceTree = ""; }; - 6F7AF76C21187D1C00F730B2 /* ATLUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLUtil.h; sourceTree = ""; }; - 6F7AF76D21187D1C00F730B2 /* ATLControlChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLControlChannel.h; sourceTree = ""; }; - 6F7AF76E21187D1C00F730B2 /* ATLConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLConstants.h; sourceTree = ""; }; - 6F7AF76F21187D1C00F730B2 /* ATLTestLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLTestLibrary.h; sourceTree = ""; }; - 6F7AF77021187D1C00F730B2 /* ATLUtilNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLUtilNetworking.h; sourceTree = ""; }; - 6F7AF77121187D1C00F730B2 /* ATLBlockingQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLBlockingQueue.h; sourceTree = ""; }; - 6F7AF77221187D1C00F730B2 /* ATLUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLUtil.m; sourceTree = ""; }; - 6F7AF77321187D1C00F730B2 /* ATLTestInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATLTestInfo.h; sourceTree = ""; }; - 6F7AF77421187D1C00F730B2 /* ATLControlChannel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLControlChannel.m; sourceTree = ""; }; - 6F7AF77521187D1C00F730B2 /* ATLUtilNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLUtilNetworking.m; sourceTree = ""; }; - 6F7AF77621187D1C00F730B2 /* ATLTestLibrary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLTestLibrary.m; sourceTree = ""; }; - 6F7AF77721187D1C00F730B2 /* ATLBlockingQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ATLBlockingQueue.m; sourceTree = ""; }; - 6F7AF78621187EA400F730B2 /* UIWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIWebViewController.h; sourceTree = ""; }; - 6F7AF78721187EA400F730B2 /* UIWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIWebViewController.m; sourceTree = ""; }; 6F7AF78921187EC500F730B2 /* WKWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKWebViewController.h; sourceTree = ""; }; 6F7AF78A21187EC500F730B2 /* WKWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WKWebViewController.m; sourceTree = ""; }; 6F7AF78C2118808300F730B2 /* AdjustTestApp-WebView.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "AdjustTestApp-WebView.html"; sourceTree = ""; }; @@ -200,6 +224,82 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6F6F759623279D4D00F47E64 /* AdjustBridge */ = { + isa = PBXGroup; + children = ( + 6F6F759723279D4D00F47E64 /* AdjustBridge.m */, + 6F6F759823279D4D00F47E64 /* AdjustBridgeRegister.h */, + 6F6F759923279D4D00F47E64 /* WebViewJavascriptBridge */, + 6F6F75A023279D4D00F47E64 /* AdjustBridge.h */, + 6F6F75A123279D4D00F47E64 /* AdjustBridgeRegister.m */, + ); + name = AdjustBridge; + path = ../../../AdjustBridge; + sourceTree = ""; + }; + 6F6F759923279D4D00F47E64 /* WebViewJavascriptBridge */ = { + isa = PBXGroup; + children = ( + 6F6F759A23279D4D00F47E64 /* WebViewJavascriptBridgeBase.m */, + 6F6F759B23279D4D00F47E64 /* WKWebViewJavascriptBridge.m */, + 6F6F759C23279D4D00F47E64 /* WebViewJavascriptBridge_JS.h */, + 6F6F759D23279D4D00F47E64 /* WebViewJavascriptBridgeBase.h */, + 6F6F759E23279D4D00F47E64 /* WebViewJavascriptBridge_JS.m */, + 6F6F759F23279D4D00F47E64 /* WKWebViewJavascriptBridge.h */, + ); + path = WebViewJavascriptBridge; + sourceTree = ""; + }; + 6F6F75A72327C08B00F47E64 /* AdjustTestLibrary */ = { + isa = PBXGroup; + children = ( + 6F6F75A82327C08B00F47E64 /* ATLTestInfo.m */, + 6F6F75A92327C08B00F47E64 /* ATLControlSignal.h */, + 6F6F75AA2327C08B00F47E64 /* ATLUtil.h */, + 6F6F75AB2327C08B00F47E64 /* ATLConstants.h */, + 6F6F75AC2327C08B00F47E64 /* ATLTestLibrary.h */, + 6F6F75AD2327C08B00F47E64 /* ATLControlWebSocketClient.m */, + 6F6F75AE2327C08B00F47E64 /* ATLUtilNetworking.h */, + 6F6F75AF2327C08B00F47E64 /* ATLBlockingQueue.h */, + 6F6F75B02327C08B00F47E64 /* ATLUtil.m */, + 6F6F75B12327C08B00F47E64 /* ATLControlSignal.m */, + 6F6F75B22327C08B00F47E64 /* PocketSocket */, + 6F6F75C62327C08B00F47E64 /* ATLTestInfo.h */, + 6F6F75C72327C08B00F47E64 /* ATLUtilNetworking.m */, + 6F6F75C82327C08B00F47E64 /* ATLControlWebSocketClient.h */, + 6F6F75C92327C08B00F47E64 /* ATLTestLibrary.m */, + 6F6F75CA2327C08B00F47E64 /* ATLBlockingQueue.m */, + ); + name = AdjustTestLibrary; + path = ../../AdjustTestLibrary/AdjustTestLibrary; + sourceTree = ""; + }; + 6F6F75B22327C08B00F47E64 /* PocketSocket */ = { + isa = PBXGroup; + children = ( + 6F6F75B32327C08B00F47E64 /* PSWebSocketInflater.m */, + 6F6F75B42327C08B00F47E64 /* PSWebSocketDeflater.m */, + 6F6F75B52327C08B00F47E64 /* PSWebSocketBuffer.h */, + 6F6F75B62327C08B00F47E64 /* PSWebSocketNetworkThread.h */, + 6F6F75B72327C08B00F47E64 /* PSWebSocketUTF8Decoder.m */, + 6F6F75B82327C08B00F47E64 /* PSWebSocket.h */, + 6F6F75B92327C08B00F47E64 /* PSWebSocketInternal.h */, + 6F6F75BA2327C08B00F47E64 /* PSWebSocketServer.h */, + 6F6F75BB2327C08B00F47E64 /* PSWebSocketDriver.m */, + 6F6F75BC2327C08B00F47E64 /* PSWebSocketBuffer.m */, + 6F6F75BD2327C08B00F47E64 /* PSWebSocketDeflater.h */, + 6F6F75BE2327C08B00F47E64 /* PSWebSocketInflater.h */, + 6F6F75BF2327C08B00F47E64 /* PSWebSocketUTF8Decoder.h */, + 6F6F75C02327C08B00F47E64 /* PSWebSocketNetworkThread.m */, + 6F6F75C12327C08B00F47E64 /* PSWebSocketTypes.h */, + 6F6F75C22327C08B00F47E64 /* PocketSocket-Prefix.pch */, + 6F6F75C32327C08B00F47E64 /* PSWebSocket.m */, + 6F6F75C42327C08B00F47E64 /* PSWebSocketDriver.h */, + 6F6F75C52327C08B00F47E64 /* PSWebSocketServer.m */, + ); + path = PocketSocket; + sourceTree = ""; + }; 6F7AF61D211878B900F730B2 = { isa = PBXGroup; children = ( @@ -225,8 +325,6 @@ 6F7AF7AF2118949C00F730B2 /* TestLibraryBridge.js */, 6F7AF78E211888B500F730B2 /* TestLibraryBridge.h */, 6F7AF78F211888B500F730B2 /* TestLibraryBridge.m */, - 6F7AF78621187EA400F730B2 /* UIWebViewController.h */, - 6F7AF78721187EA400F730B2 /* UIWebViewController.m */, 6F7AF78921187EC500F730B2 /* WKWebViewController.h */, 6F7AF78A21187EC500F730B2 /* WKWebViewController.m */, 6F7AF78C2118808300F730B2 /* AdjustTestApp-WebView.html */, @@ -235,9 +333,9 @@ 6F7AF632211878BC00F730B2 /* Assets.xcassets */, 6F7AF62F211878BA00F730B2 /* Main.storyboard */, 6F7AF634211878BC00F730B2 /* LaunchScreen.storyboard */, + 6F6F75A72327C08B00F47E64 /* AdjustTestLibrary */, + 6F6F759623279D4D00F47E64 /* AdjustBridge */, 6F7AF6EC21187CFE00F730B2 /* Adjust */, - 6F7AF75321187D0500F730B2 /* AdjustBridge */, - 6F7AF76A21187D1C00F730B2 /* AdjustTestLibrary */, ); path = AdjustWebBridgeTestApp; sourceTree = ""; @@ -324,55 +422,6 @@ path = ADJAdditions; sourceTree = ""; }; - 6F7AF75321187D0500F730B2 /* AdjustBridge */ = { - isa = PBXGroup; - children = ( - 6F7AF76121187D0500F730B2 /* AdjustBridge.h */, - 6F7AF75421187D0500F730B2 /* AdjustBridge.m */, - 6F7AF75521187D0500F730B2 /* AdjustBridgeRegister.h */, - 6F7AF76221187D0500F730B2 /* AdjustBridgeRegister.m */, - 6F7AF75621187D0500F730B2 /* WebViewJavascriptBridge */, - ); - name = AdjustBridge; - path = ../../../AdjustBridge; - sourceTree = ""; - }; - 6F7AF75621187D0500F730B2 /* WebViewJavascriptBridge */ = { - isa = PBXGroup; - children = ( - 6F7AF75721187D0500F730B2 /* WebViewJavascriptBridgeBase.m */, - 6F7AF75921187D0500F730B2 /* WKWebViewJavascriptBridge.m */, - 6F7AF75A21187D0500F730B2 /* WebViewJavascriptBridge.m */, - 6F7AF75B21187D0500F730B2 /* WebViewJavascriptBridge_JS.h */, - 6F7AF75C21187D0500F730B2 /* WebViewJavascriptBridgeBase.h */, - 6F7AF75E21187D0500F730B2 /* WebViewJavascriptBridge_JS.m */, - 6F7AF75F21187D0500F730B2 /* WebViewJavascriptBridge.h */, - 6F7AF76021187D0500F730B2 /* WKWebViewJavascriptBridge.h */, - ); - path = WebViewJavascriptBridge; - sourceTree = ""; - }; - 6F7AF76A21187D1C00F730B2 /* AdjustTestLibrary */ = { - isa = PBXGroup; - children = ( - 6F7AF76B21187D1C00F730B2 /* ATLTestInfo.m */, - 6F7AF76C21187D1C00F730B2 /* ATLUtil.h */, - 6F7AF76D21187D1C00F730B2 /* ATLControlChannel.h */, - 6F7AF76E21187D1C00F730B2 /* ATLConstants.h */, - 6F7AF76F21187D1C00F730B2 /* ATLTestLibrary.h */, - 6F7AF77021187D1C00F730B2 /* ATLUtilNetworking.h */, - 6F7AF77121187D1C00F730B2 /* ATLBlockingQueue.h */, - 6F7AF77221187D1C00F730B2 /* ATLUtil.m */, - 6F7AF77321187D1C00F730B2 /* ATLTestInfo.h */, - 6F7AF77421187D1C00F730B2 /* ATLControlChannel.m */, - 6F7AF77521187D1C00F730B2 /* ATLUtilNetworking.m */, - 6F7AF77621187D1C00F730B2 /* ATLTestLibrary.m */, - 6F7AF77721187D1C00F730B2 /* ATLBlockingQueue.m */, - ); - name = AdjustTestLibrary; - path = ../../AdjustTestLibrary/AdjustTestLibrary; - sourceTree = ""; - }; 6F7AF7B92118992200F730B2 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -459,54 +508,61 @@ files = ( 6F7AF73621187CFF00F730B2 /* ADJSdkClickHandler.m in Sources */, 6F7AF74C21187CFF00F730B2 /* ADJAdjustFactory.m in Sources */, + 6F6F75CC2327C08B00F47E64 /* ATLControlWebSocketClient.m in Sources */, + 6F6F75A623279D4D00F47E64 /* AdjustBridgeRegister.m in Sources */, 6F7AF74721187CFF00F730B2 /* UIDevice+ADJAdditions.m in Sources */, 6F7AF790211888B500F730B2 /* TestLibraryBridge.m in Sources */, 6F7AF74D21187CFF00F730B2 /* ADJResponseData.m in Sources */, - 6F7AF77D21187D1C00F730B2 /* ATLBlockingQueue.m in Sources */, 6F7AF73221187CFF00F730B2 /* ADJTimerOnce.m in Sources */, 6F7AF74521187CFF00F730B2 /* NSString+ADJAdditions.m in Sources */, + 6F6F75CD2327C08B00F47E64 /* ATLUtil.m in Sources */, 6F7AF73821187CFF00F730B2 /* ADJSessionSuccess.m in Sources */, 6F7AF74E21187CFF00F730B2 /* ADJPackageBuilder.m in Sources */, - 6F7AF77921187D1C00F730B2 /* ATLUtil.m in Sources */, + 6F6F75D22327C08B00F47E64 /* PSWebSocketDriver.m in Sources */, 6F7AF74021187CFF00F730B2 /* ADJBackoffStrategy.m in Sources */, + 6F6F75D92327C08B00F47E64 /* ATLBlockingQueue.m in Sources */, 6F7AF73421187CFF00F730B2 /* ADJRequestHandler.m in Sources */, - 6F7AF78821187EA400F730B2 /* UIWebViewController.m in Sources */, 6F7AF73721187CFF00F730B2 /* ADJEvent.m in Sources */, 6F7AF74621187CFF00F730B2 /* NSData+ADJAdditions.m in Sources */, + 6F6F75D82327C08B00F47E64 /* ATLTestLibrary.m in Sources */, + 6F6F75D42327C08B00F47E64 /* PSWebSocketNetworkThread.m in Sources */, 6F7AF74321187CFF00F730B2 /* ADJPackageHandler.m in Sources */, + 6F6F75D02327C08B00F47E64 /* PSWebSocketDeflater.m in Sources */, + 6F6F75A323279D4D00F47E64 /* WebViewJavascriptBridgeBase.m in Sources */, 6F7AF73A21187CFF00F730B2 /* ADJEventSuccess.m in Sources */, 6F7AF74A21187CFF00F730B2 /* ADJActivityPackage.m in Sources */, 6F7AF75221187CFF00F730B2 /* ADJReachability.m in Sources */, 6F7AF74421187CFF00F730B2 /* ADJActivityKind.m in Sources */, 6F7AF73521187CFF00F730B2 /* ADJKeychain.m in Sources */, 6F7AF74921187CFF00F730B2 /* ADJSystemProfile.m in Sources */, + 6F6F75D62327C08B00F47E64 /* PSWebSocketServer.m in Sources */, 6F7AF73B21187CFF00F730B2 /* ADJActivityState.m in Sources */, - 6F7AF76621187D0500F730B2 /* WKWebViewJavascriptBridge.m in Sources */, 6F7AF73F21187CFF00F730B2 /* ADJLogger.m in Sources */, 6F7AF78B21187EC500F730B2 /* WKWebViewController.m in Sources */, 6F7AF73121187CFF00F730B2 /* ADJDeviceInfo.m in Sources */, 6F7AF73D21187CFF00F730B2 /* ADJTimerCycle.m in Sources */, + 6F6F75CF2327C08B00F47E64 /* PSWebSocketInflater.m in Sources */, + 6F6F75A523279D4D00F47E64 /* WebViewJavascriptBridge_JS.m in Sources */, 6F7AF639211878BC00F730B2 /* main.m in Sources */, 6F7AF74121187CFF00F730B2 /* Adjust.m in Sources */, + 6F6F75A223279D4D00F47E64 /* AdjustBridge.m in Sources */, + 6F6F75D32327C08B00F47E64 /* PSWebSocketBuffer.m in Sources */, 6F7AF74821187CFF00F730B2 /* ADJAttribution.m in Sources */, + 6F6F75D72327C08B00F47E64 /* ATLUtilNetworking.m in Sources */, 6F7AF73C21187CFF00F730B2 /* ADJSessionFailure.m in Sources */, - 6F7AF77821187D1C00F730B2 /* ATLTestInfo.m in Sources */, + 6F6F75D12327C08B00F47E64 /* PSWebSocketUTF8Decoder.m in Sources */, 6F7AF74221187CFF00F730B2 /* ADJConfig.m in Sources */, 6F7AF74F21187CFF00F730B2 /* ADJUserDefaults.m in Sources */, - 6F7AF77C21187D1C00F730B2 /* ATLTestLibrary.m in Sources */, - 6F7AF77A21187D1C00F730B2 /* ATLControlChannel.m in Sources */, - 6F7AF77B21187D1C00F730B2 /* ATLUtilNetworking.m in Sources */, - 6F7AF76921187D0500F730B2 /* AdjustBridgeRegister.m in Sources */, 6F7AF74B21187CFF00F730B2 /* ADJUtil.m in Sources */, + 6F6F75D52327C08B00F47E64 /* PSWebSocket.m in Sources */, + 6F6F75CB2327C08B00F47E64 /* ATLTestInfo.m in Sources */, 6F7AF73921187CFF00F730B2 /* ADJEventFailure.m in Sources */, - 6F7AF76721187D0500F730B2 /* WebViewJavascriptBridge.m in Sources */, 6F7AF73321187CFF00F730B2 /* ADJAttributionHandler.m in Sources */, + 6F6F75CE2327C08B00F47E64 /* ATLControlSignal.m in Sources */, + 6F6F75A423279D4D00F47E64 /* WKWebViewJavascriptBridge.m in Sources */, 6F7AF62B211878BA00F730B2 /* AppDelegate.m in Sources */, 6F7AF75121187CFF00F730B2 /* ADJActivityHandler.m in Sources */, - 6F7AF76821187D0500F730B2 /* WebViewJavascriptBridge_JS.m in Sources */, 6F7AF73E21187CFF00F730B2 /* ADJSessionParameters.m in Sources */, - 6F7AF76421187D0500F730B2 /* WebViewJavascriptBridgeBase.m in Sources */, - 6F7AF76321187D0500F730B2 /* AdjustBridge.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AppDelegate.m b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AppDelegate.m index 5178c6100..0c0b14f4d 100644 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AppDelegate.m +++ b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AppDelegate.m @@ -7,26 +7,17 @@ // #import "AppDelegate.h" -#import "UIWebViewController.h" #import "WKWebViewController.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // 1. Create the UIWebView example - UIWebViewController *uiWebViewExampleController = [[UIWebViewController alloc] init]; - uiWebViewExampleController.tabBarItem.title = @"UIWebView"; - // 2. Create the tab footer and add the UIWebView example UITabBarController *tabBarController = [[UITabBarController alloc] init]; - [tabBarController addChildViewController:uiWebViewExampleController]; - - // 3. Create the WKWebView example for devices >= iOS 8 - if ([WKWebView class]) { - WKWebViewController *wkWebViewExampleController = [[WKWebViewController alloc] init]; - wkWebViewExampleController.tabBarItem.title = @"WKWebView"; - [tabBarController addChildViewController:wkWebViewExampleController]; - } + + WKWebViewController *wkWebViewExampleController = [[WKWebViewController alloc] init]; + wkWebViewExampleController.tabBarItem.title = @"WKWebView"; + [tabBarController addChildViewController:wkWebViewExampleController]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = tabBarController; diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.h b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.h index b3cc5bd0e..91120da56 100644 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.h +++ b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.h @@ -12,6 +12,7 @@ static NSString * baseUrl = @"http://127.0.0.1:8080"; static NSString * gdprUrl = @"http://127.0.0.1:8080"; +static NSString * controlUrl = @"ws://127.0.0.1:1987"; @interface TestLibraryBridge : NSObject diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.m b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.m index a73ac817d..6d3ab136f 100644 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.m +++ b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.m @@ -25,6 +25,7 @@ - (id)initWithAdjustBridgeRegister:(AdjustBridgeRegister *)adjustBridgeRegister } self.testLibrary = [ATLTestLibrary testLibraryWithBaseUrl:baseUrl + andControlUrl:controlUrl andCommandDelegate:self]; [adjustBridgeRegister registerHandler:@"adjustTLB_startTestSession" handler:^(id data, WVJBResponseCallback responseCallback) { diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.h b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.h deleted file mode 100644 index 6897c6da4..000000000 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// UIWebViewController.h -// AdjustWebBridgeTestApp -// -// Created by Pedro Silva (@nonelse) on 6th August 2018. -// Copyright © 2018 Adjust GmbH. All rights reserved. -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UIWebViewController : UINavigationController - -@end - -NS_ASSUME_NONNULL_END diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.m b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.m deleted file mode 100644 index 60088002d..000000000 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/UIWebViewController.m +++ /dev/null @@ -1,50 +0,0 @@ -// -// UIWebViewController.m -// AdjustWebBridgeTestApp -// -// Created by Pedro Silva (@nonelse) on 6th August 2018. -// Copyright © 2018 Adjust GmbH. All rights reserved. -// - -#import "AdjustBridge.h" -#import "TestLibraryBridge.h" -#import "UIWebViewController.h" -#import "WebViewJavascriptBridge.h" -#import - -@interface UIWebViewController () - -@property JSContext *jsContext; -@property AdjustBridge *adjustBridge; -@property WebViewJavascriptBridge *bridge; -@property TestLibraryBridge *testLibraryBridge; - -@end - -@implementation UIWebViewController - -- (void)viewWillAppear:(BOOL)animated { - if (_bridge) { - return; - } - - UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - [self.view addSubview:webView]; - - self.adjustBridge = [[AdjustBridge alloc] init]; - [self.adjustBridge loadUIWebViewBridge:webView webViewDelegate:self]; - - _jsContext = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; - _jsContext[@"console"][@"log"] = ^(JSValue *msg) { - NSLog(@"JavaScript %@ log message: %@", [JSContext currentContext], msg); - }; - - self.testLibraryBridge = [[TestLibraryBridge alloc] initWithAdjustBridgeRegister:[self.adjustBridge bridgeRegister]]; - - NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"AdjustTestApp-WebView" ofType:@"html"]; - NSString *appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil]; - NSURL *baseURL = [NSURL fileURLWithPath:htmlPath]; - [webView loadHTMLString:appHtml baseURL:baseURL]; -} - -@end diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/WKWebViewController.m b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/WKWebViewController.m index 40f6c4dbf..efc0477a9 100644 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/WKWebViewController.m +++ b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/WKWebViewController.m @@ -7,36 +7,35 @@ // #import "WKWebViewController.h" -#import "WebViewJavascriptBridge.h" +#import + +#import "AdjustBridge.h" +#import "TestLibraryBridge.h" + @interface WKWebViewController () -@property WebViewJavascriptBridge *bridge; +@property AdjustBridge *adjustBridge; +@property TestLibraryBridge *testLibraryBridge; @end @implementation WKWebViewController - (void)viewWillAppear:(BOOL)animated { - if (_bridge) { - return; - } - WKWebView *webView = [[NSClassFromString(@"WKWebView") alloc] initWithFrame:self.view.bounds]; webView.navigationDelegate = self; [self.view addSubview:webView]; - [WebViewJavascriptBridge enableLogging]; - _bridge = [WebViewJavascriptBridge bridgeForWebView:webView]; - [_bridge setWebViewDelegate:self]; - [_bridge registerHandler:@"testObjcCallback" handler:^(id data, WVJBResponseCallback responseCallback) { - NSLog(@"testObjcCallback called: %@", data); - responseCallback(@"Response from testObjcCallback"); - }]; - [_bridge callHandler:@"testJavascriptHandler" data:@{ @"foo":@"before ready" }]; + _adjustBridge = [[AdjustBridge alloc] init]; + [_adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:self]; - [self renderButtons:webView]; - [self loadExamplePage:webView]; + self.testLibraryBridge = [[TestLibraryBridge alloc] initWithAdjustBridgeRegister:[self.adjustBridge bridgeRegister]]; + + NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"AdjustTestApp-WebView" ofType:@"html"]; + NSString *appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil]; + NSURL *baseURL = [NSURL fileURLWithPath:htmlPath]; + [webView loadHTMLString:appHtml baseURL:baseURL]; } - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { @@ -47,36 +46,4 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat NSLog(@"webViewDidFinishLoad"); } -- (void)renderButtons:(WKWebView *)webView { - UIFont *font = [UIFont fontWithName:@"HelveticaNeue" size:12.0]; - - UIButton *callbackButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [callbackButton setTitle:@"Call handler" forState:UIControlStateNormal]; - [callbackButton addTarget:self action:@selector(callHandler:) forControlEvents:UIControlEventTouchUpInside]; - [self.view insertSubview:callbackButton aboveSubview:webView]; - callbackButton.frame = CGRectMake(10, 400, 100, 35); - callbackButton.titleLabel.font = font; - - UIButton *reloadButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [reloadButton setTitle:@"Reload webview" forState:UIControlStateNormal]; - [reloadButton addTarget:webView action:@selector(reload) forControlEvents:UIControlEventTouchUpInside]; - [self.view insertSubview:reloadButton aboveSubview:webView]; - reloadButton.frame = CGRectMake(110, 400, 100, 35); - reloadButton.titleLabel.font = font; -} - -- (void)callHandler:(id)sender { - id data = @{ @"greetingFromObjC": @"Hi there, JS!" }; - [_bridge callHandler:@"testJavascriptHandler" data:data responseCallback:^(id response) { - NSLog(@"testJavascriptHandler responded: %@", response); - }]; -} - -- (void)loadExamplePage:(WKWebView *)webView { - NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"AdjustTestApp-WebView" ofType:@"html"]; - NSString *appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil]; - NSURL *baseURL = [NSURL fileURLWithPath:htmlPath]; - [webView loadHTMLString:appHtml baseURL:baseURL]; -} - @end diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a8b51505..2cc8e075f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### Version 4.18.2 (11th September 2019) +#### Changed +- Removed methods from Adjust SDK web view bridge which are dealing with `UIWebView` objects to address `ITMS-90809`. Please, check web views [migration guide](doc/english/web_view_migration.md) to see how to migrate to `v4.18.2` and also check our [web view example app](examples/AdjustExample-WebView) to see how current Adjust web view SDK should be implemented. +- Replaced deprecated API for better iOS 13 compatibility. + +--- + ### Version 4.18.1 (2nd September 2019) #### Fixed - Fixed device token parsing to string, changed in iOS 13. diff --git a/README.md b/README.md index c8926ff66..ce83534c3 100644 --- a/README.md +++ b/README.md @@ -73,13 +73,13 @@ We will describe the steps to integrate the Adjust SDK into your iOS project. We 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.18.1' +pod 'Adjust', '~> 4.18.2' ``` or: ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.1' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.2' ``` --- diff --git a/VERSION b/VERSION index cc84ce743..8c8da9f4e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.18.1 +4.18.2 diff --git a/doc/chinese/README.md b/doc/chinese/README.md index fb59cf306..5548b0d26 100644 --- a/doc/chinese/README.md +++ b/doc/chinese/README.md @@ -73,13 +73,13 @@ Read this in other languages: [English][en-readme], [中文][zh-readme], [日本 如果您正在使用[CocoaPods][cocoapods],您可以将以下代码行添加至 `Podfile`,然后继续进行[此步骤](#sdk-integrate): ```ruby -pod 'Adjust', '~> 4.18.1' +pod 'Adjust', '~> 4.18.2' ``` 或: ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.1' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.2' ``` --- diff --git a/doc/english/migrate.md b/doc/english/migrate.md index 65aa9cc83..d46b61bfa 100644 --- a/doc/english/migrate.md +++ b/doc/english/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.18.1 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.18.2 from v3.4.0 ### Initial setup diff --git a/doc/english/web_view_migration.md b/doc/english/web_view_migration.md index ef05f31b5..1f5705d59 100644 --- a/doc/english/web_view_migration.md +++ b/doc/english/web_view_migration.md @@ -1,3 +1,21 @@ +## Migrate your Adjust web bridge SDK to v4.18.2 from v4.18.1 or earlier + +Prior to v4.18.2, Adjust web bridge SDK contained methods to inject `UIWebView` objects. To address Apple's warning to developers (ITMS-90809) about `UIWebView` class deprecation, we have removed methods from our bridge which were working with `UIWebView` objects and left only methods which accept `WKWebView` objects. + +Removed methods from `AdjustBridge` class: + +```objc +- loadUIWebViewBridge: +- loadUIWebViewBridge:webViewDelegate: +``` + +Please, switch to usage of `WKWebView` in your app instead of `UIWebView` and use following methods instead: + +```objc +- loadWKWebViewBridge: +- loadWKWebViewBridge:webViewDelegate: +``` + ## Migrate your Adjust web bridge SDK to v4.18.1 from v4.9.1 or earlier ### Integration diff --git a/doc/english/web_views.md b/doc/english/web_views.md index 78f0fbfb3..24494d99a 100644 --- a/doc/english/web_views.md +++ b/doc/english/web_views.md @@ -63,7 +63,7 @@ We will describe the steps to integrate the Adjust SDK into your iOS project. We 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/WebBridge', '~> 4.18.1' +pod 'Adjust/WebBridge', '~> 4.18.2' ``` --- @@ -116,18 +116,10 @@ the `viewDidLoad` or `viewWillAppear` method of your Web View Delegate add the f // or #import - (void)viewWillAppear:(BOOL)animated { - UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - // or with WKWebView: - // WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; + WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface - self.adjustBridge = [[AdjustBridge alloc] init]; - [self.adjustBridge loadUIWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadUIWebViewBridge:webView webViewDelegate:(UIWebViewDelegate*)self]; - - // or with WKWebView: - // [self.adjustBridge loadWKWebViewBridge:webView]; + [self.adjustBridge loadWKWebViewBridge:webView]; // optionally you can add a web view delegate so that you can also capture its events // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; } diff --git a/doc/japanese/README.md b/doc/japanese/README.md index 8614c000e..ba36d0a4e 100644 --- a/doc/japanese/README.md +++ b/doc/japanese/README.md @@ -25,13 +25,13 @@ adjust SDKをiOSプロジェクトに連携する手順を説明します。 [こちらの手順](#sdk-integrate)に進んでください。 ```ruby -pod 'Adjust', '~> 4.18.1' +pod 'Adjust', '~> 4.18.2' ``` または ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.1' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.2' ``` --- diff --git a/doc/japanese/web_views.md b/doc/japanese/web_views.md index 85e5521ca..6dedd2209 100644 --- a/doc/japanese/web_views.md +++ b/doc/japanese/web_views.md @@ -54,20 +54,16 @@ Xcodeのプロジェクトナビゲータから`Supporting Files`グループを プロジェクトナビゲータからView Controllerのソースファイルを開いてください。ファイル最上部に`import`の記述を追加してください。Web Viewデリゲートの`viewDidLoad`か`viewWillAppear`のメソッドで次の`AdjustBridge`のコールを追加してください。 ```objc -#import "Adjust.h" -// Or #import -// (depends on the way you have chosen to add our native iOS SDK) -// ... +#import "AdjustBridge.h" +// or #import - (void)viewWillAppear:(BOOL)animated { - UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - // or with WKWebView: - // WKWebView *webView = [[NSClassFromString(@"WKWebView") alloc] initWithFrame:self.view.bounds]; - - AdjustBridge *adjustBridge = [[AdjustBridge alloc] init]; - [adjustBridge loadUIWebViewBridge:webView]; - // or with WKWebView: - // [adjustBridge loadWKWebViewBridge:webView]; + WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; + + // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface + [self.adjustBridge loadWKWebViewBridge:webView]; + // optionally you can add a web view delegate so that you can also capture its events + // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; } // ... diff --git a/doc/korean/README.md b/doc/korean/README.md index 549c69a0a..f5e228a7f 100644 --- a/doc/korean/README.md +++ b/doc/korean/README.md @@ -73,13 +73,13 @@ iOS 개발용 Xcode를 사용한다는 가정하에 iOS 프로젝트에 Adjust S [CocoaPods][cocoapods]를 사용하는 경우, 다음 내용을 `Podfile`에 추가한 후 [해당 단계](#sdk-integrate)를 완료하세요. ```ruby -pod 'Adjust', '~> 4.18.1' +pod 'Adjust', '~> 4.18.2' ``` 또는: ```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.1' +pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.18.2' ``` --- diff --git a/doc/migrate.md b/doc/migrate.md index 65aa9cc83..d46b61bfa 100644 --- a/doc/migrate.md +++ b/doc/migrate.md @@ -1,4 +1,4 @@ -## Migrate your adjust SDK for iOS to v4.18.1 from v3.4.0 +## Migrate your adjust SDK for iOS to v4.18.2 from v3.4.0 ### Initial setup diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj b/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj index ee3cbfe2c..ccd8d6ae0 100644 --- a/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj +++ b/examples/AdjustExample-WebView/AdjustExample-WebView.xcodeproj/project.pbxproj @@ -10,7 +10,6 @@ 6FCC85121F2794D900D6A0ED /* ADJReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 6FCC85111F2794D600D6A0ED /* ADJReachability.m */; }; 968595F11D0B2E630011CA2B /* AdjustBridgeRegister.m in Sources */ = {isa = PBXBuildFile; fileRef = 968595F01D0B2E630011CA2B /* AdjustBridgeRegister.m */; }; 9D1082A91CFDAF8E0050568B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082A81CFDAF8E0050568B /* main.m */; }; - 9D1082AF1CFDAF8E0050568B /* UIWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D1082AE1CFDAF8E0050568B /* UIWebViewController.m */; }; 9D1082B41CFDAF8E0050568B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9D1082B31CFDAF8E0050568B /* Assets.xcassets */; }; 9D1082C51CFDAFDA0050568B /* AdjustExample-WebView.html in Resources */ = {isa = PBXBuildFile; fileRef = 9D1082C41CFDAFDA0050568B /* AdjustExample-WebView.html */; }; 9D1082C81CFDAFF30050568B /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D1082C71CFDAFF30050568B /* WebKit.framework */; }; @@ -52,7 +51,6 @@ 9D449EF71E6EDD4100E7E80B /* ADJTimerOnce.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D449ED41E6EDD4100E7E80B /* ADJTimerOnce.m */; }; 9D449EF81E6EDD4100E7E80B /* Adjust.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D449ED61E6EDD4100E7E80B /* Adjust.m */; }; 9D449EF91E6EDD4100E7E80B /* ADJUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D449ED81E6EDD4100E7E80B /* ADJUtil.m */; }; - 9D75F1961D07463800E5D222 /* WebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D75F1881D07463800E5D222 /* WebViewJavascriptBridge.m */; }; 9D75F1971D07463800E5D222 /* WebViewJavascriptBridge_JS.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D75F18A1D07463800E5D222 /* WebViewJavascriptBridge_JS.m */; }; 9D75F1981D07463800E5D222 /* WebViewJavascriptBridgeBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D75F18C1D07463800E5D222 /* WebViewJavascriptBridgeBase.m */; }; 9D75F1991D07463800E5D222 /* WKWebViewJavascriptBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D75F18E1D07463800E5D222 /* WKWebViewJavascriptBridge.m */; }; @@ -68,8 +66,6 @@ 968595F01D0B2E630011CA2B /* AdjustBridgeRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdjustBridgeRegister.m; sourceTree = ""; }; 9D1082A41CFDAF8E0050568B /* AdjustExample-WebView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AdjustExample-WebView.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 9D1082A81CFDAF8E0050568B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 9D1082AD1CFDAF8E0050568B /* UIWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIWebViewController.h; sourceTree = ""; }; - 9D1082AE1CFDAF8E0050568B /* UIWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIWebViewController.m; sourceTree = ""; }; 9D1082B31CFDAF8E0050568B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9D1082B81CFDAF8E0050568B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9D1082C41CFDAFDA0050568B /* AdjustExample-WebView.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "AdjustExample-WebView.html"; sourceTree = ""; }; @@ -198,8 +194,6 @@ children = ( 9D9A99D81D0B699A0022FFCE /* AppDelegate.h */, 9D9A99D91D0B699A0022FFCE /* AppDelegate.m */, - 9D1082AD1CFDAF8E0050568B /* UIWebViewController.h */, - 9D1082AE1CFDAF8E0050568B /* UIWebViewController.m */, 9D10833B1CFDD8F00050568B /* WKWebViewController.h */, 9D10833C1CFDD8F00050568B /* WKWebViewController.m */, 9D1082B31CFDAF8E0050568B /* Assets.xcassets */, @@ -425,13 +419,11 @@ 9D449EF71E6EDD4100E7E80B /* ADJTimerOnce.m in Sources */, 9D449EF81E6EDD4100E7E80B /* Adjust.m in Sources */, 9D449EDF1E6EDD4100E7E80B /* NSString+ADJAdditions.m in Sources */, - 9D1082AF1CFDAF8E0050568B /* UIWebViewController.m in Sources */, 9D449EF31E6EDD4100E7E80B /* ADJSessionParameters.m in Sources */, 9D449EEC1E6EDD4100E7E80B /* ADJLogger.m in Sources */, 9D449EF51E6EDD4100E7E80B /* ADJSystemProfile.m in Sources */, 9D449EE01E6EDD4100E7E80B /* UIDevice+ADJAdditions.m in Sources */, 9D449EEA1E6EDD4100E7E80B /* ADJEventSuccess.m in Sources */, - 9D75F1961D07463800E5D222 /* WebViewJavascriptBridge.m in Sources */, 9DD0E9C41F4587C600B2A759 /* ADJUserDefaults.m in Sources */, 6FCC85121F2794D900D6A0ED /* ADJReachability.m in Sources */, 9D75F1991D07463800E5D222 /* WKWebViewJavascriptBridge.m in Sources */, diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/AppDelegate.m b/examples/AdjustExample-WebView/AdjustExample-WebView/AppDelegate.m index 34785ef90..5f8541a65 100644 --- a/examples/AdjustExample-WebView/AdjustExample-WebView/AppDelegate.m +++ b/examples/AdjustExample-WebView/AdjustExample-WebView/AppDelegate.m @@ -8,12 +8,10 @@ #import "Adjust.h" #import "AppDelegate.h" -#import "UIWebViewController.h" #import "WKWebViewController.h" @interface AppDelegate () -@property UIWebViewController *uiWebViewExampleController; @property WKWebViewController *wkWebViewExampleController; @end @@ -22,23 +20,11 @@ @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // 1. Create the UIWebView example - self.uiWebViewExampleController = [[UIWebViewController alloc] init]; - self.uiWebViewExampleController.tabBarItem.title = @"UIWebView"; - - // 2. Create the tab footer and add the UIWebView example - UITabBarController *tabBarController = [[UITabBarController alloc] init]; - [tabBarController addChildViewController:self.uiWebViewExampleController]; - - // 3. Create the WKWebView example for devices >= iOS 8 - if ([WKWebView class]) { - self.wkWebViewExampleController = [[WKWebViewController alloc] init]; - self.wkWebViewExampleController.tabBarItem.title = @"WKWebView"; - [tabBarController addChildViewController:self.wkWebViewExampleController]; - } + self.wkWebViewExampleController = [[WKWebViewController alloc] init]; + self.wkWebViewExampleController.tabBarItem.title = @"WKWebView"; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.rootViewController = tabBarController; + self.window.rootViewController = self.wkWebViewExampleController; [self.window makeKeyAndVisible]; return YES; diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/UIWebViewController.h b/examples/AdjustExample-WebView/AdjustExample-WebView/UIWebViewController.h deleted file mode 100644 index b0e1b37fa..000000000 --- a/examples/AdjustExample-WebView/AdjustExample-WebView/UIWebViewController.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// ViewController.h -// AdjustExample-WebView -// -// Created by Uglješa Erceg on 31/05/16. -// Copyright © 2016 adjust GmbH. All rights reserved. -// - -#import -#import - -#import "AdjustBridge.h" - -@interface UIWebViewController : UINavigationController - -@property AdjustBridge *adjustBridge; -@property JSContext *jsContext; - -@end - diff --git a/examples/AdjustExample-WebView/AdjustExample-WebView/UIWebViewController.m b/examples/AdjustExample-WebView/AdjustExample-WebView/UIWebViewController.m deleted file mode 100644 index 9660c8f1e..000000000 --- a/examples/AdjustExample-WebView/AdjustExample-WebView/UIWebViewController.m +++ /dev/null @@ -1,52 +0,0 @@ -// -// ViewController.m -// AdjustExample-WebView -// -// Created by Uglješa Erceg on 31/05/16. -// Copyright © 2016 adjust GmbH. All rights reserved. -// - -#import "UIWebViewController.h" - -@interface UIWebViewController () - -@end - -@implementation UIWebViewController - -- (void)viewDidLoad { - [super viewDidLoad]; -} - -- (void)viewWillAppear:(BOOL)animated { - [self loadUIWebView]; -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; -} - -- (void)loadUIWebView { - UIWebView *uiWebView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - [self.view addSubview:uiWebView]; - - _adjustBridge = [[AdjustBridge alloc] init]; - [_adjustBridge loadUIWebViewBridge:uiWebView webViewDelegate:self]; - - _jsContext = [uiWebView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; - _jsContext[@"console"][@"log"] = ^(JSValue * msg) { - NSLog(@"JavaScript %@ log message: %@", [JSContext currentContext], msg); - }; - - NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"AdjustExample-WebView" ofType:@"html"]; - NSString *appHtml = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil]; - NSURL *baseURL = [NSURL fileURLWithPath:htmlPath]; - [uiWebView loadHTMLString:appHtml baseURL:baseURL]; -} - -- (void)callUiHandler:(id)sender { - -} - -@end -