diff --git a/Adjust.podspec b/Adjust.podspec index 814bb6143..9a72aa7f0 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "Adjust" - s.version = "4.38.2" + s.version = "4.38.3" s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com." s.homepage = "https://github.com/adjust/ios_sdk" s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } s.author = { "Adjust" => "sdk@adjust.com" } - s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.38.2" } + s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.38.3" } s.ios.deployment_target = '9.0' s.tvos.deployment_target = '9.0' s.framework = 'SystemConfiguration' diff --git a/Adjust/ADJUtil.m b/Adjust/ADJUtil.m index d6104ae65..c0e2558c3 100644 --- a/Adjust/ADJUtil.m +++ b/Adjust/ADJUtil.m @@ -35,7 +35,7 @@ static NSRegularExpression *shortUniversalLinkRegex = nil; static NSRegularExpression *excludedDeeplinkRegex = nil; -static NSString * const kClientSdk = @"ios4.38.2"; +static NSString * const kClientSdk = @"ios4.38.3"; 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 d4b1039c3..0e6ac9940 100644 --- a/Adjust/Adjust.h +++ b/Adjust/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust SDK // -// V4.38.2 +// V4.38.3 // Created by Christian Wellenbrock (@wellle) on 23rd July 2013. // Copyright (c) 2012-2021 Adjust GmbH. All rights reserved. // diff --git a/AdjustBridge/AdjustBridgeRegister.m b/AdjustBridge/AdjustBridgeRegister.m index 8a6cf87cd..db2ae8a93 100644 --- a/AdjustBridge/AdjustBridgeRegister.m +++ b/AdjustBridge/AdjustBridgeRegister.m @@ -280,7 +280,7 @@ + (NSString *)adjust_js { if (this.sdkPrefix) { return this.sdkPrefix; } else { - return 'web-bridge4.38.2'; + return 'web-bridge4.38.3'; } }, setTestOptions: function(testOptions) { diff --git a/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m b/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m index e0392179c..43511a559 100644 --- a/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m +++ b/AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m @@ -163,6 +163,39 @@ - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigati } } +- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences * _Nonnull))decisionHandler API_AVAILABLE(ios(13.0)){ + if (webView != _webView) { return; } + NSURL *url = navigationAction.request.URL; + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + + if ([_base isWebViewJavascriptBridgeURL:url]) { + if ([_base isBridgeLoadedURL:url]) { + [_base injectJavascriptFile]; + } else if ([_base isQueueMessageURL:url]) { + [self WKFlushMessageQueue]; + } else { + [_base logUnkownMessage:url]; + } + decisionHandler(WKNavigationActionPolicyCancel, preferences); + return; + } + + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:preferences:decisionHandler:)]) { + [_webViewDelegate webView:webView decidePolicyForNavigationAction:navigationAction preferences:preferences decisionHandler:decisionHandler]; + } else { + decisionHandler(WKNavigationActionPolicyAllow, preferences); + } +} + +- (void)webView:(WKWebView *)webView navigationAction:(WKNavigationAction *)navigationAction didBecomeDownload:(WKDownload *)download API_AVAILABLE(ios(14.5)){ + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:navigationAction:didBecomeDownload:)]) { + [strongDelegate webView:webView navigationAction:navigationAction didBecomeDownload:download]; + } +} + - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { if (webView != _webView) { return; } @@ -172,6 +205,14 @@ - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation } } +- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didReceiveServerRedirectForProvisionalNavigation:)]) { + [strongDelegate webView:webView didReceiveServerRedirectForProvisionalNavigation:navigation]; + } +} - (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { if (webView != _webView) { return; } @@ -191,6 +232,24 @@ - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation } } +- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView { + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewWebContentProcessDidTerminate:)]) { + [strongDelegate webViewWebContentProcessDidTerminate:webView]; + } +} + +- (void)webView:(WKWebView *)webView navigationResponse:(WKNavigationResponse *)navigationResponse didBecomeDownload:(WKDownload *)download API_AVAILABLE(ios(14.5)){ + if (webView != _webView) { return; } + + __strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate; + if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:navigationResponse:didBecomeDownload:)]) { + [strongDelegate webView:webView navigationResponse:navigationResponse didBecomeDownload:download]; + } +} + - (NSString*) _evaluateJavascript:(NSString*)javascriptCommand { [_webView evaluateJavaScript:javascriptCommand completionHandler:nil]; return NULL; diff --git a/CHANGELOG.md b/CHANGELOG.md index 913660c9c..b2c13f997 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version 4.38.3 (23rd May 2024) +#### Fixed +- Added missing `WKNavigationDelegate` methods to the `WebBridge` implementation. + +--- + ### Version 4.38.2 (30th April 2024) #### Added - Added sending of the additional SDK observability parameters for debugging purposes. diff --git a/VERSION b/VERSION index c1a44ab2b..3ebe3743b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.38.2 +4.38.3