-
Notifications
You must be signed in to change notification settings - Fork 491
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
Fix iOS imports on RN0.40+ and replace UIWebview with WkWebview #217
base: master
Are you sure you want to change the base?
Conversation
Wow, moving to WKWebview is a big jump. Which I wanted. Are you using it in your own app and tested? Does it maintain same API as before, more or less? |
@fungilation |
I commented inline in code:
|
ff8d28a
to
9cad02b
Compare
@fungilation No reason, sent a fix, TY! :) |
9cad02b
to
1f2f3e6
Compare
Switched to your PR in my app, no bug so far that I can see. With noticeable improvement in WebViews' loading performance, much thanks for this! |
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.
Tested and working in my app, with noticeable improvement in initial loading performance due to WKWebView.
@fungilation Nice! :D |
The Do you have a good idea how to add that back in for WkWebView ? |
I confirm that the WKWebView fork never worked. I mistakenly had the old version in my test app. On linking the new fork, app just crash to home screen on WebView's render. I am using and need the |
@fungilation it mostly works for me with a few tweaks (which were ok for my situation):
My document works with that and I can send/receive data over the bridge. |
No more deprecated webview on iOS and let people use webviewbridge API with RN 0.40+ Commit messages: Fix iOS imports on RN 0.40+ Replacing UIWebview with WkWebview Fix WKWebview Bridge Remove debug informations Fix injectedJavaScript property
1f2f3e6
to
d894f5e
Compare
@fungilation @peterept I fixed now this |
@fungilation @peterept Anyway I never used |
For me I need to inject JS, as I'm loading external websites. Thanks @guilhermebruzzi |
Right. The code needs to use |
@peterept I called the method on the same places that UIWebview used to call his inject method. |
holy moley @guilhermebruzzi . I'm a fool... I cloned from your master branch on your fork (which has an older version of your code with WkWebView - missing the injection code). I'll switch to your branch |
Confirmed it works! That's awesome work @guilhermebruzzi. I installed from the correct branch (although I see you've updated master now also): $ npm install --save git://github.com/vtex/react-native-webview-bridge.git#feature/wkwebview
$ react-native run-ios And now the const injectScript = `
(function () {
if (WebViewBridge) {
document.body.style.backgroundColor = "red";
}
}());
`; Thank you so much for this. |
@peterept no problem! :) Yeah, you can install from master branch also. |
@guilhermebruzzi how to use this pull request ? the master branch have problem! |
@iOSHw What kind of problem? To use the master branch you insert: "react-native-webview-bridge": "vtex/react-native-webview-bridge", on package.json dependencies And than run |
@guilhermebruzzi Hi, bro. I really appreciate your hard working, but it seems not working under RN 0.44.2. Can you fix it? |
Awesome! |
@guilhermebruzzi @alinz is anybody working on fixing the conflicts and merging this branch into master? |
@jenskuhrjorgensen I'm extremely busy that's why I'm constantly looking for good maintainer? Are you interested? |
@alinz That's a shame - your library has been very useful to me! :) I'm afraid I don't have the time either. |
No more deprecated webview on iOS and let people use webviewbridge API with RN 0.40+
I also included a new example SampleRN42 that shows that the main features still work.