InAppBrowser loadstart not firing in ionic 4

Hi there,

I am using Ionic 4 beta and the InAppBrowser to display a login page (identityserver).

I have installed @ionic-native/in-app-browser/beta (6.4.1) and
import { InAppBrowser, InAppBrowserOptions } from '@ionic-native/in-app-browser/ngx'

I use the following options

options : InAppBrowserOptions = {
    location : 'no',
    hidden : 'no', 
    clearcache : 'yes',
    clearsessioncache : 'yes',
    zoom : 'yes',
    hardwareback : 'yes',
    mediaPlaybackRequiresUserAction : 'no',
    shouldPauseOnSuspend : 'no', 
    closebuttoncaption : 'Close'
    disallowoverscroll : 'no',
    toolbar : 'yes', 
    enableViewportScale : 'no', 
    allowInlineMediaPlayback : 'no',
    presentationstyle : 'pagesheet',
    fullscreen : 'yes',
};

I am attempting to subscribe to the ‘loadstart’ event but it never appears to be firing. ‘loadstop’ and ‘exit’ are working perfectly.

I’ve simplified the code to this for debugging purposes.

const browser = this.theInAppBrowser.create(oauthUrl,'_blank', this.options);
      
      browser.on('loadstart').subscribe(event => {
        alert('loadstart');
      }, err => {
        alert("InAppBrowser loadstart Event Error: " + err);
      });   
      
      browser.on('loadstop').subscribe(event => {
        alert('loadstop');
      }, err => {
        alert("InAppBrowser loadstop Event Error: " + err);
      });

      browser.on('exit').subscribe((event) => {
        alert('exit');
      }, err => {
        alert("InAppBrowser exit Event Error: " + err);
      });

I’ve changed the url and navigated around, again loadstop fires, loadstart does not.

I am running locally using ionic cordova run browser

Have I missed something obvious?

Thanks in advance!

Mike

Hi Mike,

Did you find any solution ?

Hello,

I have a same problem.

Did you find any solution

Updating plugins to newer versions solved this to me. You will need to actually remove existing ones and re-add them.

Here’s what I did:

  1. Removed the plugins from the plugins folder.
  2. I examined package.json and researched for latest and modified versions.
  3. I also had to ensure that the were listed in the config.xml (latest version)
  4. (Build it with) ionic cordova prepare ios.

Specifically for me I was using the xcode ios simulator and as I understand this may have to do with removing UIWebView calls and replacing them with WKWebView. UIWebView is now deprecated.

Heres a snippet from the bottom of my config.xml:

<plugin name="cordova-plugin-device" spec="^2.0.3" />
    <plugin name="cordova-plugin-inappbrowser" spec="^4.0.0" />
    <plugin name="cordova-plugin-splashscreen" spec="^6.0.0" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4,2,1" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.3" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.2" />
    <engine name="ios" spec="^5.1.1" />