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
Ios scheme handler #209
Ios scheme handler #209
Conversation
Able to make the request from Android -> JS -> Android. Next step is to mutate the response.
Added the propery baseInterceptUrl to a webview routes all requests for a URL through a scheme handler in JS.
Android scheme listener
1. Migrate back down to API version 21.
This looks really good @ccorcos . Well done for a "not native app developer". :) We'll wait until it is more mature and people have used it a bit before reviewing, testing, and merging. So, basically, let's hang onto this PR and see whether it's useful to people |
@ccorcos Can you resolve conflicts and update to master? |
@jamonholmgren I'll try to get around to this soon. |
hey @ccorcos , would love to test this! Looks great, let us know when you get a chance to resolve the conflicts 😄 |
Would it be okay if I did a new PR with the merge fixes? |
@RangerMauve You can start from his branch, I don't think he would mind that. |
Hi @RangerMauve, have you got an active plan to merge commit some merge fixes? |
I think I have it working in this repo I've had to put my work on it on pause though. 😅 edit: updated link URL |
I haven't had time to get around to this but I'm happy to check out your PR @RangerMauve |
@ccorcos I think it's about as functional as it'll get. I stopped using it because the performance of the thing I was trying to do was awful and requests kept timing out. 😅 |
Interesting. What were you trying to do? It's working pretty well for me
right now in our app.
…On Mon, Mar 18, 2019 at 10:36 AM RangerMauve ***@***.***> wrote:
@ccorcos <https://github.com/ccorcos> I think it's about as functional as
it'll get. I stopped using it because the performance of the thing I was
trying to do was awful and requests kept timing out. 😅
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#209 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABth3-uheIlEAqp8GeP6IIz1osOb4mOIks5vX866gaJpZM4ZSP4K>
.
|
I'm trying to load content from the dat protocol: https://github.com/RangerMauve/datmobile I don't think it's a problem with the changes to react-native-webview, it's entirely a problem with getting dat working in react-native being slow. 😅 |
Interesting. Receiving binary data shouldn't be too bad -- I'm proxying
imaging just fine. But uploading binary data is going to be slow.
…On Mon, Mar 18, 2019 at 11:03 AM RangerMauve ***@***.***> wrote:
I'm trying to load content from the dat protocol:
https://github.com/RangerMauve/datmobile
I don't think it's a problem with the changes to react-native-webview,
it's entirely a problem with getting dat working in react-native being
slow. 😅
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#209 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABth3-Pp9_WvHuIEKFoeNJS_1ZM7AddIks5vX9UAgaJpZM4ZSP4K>
.
|
The problem is that doing cryptography / file access / peer discovery in the RN thread is really slow, so by the time the content is ready to be served to the webview, the request has already timed out. |
@jamonholmgren @harrisrobin @Titozzz @RangerMauve @rbscott I've created a new PR that is rebased on master. Still some work left to do before merging, but I'm hoping to take this across the finish line this time. #784 |
This PR is on top of #158 and #173. Also in response to #135.
Its lacking in documentation in the README but the types are all there and more explanation here: ccorcos#1.
Basically, scheme handlers and intercepting requests in the webview is full of quirks. Things like the body data doesn't go through on POST requests and CORS requests don't work on Android when serving from a URL scheme.
The goal here is to be able to intercept requests, in my case for serving cached files, but there's all kinds of things you can do with this. Here's how it works...
On iOS:
On Android, we simply override the the http and https url scheme and let you specify the base intercept url. But the rest of the behavior is the same.
I know this is a little bit lacking in some places...
I have to move on and work on other things but if someone is willing to help get this across the finish line, I'm happy to help.