v5.0.0
5.0.0 (2019-02-01)
Features
- Android/iOS postMessage: refactoring the old postMessage implementation (#303) (f3bdab5), closes #29 #272 #221 #105 #66
BREAKING CHANGES
- Android/iOS postMessage:
Communication from webview to react-native has been completely rewritten. React-native-webview will not use or override window.postMessage anymore. Reasons behind these changes can be found throughout so many issues that it made sense to go that way.
window.postMessage(data, *) has been changed to
window.ReactNativeWebView.postMessage(data)
Side note: if you wish to keep compatibility with the old version when you upgrade, you can use the injectedJavascript prop to do that:
const injectedJavascript = `(function() {
window.postMessage = function(data) {
window.ReactNativeWebView.postMessage(data);
};
})()`;
Huge thanks to @jordansexton and @KoenLav!