initialxy / cordova-plugin-themeablebrowser

Fork of org.apache.cordova.inappbrowser in an attempt to make it a bit more themeable and configurable to add some custom actions.
Apache License 2.0
294 stars 221 forks source link

How to replace UIWebview into Wkwebview #187

Open rigorin opened 5 years ago

alphagamer7 commented 4 years ago

Bump

anthonnyc2 commented 4 years ago

Is there a solution for this?

DocGreenRob commented 4 years ago

Is there a solution for this?

Moseskhan commented 4 years ago

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

Moseskhan commented 4 years ago

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
chegewara commented 4 years ago

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
Moseskhan commented 4 years ago

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?

DocGreenRob commented 4 years ago

@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 ....

Moseskhan commented 4 years ago

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

alphagamer7 commented 4 years ago

Thanks for sharing :)

Appswage commented 4 years ago

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.

numanhaider05 commented 4 years ago

Thanks for sharing the solution it will surely help.

anthonnyc2 commented 3 years ago

@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?

NohohonNohon commented 3 years ago

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

chaitanyagupta76 commented 3 years ago

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

chaitanyagupta76 commented 3 years ago

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

NohohonNohon commented 3 years ago

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

pcrajas commented 3 years ago

@chaitanyagupta76 -same issue, got any solution?