i Used Webview to integration with PayPal: sample of the code:
<Modal
animationType={"fade"}
transparent={false}
visible={this.state.modalVisible}
onRequestClose={() => {
alert("Modal has been closed")
}}
>
<WebView
source={ require('./PayPalIntegration.html')}
style={{flex: 10, width: width, height: height, margin: 20, alignItems: 'center', alignSelf: 'center'}}
javaScriptEnabled={true}
automaticallyAdjustContentInsets={true}
/>
<TouchableOpacity style={{marginLeft: 10, marginBottom: 10,}}onPress={() => {
this.setState({ modalVisible: false})
}}>
<Text>
X Close
</Text>
</TouchableOpacity>
</Modal>
It works when i use iOS emulator from Xcode, work on AndroidStudio's AVD manager, and also works when i use react-native run-android
direct to my device.
But after generated APK and installed it, i see only the Modal
and the WebView
isn't working.
I did several things to try to fix this:
I check the configurations of the proguard and according to other posts here and it was FALSE already, according to web view not loading page after exporting to signed APK
I added
-keepattributes JavascriptInterface
according to JavascriptInterface on Android dont work with APK in release mode
I must say that i can check it only on ANDROID because i can only generate APK (do not have apple's developer account)