Reputation: 129
I have a react native application when we have to use webview component for external payment providers.
The props I pass through the webview are listed below:
ref: webViewRef,
source: {
uri: 'www.test.com',
headers: {
'Accept-Language': `en`,
},
},
injectedJavaScript:injectedJS,
onLoadEnd: () => onWebViewStateChange({ domLoaded: true }),
onError: error => {
console.error('Error:', error);
},
onNavigationStateChange: state => {
onWebViewStateChange({ url: state.url });
},
onHttpError: error => {
console.error('Http error:', error);
},
userAgent: 'USER_AGENT',
scalesPageToFit: true,
javaScriptEnabled: true,
scrollEnabled: true,
cacheEnabled: true,
nestedScrollEnabled: true,
...props,
uri: 'www.test.com' - this part it is supposed to be the external payment provider link.
By default payment provider works in Android by not in iOS. When the payment process is finished it goes to session timeout.
When I add the prop: sharedCookiesEnabled: true
, it worked in iOS but not in Android.
I have also tried to make it custom based on Platform.OS condition but it doesn't make a difference.
Does someone have any idea how to make this work in both platforms?
Upvotes: 0
Views: 22