Home > Net >  WKWebView is blank when loading a Paypal captcha
WKWebView is blank when loading a Paypal captcha

Time:09-21

A user can pay with Paypal inside our application. We open the Paypal link inside a WKWebView.

But this is the result after the Paypal log-in.

enter image description here

When I inspect the WKWebView I find these 2 errors in the console:

Refused to load https://www.recaptcha.net/recaptcha/enterprise/... because it does not appear in the frame-ancestors directive of the Content Security Policy.

Failed https://www.recaptcha.net/recaptcha/enterprise/... to load resource: the server responded with a status of 404 ()

I did not find anything on the internet to how to solve this.

Thanks

CodePudding user response:

We open the Paypal link inside a WKWebView.

You cannot do this. From the documentation

Do not use a WebView to display PayPal web pages within your application

Your application must not use a WebView or similar custom browser mechanism for display of PayPal web pages. Instead, use an appropriate PayPal SDK to manage the PayPal experience or launch the PayPal web page within the system browser or an approved browser-view mechanism such as Safari View Controller on iOS or Chrome Custom Tabs on Android.

  • Related