ionic-team / cordova-plugin-ionic-webview

Web View plugin for Cordova, specialized for Ionic apps.
Apache License 2.0
484 stars 391 forks source link

iOS 15 Breaks with custom headers #645

Closed BrainstemStudio closed 3 years ago

BrainstemStudio commented 3 years ago

We are busy reviewing our apps to get ready for iOS 15 changes. We have noticed when using a basic JS fetch and supplying custom headers the cordova-plugin-ionic-webview encounters the following error:

Web Error Failed to load resource: WebKit encountered an internal error

XCode Error

[Process] 0x128ad1000 - NetworkProcessProxy::didClose (Network Process 0 crash)
[assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>

Setup:

  1. Cordova iOS 6.1.0
  2. cordova-plugin-ionic-webview@latest
  3. XCode 13 Beta
  4. Simulator iOS 15.0

What works

fetch(`https://everydaydigital.co.za/lab/tests/test.php`).then(r => {
    return r.json();
}).then(response => {
    console.log(response);
}).catch(err => {
    console.warn(err);
});

What doesn't work

fetch(`https://everydaydigital.co.za/lab/tests/test.php`,{
    headers : {
        'token' : '123456789'
    }
}).then(r => {
     return r.json();
}).then(response => {
    console.log(response);
}).catch(err => {
   console.warn(err);
});

Tests we have done:

  1. Safari test with iOS 15 works for both tests
  2. Cordova without cordova-plugin-ionic-webview works for both tests
  3. With cordova-plugin-ionic-webview fails on test with custom headers

Expected Behaviour

  1. At least a success or catch error

Current Behaviour

  1. Fails to load resource at all
  2. Error occurs in XCode
BrainstemStudio commented 3 years ago

We have run further tests without the cordova-plugin-ionic-webview plugin using vanilla cordova-ios 6.2.0. The same issue occurs only when the scheme and hostname options are used. I have reported this to cordova-ios as well as this issue seems to affect cordova in general.

https://github.com/apache/cordova-ios/issues/1119

BrainstemStudio commented 3 years ago

Looks like this is a webkit error on Apple's side and is being attended to here: https://trac.webkit.org/changeset/278737/webkit

rajeshrapaka commented 2 years ago

Hi, I am having the same issue. So do we wait for an update or is there any other way to fix this?

IBonkI commented 2 years ago

I am also still having the same Issue

BrainstemStudio commented 2 years ago

@IBonkI @rajeshrapaka You can follow this discussion here https://github.com/apache/cordova-ios/issues/1119 and track the specific WebKit bug here https://bugs.webkit.org/show_bug.cgi?id=226769

BrainstemStudio commented 2 years ago

@IBonkI @rajeshrapaka I see this is been fixed in the latest beta release. I can confirm that custom headers work based on my reported example. I can further confirm that our cordova apps are working when run from xcode 13 / iOS 15 beta 4.