-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
How to pass the parameters from react-native-webview to the javascript? #26137
Comments
It looks like you are using an older version of React Native. Please update to the latest release, v0.60 and verify if the issue still exists. The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.
|
No. This is not a version fault. It works for ios but doesn't work for android. |
https://github.com/react-native-community/react-native-webview/blob/master/docs/Guide.md#communicating-between-js-and-native |
I have already put the html file in the android_assets but how can I send parameters from the react-native-web-view to the JavaScript function? |
Why you dont read the link first? |
I have already used injectedJs. Whenever it renders to the page,it says document not defined. |
injectedjs should be injected as |
Please file an issue to react-native-webview. |
Trying to send the parameters from the react-native-WebView to the javascript function.
tried injectedjs which didn't work.Should be able to pass the params from the webview to the javascript function.
<WebView
source={{ uri: 'file:///android_asset/ICFPackage/ICFPackage/index.html' }}
originWhitelist={["*"]}
domStorageEnabled={true}
startInLoadingState={true}
javaScriptEnabled={true}
allowFileAccess={true} />
React Native version:
React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 317.05 MB / 15.56 GB
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 11.15.0 - /usr/bin/node
npm: 6.7.0 - /usr/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29
Build Tools: 27.0.3, 28.0.2, 28.0.3, 29.0.0, 29.0.1
System Images: android-24 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
npmGlobalPackages:
react-native-webview: 6.9.0
The text was updated successfully, but these errors were encountered: