WKWebview v3.0.0


#64

Yes, the wkwebview plugin can be used, and has been used for quite some time.

Many links/post here are pointing to an older plugin repo though.
Please see the updated instructions here


#65

Hi, thanks for this great plugin!

I have a few questions regarding the use of a web server:

  • Security
    • Is the server restricted to the app or can other running apps send requests to it?
    • Is the server only listening on localhost or will it answer requests from the network?
  • Correctness
    • What happens if two or more apps using this plugin are installed on the same device? Will they all try to listen on the same port and fail?

Thanks!


#66

I’ve tried a few times but I end up reverting and rolling back - I’m not sure I’m doing everything I should be doing - If anyone has seen an improvement as far as performance etc. could you please print your config.xml, package.json and index.html and anywhere else where you might have changed for this plugin, so we can check and see what we’ve missed. For example it was not clear to me all the places where we need to set up support for CORS. Thank you.


#67

Hi Mike,

If our application already used cordova-plugin-wkwebview-engine will this be a drop in replacement or will we need to go through will all the changes mentioned in the announcement post?


#68

Unfortunately, I did as this instructions, but the cors issue of xhr still occurred to me.


#69

Hi! Yep, CORS need to be implemented correct on your server to work. The WKWebview Docs mention this


#70

Hey, @mhartington, have you guys researched these concerns? Thanks!


#71

I have tried to use the WKWebview plugin a few times already, and each time I found something else broken and had to revert back. Today I noticed that after the app goes into background mode it closes, meaning the next time you activate the app, it restarts from the splash screen. So I reverted back again, took off the plugin and added instead
<preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />
and at least it works again. There so much hype about new things like Lazy Loading, Stencil, WKWebview, Ionic Cloud/Pro and so on, but they’re not complete or stable enough.


#72

We installed WKWebview using the instructions on the ionic blog. We were wondering if there is a method to be 100% sure that we are now using WKWebview. Something that only triggers when using WKWebview and not when using UIWebview…


#73

From the README of the decrepated repo:

An easy way to verify that WKWebView has been installed on iOS is to check if 
window.indexedDB exists. For example:

if (window.indexedDB) {
   console.log("I'm in WKWebView!");
} else {
   console.log("I'm in UIWebView");
}

#74

Hey, sorry for the delay.

  • Is the server restricted to the app or can other running apps send requests to it?

The server is restricted the app that it is running in. Each iOS app runs in it’s own sandbox, so other apps cannot directly talk to one another

  • Is the server only listening on localhost or will it answer requests from the network?

The server is only listening to local host, so if you try to connect to it from an external network, it will fail.
This keeps the server safe and secure.

  • What happens if two or more apps using this plugin are installed on the same device? Will they all try to listen on the same port and fail?
    Nope, you can have to apps running the same server and it will work. Again, because they’re sandboxed, each one creates it’s own network instance, so they wont clobber each other.

#75

This may or may not work. UIWebview kind of had indexDB, but it was very broken.

The best way to check and be sure is just look through your file system, or try logging out scroll events in your test.
WKWebview reports correct scroll events while UIWebview has a buggy reporting for it.


Remove WKwebview but check in iOS App it's not true
#76

We were indeed in WKWebView :smiley:. Thanks!


#77

Thanks! I think this should be added to the docs somewhere, as more people are likely to raise these questions.


#78

Hi @mhartington,
Is this plugin increase the size of app?
Thanks a ton.


#80

Nope it shouldn’t as wkwebview is a system library already present on the device.


#81

If you run the app from xcode you can see the native logging output “using ionic wkwebview” to confirm.


#82

Hi, could you provide a piece of code to check if we are runing wkwebview on Android? I don’t understand how to log scroll events.


#83

wkwebview is only for iOS


#84

For app failing on simulator:
I’m facing the same issue. do you have a solution?
thanks