title: InAppBrowser event handlers aren't firing: Ionic 5 + Angular 10 + Capacitor
body: <p>Here's code I added to a <code>blank</code> Angular+Capacitor starter project produced by Ionic's CLI (within <code>home.page.ts</code>):</p>
  <pre><code>  openInAppBrowser() {
      const exampleUrl = 'https://ionicframework.com/docs/components';
      const options: InAppBrowserOptions = {
        usewkwebview: 'yes'
      };
      const browser = this.iab.create(exampleUrl, '_blank', options);
      const eventTypes: InAppBrowserEventType[] = ['loadstart', 'loadstop', 'beforeload', 'exit', 'loaderror'];
      eventTypes.forEach(eventType =&gt; {
        browser.on(eventType).subscribe(event =&gt; {
          console.log(`Event ${eventType} fired!`); // Doesn't get here
          console.log(`URL: [${event.url}]`);       // or here (obviously).
          if (event.url &amp;&amp; event.url.includes('path-i-am-interested-in')) {
            // Do useful stuff...
          }
        });
      });
      console.log(`Browser object after subscription:`);
      console.log(browser);
    }
  </code></pre>
  <p>When I deploy this to an iPhone 11 simulator or tethered to my iPhone 11 through XCode, none of the <code>console.log</code> calls fire within the listener.</p>
  <p>I built an Ionic-Vue project with this code, and it works fine.  Why doesn't this work with Angular?</p>
  <p>Here's the pared-down repo with the full implementation:<br />
  <a href="https://bitbucket.org/aaronw322/ionic-inappbrowser-subscription/src/master/" rel="nofollow noreferrer">https://bitbucket.org/aaronw322/ionic-inappbrowser-subscription/src/master/</a></p>
  <p>The README outlines the steps I took to install/build it.</p>
  <p>Here are the logs from XCode's console after opening the InAppBrowser example site, clicking links, then pressing <code>Done</code> in the bottom corner of the InAppBrowser window (notice that none of the desired log output is shown):</p>
  <pre><code>To Native Cordova -&gt;  InAppBrowser open InAppBrowser694511092 [&quot;options&quot;: [https://ionicframework.com/docs/components, _blank, usewkwebview=yes]]
  2020-11-07 09:26:23.859892-0500 App[22260:325714] WF: _userSettingsForUser : (null)
  2020-11-07 09:26:23.860064-0500 App[22260:325714] WF: _WebFilterIsActive returning: NO
  ⚡️  [log] - Browser object after subscription:
  ⚡️  [log] - {&quot;_objectInstance&quot;:{&quot;channels&quot;:{&quot;beforeload&quot;:{&quot;type&quot;:&quot;beforeload&quot;,&quot;handlers&quot;:{},&quot;state&quot;:0,&quot;fireArgs&quot;:null,&quot;numHandlers&quot;:1,&quot;onHasSubscribersChange&quot;:null},&quot;loadstart&quot;:{&quot;type&quot;:&quot;loadstart&quot;,&quot;handlers&quot;:{},&quot;state&quot;:0,&quot;fireArgs&quot;:null,&quot;numHandlers&quot;:1,&quot;onHasSubscribersChange&quot;:null},&quot;loadstop&quot;:{&quot;type&quot;:&quot;loadstop&quot;,&quot;handlers&quot;:{},&quot;state&quot;:0,&quot;fireArgs&quot;:null,&quot;numHandlers&quot;:1,&quot;onHasSubscribersChange&quot;:null},&quot;loaderror&quot;:{&quot;type&quot;:&quot;loaderror&quot;,&quot;handlers&quot;:{},&quot;state&quot;:0,&quot;fireArgs&quot;:null,&quot;numHandlers&quot;:1,&quot;onHasSubscribersChange&quot;:null},&quot;exit&quot;:{&quot;type&quot;:&quot;exit&quot;,&quot;handlers&quot;:{},&quot;state&quot;:0,&quot;fireArgs&quot;:null,&quot;numHandlers&quot;:1,&quot;onHasSubscribersChange&quot;:null},&quot;customscheme&quot;:{&quot;type&quot;:&quot;customscheme&quot;,&quot;handlers&quot;:{},&quot;state&quot;:0,&quot;fireArgs&quot;:null,&quot;numHandlers&quot;:0,&quot;onHasSubscribersChange&quot;:null},&quot;message&quot;:{&quot;type&quot;:&quot;message&quot;,&quot;handlers&quot;:{},&quot;state&quot;:0,&quot;fireArgs&quot;:null,&quot;numHandlers&quot;:0,&quot;onHasSubscribersChange&quot;:null}}}}
  ⚡️  [log] - onscript loading complete
  ⚡️  WebView loaded
  2020-11-07 09:26:24.078843-0500 App[22260:325714] No
  2020-11-07 09:26:24.090239-0500 App[22260:325714] didStartProvisionalNavigation
  ⚡️  [log] - Angular is running in development mode. Call enableProdMode() to enable production mode.
  ⚡️  [log] - Ionic Native: deviceready event fired after 91 ms
  ⚡️  [warn] - Native: tried calling StatusBar.styleDefault, but the StatusBar plugin is not installed.
  ⚡️  [warn] - Install the StatusBar plugin: 'ionic cordova plugin add cordova-plugin-statusbar'
  ⚡️  [warn] - Native: tried calling SplashScreen.hide, but the SplashScreen plugin is not installed.
  ⚡️  [warn] - Install the SplashScreen plugin: 'ionic cordova plugin add cordova-plugin-splashscreen'
  2020-11-07 09:26:24.427205-0500 App[22260:325714] Unbalanced calls to begin/end appearance transitions for &lt;UIViewController: 0x7fa6c450df80&gt;.
  ⚡️  To Native -&gt;  App addListener 86862752
  2020-11-07 09:41:26.240739-0500 App[22260:325714] [assertion] Error acquiring assertion: &lt;Error Domain=RBSAssertionErrorDomain Code=3 &quot;Target is not running or required target entitlement is missing&quot; UserInfo={RBSAssertionAttribute=&lt;RBSDomainAttribute| domain:&quot;com.apple.webkit&quot; name:&quot;Background&quot; sourceEnvironment:&quot;(null)&quot;&gt;, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}&gt;
  2020-11-07 09:41:26.240903-0500 App[22260:325714] [ProcessSuspension] 0x10cc0ff00 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 22267, error: Error Domain=RBSAssertionErrorDomain Code=3 &quot;Target is not running or required target entitlement is missing&quot; UserInfo={RBSAssertionAttribute=&lt;RBSDomainAttribute| domain:&quot;com.apple.webkit&quot; name:&quot;Background&quot; sourceEnvironment:&quot;(null)&quot;&gt;, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
  </code></pre>