google / cordova-plugin-browsertab

A Cordova plugin that provides an interface to in-app browser tabs that exist on some mobile platforms, such as SFSafariViewController on iOS and CustomTabs on Android.
Apache License 2.0
117 stars 147 forks source link

Event notification if user closes the browser tab #23

Open jasonwinshell-br opened 6 years ago

jasonwinshell-br commented 6 years ago

Is there a way to get an event notification back in my Cordova app if the user explicitly closes the browser tab -- i.e. by clicking "Done" button in Safari tab , or [X] close box in Chrome Tab?

Thanks

Rattone commented 4 years ago

no reply?

jasonwinshell-br commented 4 years ago

Nope.

Sir-Will commented 4 years ago

Anyone found a solution for this?

dahLucky commented 3 years ago

I had a workaround (Android only) that worked without touching the plugin. BrowserTabs will pause the app so you can subscribe to cordova's platform "resume" event. I set a variable when loading the browserTab which I utilised in combination with the resume event to check if a BrowserTab was closed.

I recently migrated to Eddy Verbruggen SafariViewController that actually implements observables for open, loaded and closed.