My issue is the following...
I have a payment gateway link which is displayed within an iframe. From this iframe I can select paypal as a payment type when the CTA is pressed it will provide a link https://ppp-test.safecharge.com/ppp/blank.html?ssid=9fb this is provided via a pop up window in a web scenario however it is presented in onNavigationStateChange. From this generated link it will head to the paypal authentication screen. The issue is that the first link will open no problem but will get stuck in a loading state with no network output... The only error I have been able to log is the following.
[CoreServices] Failed to open URL https://ppp-test.safecharge.com/ppp/blank.html?ssid=9f*** Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request to open "com.apple.mobilesafari" failed." UserInfo={BSErrorCodeDescription=RequestDenied, NSUnderlyingError=0x6000021b22b0 {Error Domain=FBSOpenApplicationErrorDomain Code=3 "Application com..* is neither visible nor entitled, so may not perform un-trusted user actions." UserInfo={BSErrorCodeDescription=Security, NSLocalizedFailureReason=Application com.bede.bededemo is neither visible nor entitled, so may not perform un-trusted user actions.}}, NSLocalizedDescription=The request to open "com.apple.mobilesafari" failed., FBSOpenApplicationRequestID=0xc1ff, NSLocalizedFailureReason=The request was denied by service delegate (SBMainWorkspace) for reason: Security ("Application com.***.identifier is neither visible nor entitled, so may not perform un-trusted user actions").}
<WebView
testID="deposit-webview"
injectedJavaScript='window.addEventListener("message", function (event) { window.ReactNativeWebView.postMessage(event.data)});true;'
style={styles.webview}
javaScriptEnabled
onMessage={handleMessage}
javaScriptCanOpenWindowsAutomatically
onLoadStart={(e) =>
console.log('WebView Load Start: ', e.nativeEvent)
}
onLoadEnd={(e) => console.log('WebView Load End: ', e.nativeEvent)}
onError={handleWebViewError}
onHttpError={handleWebViewError}
onOpenWindow={(e: any) => console.log(e)}
source={{ uri: depositUrl }}
originWhitelist={['http://', 'https://', 'paylado:']}
onNavigationStateChange={(e: any) => {
console.log(e);
if (e.url.includes('blank.html?')) {
try {
Linking.canOpenURL(e.url).then((supported) => {
if (supported) Linking.openURL(e.url);
});
} catch (e) {
console.log("can't open this url", e);
}
} else if (
playerDepositParams?.paymentGateway === 'Paylado' &&
e.url !== depositUrl
) {
onDepositSuccess(remoteReference);
}
}}
onShouldStartLoadWithRequest={(request) => {
if (request.url.startsWith('paylado:')) {
try {
Linking.canOpenURL(request.url).then((supported) => {
if (supported) Linking.openURL(request.url);
});
} catch (e) {
console.log(
"Failed to launch paylado app, it probably isn't installed on the device"
);
}
}
return !request.url.startsWith('paylado:');
}}
/>