reggie3 / react-native-webview-braintree

React Native Braintree payments component that has no native code
MIT License
14 stars 7 forks source link

Webview js not executing for Android #7

Open PaddyLock opened 5 years ago

PaddyLock commented 5 years ago

Hi, I have an older implementation of your solution that I first implemented over a year ago, but has now gone live. It works fine in IOS but does not show at all on Android devices. It does work fine on the Android Genymotion emulator. Do you know of any issues regarding Android devices? I have done some tests and the dist/index.html file is rendered in the webview but the javascript that is included with <script type="text/javascript" src="main.c83c967981c06e0032d8.bundle.js"></script> does not appear to get executed as nothing is rendered within the webview. Have you worked on anything over the last year that solved this problem? or can you shed any light on what might be causing it please?

In WebViewBraintree.js I call WebView like this

<WebView
                startInLoadingState={true}
                renderLoading={() => {
                    return this.displaySpinner();
                }}
                onLoad={this.sendClientTokenToHTML}
                source={localHtmlFile}
                style={{ height: 540 }}
                injectedJavaScript={patchPostMessageJsCode}
                javaScriptEnabledAndroid={true}
                ref={ref => (this.webview = ref)}
                scrollEnabled={true}
            />

Thanks for any help