New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: android should intercept request #3422
base: master
Are you sure you want to change the base?
feat: android should intercept request #3422
Conversation
Current implementation only supports returning a string from React Native to Android, where it will be converted to a InputStream in the form of a byte array Areas of improvement:
Concerns
|
@@ -312,6 +380,19 @@ protected WritableMap createWebViewEvent(WebView webView, String url) { | |||
return event; | |||
} | |||
|
|||
protected WritableMap createWebViewEventTest(WebView webView, String url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was created because createWebviewEvent
returns an error related to threads when setting one of the properties, will refactor this function
Gave a quick read to the PR:
I'm not an expert regarding all the points you made within your concerns (that are very much valid) |
Hey Titozzz, thanks for your reply. I'll look to refactor the code for reusability with Do you know who I should ask for more information on JSI, or Native to React native communication? I have taken a look at this page https://reactnative.dev/docs/communication-ios, but it doesn't go in depth on the limitations |
The part you linked is using the old arch. So it is mainly outdated |
Several observations during testing:
Thus, shouldInterceptRequest should have its own event object which will be a subset of WebviewEvent
|
- refactor common code between shouldInterceptRequest and shouldOverrideUrlLoading - allow async/await on the onShouldInterceptRequest callback
402e83d
to
13a73cb
Compare
Initial attempts at implement the
shouldInterceptRequest
method of Android Webview Client.Results: