Uh oh!
There was an error while loading. Please reload this page.
Add file input to WebView - #12807
Conversation
works perfectly for me! just what we need. |
farazs
commented
Mar 20, 2017
Tested manually on: Samsung Galaxy S7 Edge, Samsung Galaxy S5, Nexus 6P emulator, LG v20 |
farazs
commented
Apr 3, 2017
Fixes #11230 |
prithsharma
commented
Apr 25, 2017
Any update or ETA on this? |
farazs
commented
Apr 25, 2017
Sadly no one has reviewed it yet. |
headlessme
commented
May 3, 2017
Would be great to see this merged. @jacobp100 |
jacobp100
commented
May 3, 2017
Sorry, I don't have power to merge things! The code looks good, but I just have a few questions, Is it possible to handle this use-case using #10946? I know that PR hasn't landed, but it is useful for other reviewers to know. Does this work for things uploads than images? What happens if a user is on an older version of Android? |
farazs
commented
May 3, 2017
To answer your questions:
|
headlessme
commented
May 15, 2017
Anyone know who needs pinging to get this reviewed? |
@headlessme@farazs I think the If the |
farazs
commented
May 15, 2017
sounds good. I can update the PR to include only those changes. I'm not sure how close that PR is to being merged though. Is it possible it becomes stale and does not end up being merged? |
jacobp100
commented
May 15, 2017
I'm working hard with the author to get it published soon! |
Why doesn't anyone merge it? We need it ASAP |
monsty
commented
Jun 7, 2017
Any update ? |
#10946 has still not been merged. So if this PR will not be merged as is, it's not possible to implement this using that until it is merged and released in a new RN version. |
andreipfeiffer
commented
Jun 12, 2017
I'm interested in this merge also. |
cbrevik
commented
Aug 19, 2017
mantou132
commented
Aug 23, 2017
@farazs |
farazs
commented
Aug 23, 2017
@mantou132 I'm not sure what you mean by that, but you're welcome to try it out and see! :) |
multiple file & MIME type: Also do not need to set the title: multiple file receive: |
JustPassingThrough
commented
Sep 6, 2017
It seems like #15016 was approved, any chance this might be merged anytime soon? |
Titozzz
commented
Sep 7, 2017
I need this too 😢 , any chance it's coming soon ? |
SaKKo
commented
Sep 20, 2017
I need this too T____T |
0x5e
commented
Oct 12, 2017
Need this too :-) |
hramos
commented
Oct 12, 2017
Please go ahead and and split this out into a separate package, now that the other PR has landed. |
dahjelle
commented
Nov 13, 2017
dahjelle
commented
Nov 17, 2017
Here's a sample of what I did to get Android WebView file upload working in my project, in case it is helpful to anyone else. I suspect one could make an external package based off of that, but I've not dove in to that. Hope it helps someone! |
this is terrible! why would this be split up in a different package? for the sake of argument, this package can become stale and not get any new features that get added to react-native. @farazs could this work/be made as a higher order component? |
JustPassingThrough
commented
Dec 11, 2017
Still waiting for this, with an app which should've gone into production a long time ago. |
hramos
commented
Dec 22, 2017
WebView accounts for a good chunk of issues opened on the repo, but these issues don't seem to affect Facebook's own internal use cases. This is why I highly recommend that the community step in and provide a WebView module. |
farazs
commented
Apr 4, 2018
Sorry I have not had time to take a look at this. It doesn't seem like it will get merged into the WebView component itself though I'm not sure why. Are no further improvements going to be made to the react-native webview? Until it's actually pulled out into it's own community WebView module how are any updates going to be made? Someone would have to put the time creating and owning the WebView module and I don't think I can be that person. If someone creates such a module I would be happy to port this PR over there. |
Hi @farazs, thanks for your share. Unfortunately it doesn't work to me. |
guguji5
commented
Apr 25, 2018
@yihanseattle the change of this PR works? could you share some experience? |
farazs
commented
Apr 25, 2018
@guguji5 I'm not sure what you mean. Even without support for , the issue is that nothing happens in the webview. Are you saying the element itself is not in your webview? That may be an issue with the page you are trying to load. You would need to fork react native, apply these changes to that fork, and then use that fork when building your application. See https://facebook.github.io/react-native/docs/building-from-source.html |
farazs
commented
Apr 25, 2018
We are using these changes in production so they definitely do work for me. master may have diverged from this branch significantly so the changes might need to be altered slightly. |
guguji5
commented
Apr 25, 2018
@farazs yes. I can't see the element |
guguji5
commented
Apr 25, 2018
@farazs I modify the react native file in the node_module folder of my project according to this PR changes, and run |
@guguji5 Please see the link I posted. Editing the node_modules folder is not sufficient to get your project to build the source from there. For further issues, your questions might be better suited to stackoverflow as it's not specific to this pull request but regarding building react-native from source for Android in general. |
guguji5
commented
Apr 25, 2018
@farazs ok .thank you very much. |
Add file input to WebView react#12807react#12807
Add file input to WebView react#12807react#12807
pratikbutani
commented
Oct 14, 2019
Hope this answer will help you. |
Fixes#5219 which was moved to ProductPains. Allows file input in a webview. Previously attempting to use file input would do nothing in the webview. Now the default dialog is shown allowing you to pick Camera to take a picture or Photos/Gallery to select an existing photo.
The problem in fixing this before was that this was accomplished by using undocumented APIs for earlier versions of Android. However, for 5.0+ there is a documented API for this. Since there is no documented way to fix this for earlier versions of Android, it seems better to have a solution for 5.0+ than no solution at all.
Based on this example: https://github.com/GoogleChrome/chromium-webview-samples/tree/master/input-file-example/
The
ActivityEventListenerdoes not work if it is attached to theThemedReactContextitself but needs to be added to the originalReactContextsimilar to howLifecycleEventListeneris handled.