Telerik-Verified-Plugins / WKWebView

DEPRECATED - this plugin served a purpose in the past, but there are better implementation now
832 stars 149 forks source link

Breaks preference BackupWebStorage #76

Open mparpaillon opened 9 years ago

mparpaillon commented 9 years ago

It looks like the option BackupWebStorage no longer works when WKWebView is installed.

It usually allows to configure iCloud behavior. Settings "none" should disabled iCloud backup and it doesn't.

Several apps have been rejected by Apple because of this.

mattlewis92 commented 9 years ago

It looks like web data is being stored in /Library/WebKit/ which according to the cordova docs is backed up to iCloud.

mparpaillon commented 9 years ago

That's the default behavior which you can change by setting "BackupWebStorage" preference to "none".

But this doesn't work anymore when WKWebView plugin is installed

mattlewis92 commented 9 years ago

From what I can see the default behaviour of setting BackupWebStorage to none without this plugin is to store it in /Library/Caches but it's only when I install the plugin the /Library/WebKit folder is created.

mparpaillon commented 9 years ago

Sorry but what's your point ? are you saying that this is normal ? I think this needs to be fixed

mattlewis92 commented 9 years ago

I agree with you that it needs to be fixed, I've just spent the last 3 hours trying to find a solution and just wanted to give some more info to the developer to help him fix it.

EddyVerbruggen commented 9 years ago

Hi @mparpaillon thanks for reporting this. I'm not sure it can be fixed easily, but I'd like to take a look nonetheless. How did you figure out the preference was ignored?

mparpaillon commented 9 years ago

Hi @EddyVerbruggen At first I thought it was a Cordova bug so I created this issue: https://issues.apache.org/jira/browse/CB-8327

You can find there a way to reproduce the bug (Actualy, it won't fail if you don't add WKWebView plugin... that's why nobody answered my issue I guess "-_-)

natew commented 9 years ago

Has anyone gotten an app approved in the store using this plugin, and if so how? Just wondering before I attempt to submit with it.

Edit: should note, my worry of rejection is due to this bug.

natew commented 9 years ago

Re @mattlewis92 I see in the CDVLocalStorage it checks here to set the storage to iCloud:

https://github.com/apache/cordova-ios/blob/4575b3694dcb76f13e21ca0d3bba3d18668ae7a5/CordovaLib/Classes/CDVLocalStorage.m#L319

And in WKWebView I see two things: https://github.com/Telerik-Verified-Plugins/WKWebView/blob/e7e7829a696fcca626e5c5dcf8b27054b5c786f0/src/ios/MyMainViewController.m#L178

and: https://github.com/Telerik-Verified-Plugins/WKWebView/blob/e7e7829a696fcca626e5c5dcf8b27054b5c786f0/src/ios/MyMainViewController.m#L235

Could we do a quick and dirty fix by changing any of these things?

natew commented 9 years ago

I changed this line to be "local" and it seems to not output any iCloud warnings anymore.

EddyVerbruggen commented 9 years ago

@natew that's correct, but you should be able to see the same result by setting <preference name="BackupWebStorage" value="local" /> in config.xml. Can you confirm that?

mparpaillon commented 9 years ago

I can confirm that the bug still exists even with BackupWebStorage set to local or none in config.xml Changing the line proposed by @natew doesn't seem to fix it. Commenting the 2 blocks of code doesn't either apparently.

natew commented 9 years ago

@mparpaillon I definitely stopped seeing the warning in the XCode console once I did that.

But no it didn't respect my config file.

mparpaillon commented 9 years ago

The warning may be gone but did you take a look at the iCloud Settings ? I described here the process to test the BackupWebStorage behavior: https://issues.apache.org/jira/browse/CB-8327

That's where Apple looks when they validate (or reject) your application.

That's what I tested when I commented the 2 blocks of code. Without WKWebView plugin I have like 70kb of content in there. When I install the plugin it goes up to 1.1Mb

natew commented 9 years ago

Didn't look at any settings.

But, for the record my app was accepted :+1: maybe because I don't use much data.