Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for [email protected] #6

Closed
nintendowii111 opened this issue Jun 2, 2020 · 19 comments
Closed

Fix for [email protected] #6

nintendowii111 opened this issue Jun 2, 2020 · 19 comments

Comments

@nintendowii111
Copy link

Needs to be updated for new Cordova iOS release!

@kokitang
Copy link

kokitang commented Jun 3, 2020

Just update all CDVWKWebViewEngine to CDVWebViewEngine, and set the CDVWebViewEngine.h in CordovaLib.xcodeproj from Private to Public

@jay34fr
Copy link

jay34fr commented Jun 6, 2020

Hi all,
I also need this plugin to be compatible with Cordova [email protected].
Without this plugin, I have a white screen after the splash screen...

@jay34fr
Copy link

jay34fr commented Jun 6, 2020

Just update all CDVWKWebViewEngine to CDVWebViewEngine, and set the CDVWebViewEngine.h in CordovaLib.xcodeproj from Private to Public

Hi @kokitang , please, how did you do that ? Directly in the plugin ? In Xcode ? In my app code ?
Thx in advance for your help.

@kokitang
Copy link

kokitang commented Jun 9, 2020

@jay34fr

For

Just update all CDVWKWebViewEngine to CDVWebViewEngine

You can do it directly in the plugin or in Xcode.
Doing it in the plugin you may need to clone the repository and change the config.xml to let Cordova use your local plugin instead of the plugin on npm. But, be noticed, using the local plugin will lead to the loss of further updates of the plugin.
Doing it in Xcode is the quickest way but you will lose the changes if you reinstall the platform/plugin.

and for

set the CDVWebViewEngine.h in CordovaLib.xcodeproj from Private to Public

You can do this in Xcode, and the changes will lose when reinstall/update the ios platform.

@jay34fr
Copy link

jay34fr commented Jun 9, 2020

Thx @kokitang for your answer.
So for the change in the plugin I just need to rename :

	<header-file src="src/ios/CDVWKWebViewEngine+FileXhrFix.h" />
	<source-file src="src/ios/CDVWKWebViewEngine+FileXhrFix.m" />

to

	<header-file src="src/ios/CDVWebViewEngine+FileXhrFix.h" />
	<source-file src="src/ios/CDVWebViewEngine+FileXhrFix.m" />

in the plugin.xml

Then I have to rename both files in src/ios and to edit them ?

Thx again.

@kokitang
Copy link

kokitang commented Jun 17, 2020

@jay34fr
Sorry for the late response, you also need to replace all occurrence of CDVWKWebViewEngine to CDVWebViewEngine in the plugin's .h&.m sourcecode.

E.g.
In CDVWebViewEngine+FileXhrFix.m (if you changed the name), change
@implementation CDVWKWebViewEngine (FileXhrFix)
to
@implementation CDVWebViewEngine (FileXhrFix)

and do it in the same way in other occurrences.

@jay34fr
Copy link

jay34fr commented Jun 17, 2020

Thx again !
I will give a try asap.

@cfremgen
Copy link

@jay34fr
Sorry for the late response, you also need to replace all occurrence of CDVWKWebViewEngine to CDVWebViewEngine in the plugin's .h&.m sourcecode.

E.g.
In CDVWebViewEngine+FileXhrFix.m (if you changed the name), change
@implementation CDVWKWebViewEngine (FileXhrFix)
to
@implementation CDVWebViewEngine (FileXhrFix)

and do it in the same way in other occurrences.

This solution does not work, since it requires cordova-plugin-wkwebview-engine which is no longer supported.

https://cordova.apache.org/announcements/2020/06/01/cordova-ios-release-6.0.0.html

Due to this change, the cordova-plugin-wkwebview-engine plugin is obsolete and will not work with this release. If you have this plugin installed, it is safe to remove with cordova plugin remove cordova-plugin-wkwebview-engine.

Fundamentally this plugin needs to change to toggle the settings:
allowFileAccessFromFileURLs
allowUniversalAccessFromFileURLs

On the native Cordova WKWebView.

@jay34fr
Copy link

jay34fr commented Jun 29, 2020

I think the developer is not working on this plugin anymore.... maybe someone will work on a fork one ?

@TheMattRay
Copy link
Owner

TheMattRay commented Jun 29, 2020 via email

@lehizojie
Copy link

I am working on a fork for this. I am happy to take it on if no one has already. Let me know.

@jay34fr
Copy link

jay34fr commented Jul 12, 2020

Thx in advance @lehizojie !

@lovelyelfpop
Copy link

lovelyelfpop commented Jul 15, 2020

How to set the CDVWebViewEngine.h in CordovaLib.xcodeproj from Private to Public?
Am I doing it wrong? @lehizojie
截屏2020-07-15 上午7 01 33

@kokitang
Copy link

@lovelyelfpop You already set it to public

@TheMattRay
Copy link
Owner

Here is this one that the guy copied and worked on: https://github.com/globules-io/cordova-plugin-ios-xhr

Wish he had forked and submitted a PR but /shrug

@globules-io
Copy link

globules-io commented Jul 16, 2020

Sorry @TheMattRay, was in a hurry and couldn't adapt your plugin to work . Hence the merge over a new name. If you ever fix this plugin and add

 <preference name="allowFileAccessFromFileURLs" value="true|false" />
 <preference name="allowUniversalAccessFromFileURLs" value="true|false" />

I'll then kill this plugin... Besides, there is none of your original code remaining...

@Mapiac
Copy link

Mapiac commented Aug 5, 2020

@globules-io @TheMattRay @kokitang @lehizojie @jay34fr
Just a heads up you might use the seemingly far more maintained and active Ionic wkwebview plugin (we don't use Ionic but we use the plugin). Any reason you all don't? Want to save you some time here if I can

@AraHovakimyan
Copy link

AraHovakimyan commented Aug 24, 2020

Fix for Cordova iOS 6.x.x+

cordova plugin add https://github.com/AraHovakimyan/cordova-plugin-wkwebviewxhrfix

It works fine for me.

@TheMattRay
Copy link
Owner

Don’t forget - anyone can submit a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants