cordova-plugin-themeablebrowser icon indicating copy to clipboard operation
cordova-plugin-themeablebrowser copied to clipboard

How to replace UIWebview into Wkwebview

Open rigorin opened this issue 6 years ago • 18 comments

rigorin avatar Nov 12 '18 03:11 rigorin

Bump

alphagamer7 avatar Apr 25 '20 19:04 alphagamer7

Is there a solution for this?

anthonnyc2 avatar Apr 29 '20 21:04 anthonnyc2

Is there a solution for this?

DocGreenRob avatar May 08 '20 19:05 DocGreenRob

Is there a solution for this , getting themeable browser to use the wkwebview?

Moseskhan avatar May 08 '20 19:05 Moseskhan

he following build commands failed: ``` ../platforms/ios/MyPad/Plugins/cordova-plugin-themeablebrowser/CDVThemeableBrowser.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) ``unknown type name 'CDVUIWebViewDelegate'

This is the error that am getting when doing a build with themeablebrowser plugin installed for ios after updating to wkWebView

Moseskhan avatar May 08 '20 19:05 Moseskhan

https://forum.ionicframework.com/t/ionic-4-uiwebview-references/179170/3

Add 1 line to config.xml:

<platform name="ios">
        <preference name="WKWebViewOnly" value="true" />  // <--- this line

chegewara avatar May 10 '20 21:05 chegewara

We already implemented that in our config.xml.The problem is when we have the themeable browser added to plugins , the build faills with "`unknown type name 'CDVUIWebViewDelegate' since the themeablebrowser has not been updated to use WkWebView. The question is, How can we update the themeable browser to use WkWebView instead of UIWebView, or which other implementation of showing a browser window with custom buttons i.e with listeners to dropdown custom menu?

Moseskhan avatar May 11 '20 15:05 Moseskhan

@chegewara @anthonnyc2 @alphagamer7 @rigorin we have fixed the problem... @Moseskhan will share the results... hope it helps... thanks to @Appswage ... from Upwork!!! ... https://www.upwork.com/freelancers/~01bc53d88b1c329db5 ....

DocGreenRob avatar May 14 '20 18:05 DocGreenRob

To get this working we edited files in plugins/cordova-plugin-themeable/src/ios i.e the CDVThemeablebrowser.h and CDVThemeablebrowser.m .

Replace the files with the attached files.

CDVThemeableBrowser.zip

Moseskhan avatar May 14 '20 18:05 Moseskhan

Thanks for sharing :)

alphagamer7 avatar May 14 '20 18:05 alphagamer7

The updates was specific and surgical to force WKNavigationDelegate to fire when a page is loaded and for the current URL to be captured. Other delegates still require implementation if needed. Please also note that UIWebView delegation will no longer work so the specific fix found in the files attached above are directed at WKWebView users only.

Appswage avatar May 14 '20 18:05 Appswage

Thanks for sharing the solution it will surely help.

numanhaider05 avatar May 14 '20 20:05 numanhaider05

@Moseskhan thanks for sharing the code. But I have an issue, it seems like the URL is not getting update correctly. I have some listeners when 'loadstart' and 'loadstop', so I track the URL and is returning some weird values. Where can I check/fix that?

anthonnyc2 avatar May 21 '20 15:05 anthonnyc2

Thank you for sharing the source code. I have made the following modifications and additions to the source code I received. ・Merging changes made with a fork https://github.com/grexican/cordova-plugin-themeablebrowser ・Added option to enable swipe back / forward history.(iOS only) ・Fixed a bug that is not displayed in full screen. ・Fixed a bug that the link of new window cannot be displayed. ・Fixed a bug that loadstart,message event does not work. ・Fixed a bug that enableviewportscale and mediaplaybackrequiresuseraction properties do not work.

Not fully tested, but if you are interested please see my fork. https://github.com/NohohonNohon/cordova-plugin-themeablebrowser

NohohonNohon avatar May 24 '20 06:05 NohohonNohon

@NohohonNohon thanks for sharing code but this plugin is not working with cordova ios 6.1.0 can u please help

chaitanyagupta76 avatar Jun 30 '20 12:06 chaitanyagupta76

Can anyone help on this plugin please I am using cordova 6.1.0. Having issues with user agent

chaitanyagupta76 avatar Jun 30 '20 12:06 chaitanyagupta76

@chaitanyagupta76 I fixed it to work with cordova-ios >6.0.0 on my fork.

NohohonNohon avatar Jul 04 '20 12:07 NohohonNohon

@chaitanyagupta76 -same issue, got any solution?

pcrajas avatar Aug 08 '20 10:08 pcrajas