lucasferreira / react-native-webview-android

Simple React Native Android module to use Android's WebView inside your app
356 stars 158 forks source link

Android version requirements for file upload functionality #50

Closed prithsharma closed 8 years ago

prithsharma commented 8 years ago

Very helpful module @lucasferreira. Can you please tell me if it's possible that the file upload feature works on higher Android versions and not on others(4.4 in my example specifically)? The example device I mentioned doesn't have any problems in file uploads on the same website in a browser but doesn't respond in case of WebViewAndroid.

lucasferreira commented 8 years ago

Hi @prithsharma

In theory, your android version it's supported. The APIs are made to work from 4.1+.

I've test this feature in Android Emulators (Genymotion) in versions: 4.1.1, 4.4.4, 5.1.0 and 6.0.0 Physically I tested only two devices, Android 4.4.3 and 5.1.0, and it works all OK.

But searching in Google I found some people blaming about this feature at all, classifying them as experimental. So I think that some specifically builds of Android can't work OK with that feature =/

prithsharma commented 8 years ago

I think the reason upload functionality might not work in some devices could be the following - Samsung devices probably use a browser different from WebChromeClient for WebView, is it possible that it might be the reason for upload not working on that device?

Or is it that react native's WebView always uses WebChromeClient for WebView and this is some other problem altogether? Please tell me if I'm you might have an idea here.

lucasferreira commented 8 years ago

Hi @prithsharma

I didn't know about samsung devices, I tested in one (with android 4.4.3) and it's works well.

But, I know that this feature of file upload can be buggy at all, look into this issue: https://github.com/facebook/react-native/issues/5219

I found this comment in this issue thread:

"Hey. Android Wevbiew doesn't have a public API for this up to 4.3 (Though you could achieve it by using undocumented APIs). And it again breaks in 4.4.1 though 4.4.3. The API are different for most version of Android. I'm not sure it's worth it to add this to the core, since it's hacky, uses private APIs and not supported in all Android versions."

You got it now that is didn't 100% OK for all android versions?

prithsharma commented 8 years ago

Thanks for the response @lucasferreira, this is helpful.