Navigating back from other app breaks click handler

#1

Hi,

For our company we have a lot of devices rolled out with Mobicontrol Soti. This allows us to lock the device in something called a kiosk mode which disables the use of the homescreen and provides a custom screen that only have a set off apps we can decide.

One of the provided apps is a Ionic app that opens links in a browser (Soti Surf) but this gives 2 problems.

code

HTML:

<div (click)="$ctrl.doTheThing()"> something </div>

JS:

private doTheThing() {
    this.inAppBrowser.create('surfs://' + url.replace(/^(https?:|)\/\//, ''), '_system');
}

First issue

First of all when I use the android back button the click doesn’t seem to work anymore (I’ve put an alert in the first line of the doTheThing function, but nothings shows up).
Other buttons in the app seem to work just fine, when using the switch app button it also works

I tried:

  • preventDefault()
  • stopPropagation(),
  • using the tappable attribute
  • (tap) instead of (click)

but none seem to work. Does anybody have an idea for fixing this?

Second issue

Note: this is less important
When opening a link it remembers the last page(in soti surf) so by using the back arrow it first navigates to the last link and when it has no more back locations it goes back to the app

I tried:

  • using the return value of the inAppBrowser.create() and calling close() when returning to my app

Version info

@ionic-native/core version: 4.16.0
cordova-android: 7.1.4
cordova -v: 8.1.2 (cordova-lib@8.1.1)
npm -v: 6.4.1
ionic: 4.12.0
nodeJS: 11.1.0