lucasferreira / react-native-webview-android

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

Implement postMessage #67

Open Crash-- opened 7 years ago

Crash-- commented 7 years ago

Is there a way to not override the stock Android WebView, but the RN one? It'll be much easier to upgrade RN version but also to follow new capability, no?

lucasferreira commented 7 years ago

Hi @Crash--

I didn't know if I get all your 'issue' meaning. By now I can't follow strictly the RN Webview API because I've started this project a long time ago when RN doesn't have a properly webview for Android, so I've made this one.

Before that, I use to implement in my version only features that RN Webview doesn't try to implement, like Upload Dialog feature...

Can you please, explain a lilttle more what is your suggestion?

Crash-- commented 7 years ago

Of course I can explain more my suggestion.

Since RN0.38 or 39 don't remember exactly, RN implemented a bridge in order to be able to communicate between the JS inside the WebView and the JS executed by RN. I use this bridge, but I wanted to be able to set a custom ChromeClient (to play video in fullscreen mode). So I take a look at your plugin, but if I want to do that, I need to reimplement all the new things RN has added since... And there is a lot of things...

So I'm wondering if, instead of extending Android.WebView, this plugin can / could extends React Native WebView. Like that, we can benefit new features from RN WebView and also be able to override it in order to get Upload Dialog, Custom ChromeClient and so on without having to rewrite all the thing RN already do.

Is it more clear? Is it something doable?

inifaisal commented 6 years ago

any update on this issue, please make this same with RN webview api.

lucasferreira commented 6 years ago

Hi @inifaisal

The onMessage method is now supported (comunication between webview and RN) as made in #91