Skip to content

Commit

Permalink
Merge pull request #716 from adjust/v4383
Browse files Browse the repository at this point in the history
Version 4.38.3
  • Loading branch information
genadyb authored May 23, 2024
2 parents 2fd82b1 + a4f410b commit c32780b
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Adjust.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Adjust"
s.version = "4.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" => "[email protected]" }
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'
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion Adjust/Adjust.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
2 changes: 1 addition & 1 deletion AdjustBridge/AdjustBridgeRegister.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
59 changes: 59 additions & 0 deletions AdjustBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -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; }
Expand All @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.38.2
4.38.3

0 comments on commit c32780b

Please sign in to comment.