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

usewkwebview=yes not working #543

Closed
3 tasks done
jacobweber opened this issue Oct 1, 2019 · 6 comments
Closed
3 tasks done

usewkwebview=yes not working #543

jacobweber opened this issue Oct 1, 2019 · 6 comments

Comments

@jacobweber
Copy link

Bug Report

Problem

What is expected to happen?

Opening an in-app browser with usewkwebview=yes works, when cordova-plugin-wkwebview-engine is installed.

What does actually happen?

Fails with an error in the Xcode console. Works when usewkwebview=yes is removed.

Information

See below.

Command or Code

cordova create CordovaTest com.test.cordovatest CordovaTest
cd CordovaTest
cordova platform add ios@5.0.1
cordova plugin add https://github.com/apache/cordova-plugin-wkwebview-engine#master
cordova plugin add cordova-plugin-inappbrowser@3.1.0
cordova prepare

Open in Xcode, select development team, and run.

Inspect in Safari debugger, and run command below in console. No browser appears. Running a second time shows a different error:

window.cordova.InAppBrowser.open('https://www.google.com', '_blank', 'usewkwebview=yes')

Logs in Xcode:

2019-10-01 12:56:17.237730-0700 CordovaTest[3922:1048426] Apache Cordova native platform version 5.0.1 is starting.
2019-10-01 12:56:17.237824-0700 CordovaTest[3922:1048426] Multi-tasking -> Device: YES, App: YES
2019-10-01 12:56:17.248898-0700 CordovaTest[3922:1048426] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file
2019-10-01 12:56:17.352118-0700 CordovaTest[3922:1048426] CDVWKWebViewEngine will reload WKWebView if required on resume
2019-10-01 12:56:17.352175-0700 CordovaTest[3922:1048426] Using WKWebView
2019-10-01 12:56:17.352315-0700 CordovaTest[3922:1048426] [CDVTimer][console] 0.029087ms
2019-10-01 12:56:17.352390-0700 CordovaTest[3922:1048426] [CDVTimer][handleopenurl] 0.036001ms
2019-10-01 12:56:17.353113-0700 CordovaTest[3922:1048426] [CDVTimer][intentandnavigationfilter] 0.689983ms
2019-10-01 12:56:17.353176-0700 CordovaTest[3922:1048426] [CDVTimer][gesturehandler] 0.024915ms
2019-10-01 12:56:17.353227-0700 CordovaTest[3922:1048426] [CDVTimer][inappbrowser] 0.023007ms
2019-10-01 12:56:17.353567-0700 CordovaTest[3922:1048426] [CDVTimer][uiinappbrowser] 0.293970ms
2019-10-01 12:56:17.354531-0700 CordovaTest[3922:1048426] [CDVTimer][wkinappbrowser] 0.826001ms
2019-10-01 12:56:17.354573-0700 CordovaTest[3922:1048426] [CDVTimer][TotalPluginStartup] 2.315044ms
2019-10-01 12:56:17.432681-0700 CordovaTest[3922:1048426] IAB.close() called but it was already closed.
2019-10-01 12:56:17.432906-0700 CordovaTest[3922:1048426] IAB.close() called but it was already closed.
2019-10-01 12:56:17.483224-0700 CordovaTest[3922:1048426] Received Event: deviceready

# first time running open command:
2019-10-01 12:56:43.137186-0700 CordovaTest[3922:1048426] THREAD WARNING: ['InAppBrowser'] took '22.002930' ms. Plugin should use a background thread.
2019-10-01 12:56:43.245525-0700 CordovaTest[3922:1048426] No
2019-10-01 12:56:43.245761-0700 CordovaTest[3922:1048426] didStartProvisionalNavigation
2019-10-01 12:56:43.718240-0700 CordovaTest[3922:1048426] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x15611dae0>.

# second time running open command:
2019-10-01 12:56:45.844997-0700 CordovaTest[3922:1048426] Tried to show IAB while already shown
2019-10-01 12:56:45.853075-0700 CordovaTest[3922:1048426] No
2019-10-01 12:56:45.853764-0700 CordovaTest[3922:1048426] didStartProvisionalNavigation

Environment, Platform, Device

iOS 13.1.1, iPhone XR

Version information

Cordova CLI 9.0.0
Xcode 11.0, Mac OS 10.14.6

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@maxtacco
Copy link

maxtacco commented Oct 1, 2019

We are experiencing exactly the same issue when using cordova-plugin-ionic-webview v2.5.2

Environment, Platform, Device
iOS 13.1.2, iPhone 6S

Version information
Cordova CLI 9.0.0
Xcode 11.0 (11A420a), Mac OS 10.14.6

@EmeryGuillaume
Copy link

Hello,
I'm experiencing the same issue. This was not happening when I was using the iOS 12 SDK (works with Xcode 10.x, doesn't work with Xcode 11)

@Stephane84
Copy link

Stephane84 commented Oct 14, 2019

Hello,
same here. I have an ionic3 app, and, the latest version of cordova-plugin-ionic-webview 4.1.2 and inAppBrowser 3.1.0. Build the app with Xcode11 and with the option usewkwebview, the opening of an inAppBrowser display it and close it instantanly. With Xcode 10, no pb

To reproduce :

ionic start (choose a name, a template, set yes to add cordova, and no pour ionic dev tool)
ionic cordova platform add ios@5.0.1
ionic cordova plugin add cordova-plugin-ionic-webview@4.1.2
ionic cordova plugin add cordova-plugin-inappbrowser@3.1.0
npm install @ionic-native/in-app-browser

In app.module.ts add "InAppBrowser" in the providers
In app.component.ts add InAppBrowser in the constructor, and the create to open the iab when device ready :

constructor(private iab: InAppBrowser) {
this.iab.create('https://www.google.fr/', "_blank", "usewkwebview=true");

Launch in an emulator with Xcode11, on ios13 terminal. It's ko
On ios12 terminal, it is ok.

With cordova-plugin-ionic-webview version in 2.5.2 or 3.1.2 (older last stable), it's the same.

Last thing, at the begining, i was using cordova-plugin-ionic-webview 1.2.1 and inappbrowser 2.0.2. Without the usewkwebview option, the result was the same, when build with xcode11, and testing on ios13 only, the inappbrowser opened and closed just after. That's why i upgraded those 2 plugins, and try to set usewkwebview, because of the Apple Warning mail when using code containing UiWebview.
With the latest versions, without usewkwebview=true, it works, but preparing the future with WkWebview because of a probably removal of uiWebView, i'd prefer to usewkwebview now...

@ebk46
Copy link

ebk46 commented Oct 16, 2019

I am having this problem as well, albeit possibly for a different reason. I am using Capacitor which already uses WKWebView and, for that reason, does not allow me to install cordova-plugin-webview or cordova-plugin-wkwebview-engine. That said, since others are having this issue, this may not be relevant.

@jcesarmobile
Copy link
Member

Should be fixed by #534

@gelinger777
Copy link

can somebody hint what exactly should we put in config.xml and where so that we activate this feature in ios for ionic?

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

7 participants