apache / cordova-plugin-wkwebview-engine

[DEPRECATED] Apache Cordova wkwebview engine plugin
Apache License 2.0
610 stars 360 forks source link

WKWebView doesn't react on clicks (iframe) while UIWebView does - iOS #98

Closed bozzzi closed 1 year ago

bozzzi commented 5 years ago

Issue Type

Description

WKWebView doesn't react on clicks (iframe) while UIWebView does Similar question: https://stackoverflow.com/questions/51175746/wkwebview-doesnt-react-on-clicks-while-uiwebview-does?answertab=oldest#tab-top

Information

Steps to reproduce:

  1. Create new cordova project
  2. Test it on UIWebView - It's working
  3. Test it on WKWebView - not working

Command or Code

cordova create hello com.example.hello HelloWorld
cd HelloWorld
cordova platform add ios

Open project in Xcode and change receivedEvent: function from index.html file accordingly (Just adding simple DFP add - js api)

receivedEvent: function(id) {
                googletag.cmd.push(function() {
            googletag.defineSlot('/271507443/patuljak-aplikacija-b2', 
            [300, 250],
            'here').addService(googletag.pubads()).setCollapseEmptyDiv(true);

            googletag.pubads().enableSingleRequest();
            googletag.enableServices();
            googletag.display('here');
        });
}

create empty div in body of index.html file

<div id="here"></div>

Add to head of index.html file

<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
  <script>
    var googletag = googletag || {};
    googletag.cmd = googletag.cmd || [];
  </script>

Run project in xcode... Everything should be running fine in UIWebView.

Now, add WKWebView plugin

cordova plugin add cordova-plugin-wkwebview-engine

After successful installation, you should have, inside config.xml file:

<feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> 

Run project again, it is not possible to click on add in WKWebView

If wkwebview plugin removed everything works fine again. Working OK in browser too.

Environment, Platform, Device

Version information

Checklist

ahmadwaliesipick commented 5 years ago

facing same issue did you find any solution?

phiasco12 commented 4 years ago

same issue here... any solution to this... I'm just using normal:

$(document).on('click','element',function(e){
.....

});
bozzzi commented 4 years ago

try this

Fix

fukemy commented 4 years ago

try this

Fix

hi, can you tell me how to fix? Im using CDVViewController then got the same above error

touficy commented 4 years ago

facing same issue did you find any solution?

hi ahmad did you find solution for this issue

jcesarmobile commented 1 year ago

We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution.