-
Notifications
You must be signed in to change notification settings - Fork 7
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
Setting onMessage on a WebView overrides existing values of window.postMessage #2
Comments
Can you take a snapshot of your device's screen and post a picture of the error you are getting. |
This problem seems to be related to this react-native issue here: facebook/react-native#10865 It's platform specific to iOS. It looks like it is a problem associated with the react-native-webview-messaging npm package. There is an issue associated with it here: lesnitsky/react-native-webview-messaging#16. I've contributed to that package before, and the writer is a good guy. I'm going to move the conversation over there. |
Referencing commit 7790af6 I modified the node_modules/react-native-webview-braintree/node_modules/react-native-webview-messaging/WebView.js render function as follows:
No more red screen... not sure how this affects the rest of the package, if at all... |
I had a couple of other projects that used the same messaging technique. I replaced it in those apps, and it seems to be working okay. I'll have to do the same here. |
Hi @reggie3 I've been away for a while, but just just picking up my project again and ready to try implementing this again. So will you be updating with the solution from @hobbesdaboba Also will you be removing react-native from react-native-webview-braintree/node_modules so there is no ambiguous resolution? Thanks |
I won't be a able to work on this project for a few days, but I plan on making this project more like my other react-native-webview projects so that it incorporates both the library and an example application. It'll take me a couple of weeks to get around to it though. Doing this will solve this particular issue. |
override node_modules/react-native-webview-messaging/WebView.js whith the following code
|
When I load the webview I get this error message
Setting onMessage on a WebView overrides existing values of window.postMessage
I'm not setting onMessage anywhere else.
The content of my render is
The text was updated successfully, but these errors were encountered: