[SOLVED] Wkwebview - Context issue - migrating from uiwebview to wkwebview

Hi @nolimits4web, I’m having an issue migrating an app from uiwebview to wkwebview in IOS
This is part of my config.xml, I compile with [email protected]

    <plugin name="cordova-plugin-inappbrowser"  source="npm" /> 
    <plugin name="cordova-plugin-wkwebview-engine"  source="npm" /> 
    <plugin name="cordova-plugin-wkwebview-file-xhr"  source="npm" /> 
    <preference name="NativeXHRLogging" value="none"/>
    <preference name="AllowUntrustedCerts" value="on"/>
    <preference name="InterceptRemoteRequests" value="secureOnly"/>

    <platform name="ios">

        <preference name="BackupWebStorage" value="local"/>
        <preference name="TopActivityIndicator" value="white"/>
        <preference name="SuppressesIncrementalRendering" value="true"/>
        <preference name="GapBetweenPages" value="0"/>

        <preference name="UIWebViewDecelerationSpeed" value="fast" />
        <preference name="WKWebViewOnly" value="true" />
        <feature name="CDVWKWebViewEngine">
            <param name="ios-package" value="CDVWKWebViewEngine" />
        <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
        <preference name="AllowBackForwardNavigationGestures" value="true" />
        <preference name="Allow3DTouchLinkPreview" value="false" />
        <preference name="CordovaDefaultWebViewEngine" value="CDVUIWebViewEngine" />
        <preference name="SuppressesLongPressGesture" value="true" />
        <preference name="Suppresses3DTouchGesture" value="true" />

Now, when I need to access to pages loaded via a component with context I’m not able to do that.

This is the navigate code that I used to had and worked fine. Now it gets freeze in Xcode emulator.

  var context = {
        uuid : value.uuid, 
        descripcion:  value.descripcion };

app.view.main.router.navigate(page_url, {context: context});

If I load the page like without the context, it loads (incomplete, but load the html)
app.view.main.router.navigate(page_url );

I think that is something related to the xhr request and the cordova-plugin-wkwebview-file-xhr plugin but I can’t figure it out.

I read again the documentation about routes to see if something has changed but no.

Can you help me? is something about that UI changes, because I go back to uiwebview and it works fine.

You should migrate to [email protected] Cordova-ios 6.0.0 builds

1 Like