lucasferreira / react-native-webview-android

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

js call app #81

Closed HancleLee closed 6 years ago

HancleLee commented 6 years ago

now js can call app;

Usage: <!DOCTYPE html>

Carson

<WebViewAndroid javaScriptEnabled={true} domStorageEnabled={true} scalesPageToFit={true} startInLoadingState={true} geolocationEnabled={false} builtInZoomControls={false} decelerationRate="normal" automaticallyAdjustContentInsets={false} url={url} style={styles.base} jsToApp={this._jsToApp.bind(this)} />

_jsToApp(params) { // alert("_jsToApp"); }

lucasferreira commented 6 years ago

Hi @HancleLee

Could you write some sort of README instruction for use this new feature?

HancleLee commented 6 years ago

Hi @lucasferreira Finished, you can check it now.

HancleLee commented 6 years ago

Hi @lucasferreira Can you merge it if not any problem here?

lucasferreira commented 6 years ago

Hi @HancleLee,

Thanks again for your contribution. What do you think about we adopt the same method/api style of native RN WebView?

https://facebook.github.io/react-native/docs/webview.html#onmessage

The native webview uses onMessage on app side to receive data from webpages...

lucasferreira commented 6 years ago

Closed in favor of #91