apache / apache/cordova-plugin-inappbrowser

exit event is handled in ios diferently than in android

Open
#649 7 comments 1 reaction 0 assignees View on GitHub
bug platform: ios
Dominant language
Java
Stars
1.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem

Event `exit` is triggered in Android every time browser is closed - so if it is closed with `browser.close()` or if it is closed via "Done" button in footer.

In iOS this event is triggered ONLY when a user clicks "Done" button, but it does not trigger when `browser.close()` is called.

### What is expected to happen?

Both platforms should handle it the same way - in my opinion, Android way of implementing it is the correct one.

### What does actually happen?

Already described above.

### Command or Code
```
import { Injectable } from '@angular/core';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';

@Injectable()
export class Demo {

constructor(private iab: InAppBrowser) {}

public runBrowser(url) {

const browser = this.iab.create(url, '_blank', { usewkwebview: 'yes', hidden: 'yes' });

browser.on('loadstop').subscribe(async event => {
//this will not trigger exit event on ios, while on android it will
browser.close();
});

browser.on('exit').subscribe(event => {
console.log("exit");
});
}
}
```

### Environment, Platform, Device
Android 9, iOS 13

### Version information

```
"cordova": "^9.0.0",
"cordova-android": "^8.1.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-inappbrowser": "^3.2.0",
```

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the sample using browser.close(), browser.on('loadstop'), and browser.on('exit') on Android 9 and iOS 13 with cordova-plugin-inappbrowser 3.2.0. Compare the native exit-event handling on both platforms; done means browser.close() and the iOS Done button produce the same exit behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, objective-c
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.