Closed RalfK92 closed 4 months ago
Hi @RalfK92,
Can you verify that navigationDelegate
is assigned to self in your WebViewController class? Also, please make sure to add this after initializing the AdjustBridge.
I've tested with the below code snippet, and it works with version 4.38.4 and later.
AdjustBridge *adjustBridge = [[AdjustBridge alloc] init];
[adjustBridge loadWKWebViewBridge:self.webView wkWebViewDelegate:self];
self.webView.navigationDelegate = self;
I hope this helps.
Yes i'm sure that the delegate is assigned, cause i'm receiving the delegate function after commenting out the loadWKWebViewBridge
func. But its done in a inherited class not after the load of the bridge.
Wouldn't overriding the delegate after initializing the bridge prevent adjust from receiving the functions and therefore no tracking data would be gathered.
Furthermore i still receive the
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!)
func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse) async -> WKNavigationResponsePolicy
But not the
webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void)
which works in 4.38.2.
Thank you for sharing the details.
Could you check if the delegate webView:decidePolicyForNavigationAction:preferences:decisionHandler:
is getting called in your current setup?
Yes the delegate function webView:decidePolicyForNavigationAction:preferences:decisionHandler:
gets called.
In version 4.38.3, our SDK added support for webView:decidePolicyForNavigationAction:preferences:decisionHandler:
To receive a callback, you need to add it to your codebase.
As per Apple documentation, either the webView:decidePolicyForNavigationAction:preferences:decisionHandler:
or webView:decidePolicyForNavigationAction:decisionHandler:
delegate method is called. I recommend having both if your application supports iOS versions below 13.0.
Apologies for the inconvenience caused.
@Aditi3 Thanks for the clarification. I will close the issue.
Would be nice to write that down in your documentation as well.
I've upgraded from 4.38.2 to 4.38.4 and since then some WKNavigationDelegete functions are no longer forwarded into my WebViewController. After removing
self.adjustBridge.loadWKWebViewBridge(self.webView, wkWebViewDelegate: self)
from my code the method is received again.