Skip to content

Commit

Permalink
Polyfill for onMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
qpratt committed Jul 30, 2019
1 parent ee3e035 commit 0006831
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PlaidAuthenticator extends Component {
uri = token !== undefined ? `${uri}&token=${token}` : uri;
uri = webhook !== undefined ? `${uri}&webhook=${webhook}` : uri;

const injectedJavaScript = `(function() {
const jsFix = `(function() {
window.postMessage = function(data) {
window.ReactNativeWebView.postMessage(data);
};
Expand All @@ -47,7 +47,7 @@ class PlaidAuthenticator extends Component {
ref={this.props.plaidRef}
source={{ uri }}
onMessage={this.onMessage}
injectedJavaScript={this.injectedJavaScript}
injectedJavaScript={jsFix}
mixedContentMode={'compatibility'}
javaScriptEnabled={true}
useWebKit
Expand Down

0 comments on commit 0006831

Please sign in to comment.