Skip to content

Commit

Permalink
Merge pull request #31 from OutSystems/development
Browse files Browse the repository at this point in the history
RMET-3684 - Prepare to release version `1.0.2`
  • Loading branch information
alexgerardojacinto authored Oct 16, 2024
2 parents b40b9da + 727a8c2 commit d43c1ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.0.2

### Fixes
- Fix issue where the custom tabs browser wasn't being closed when navigating back to the app (https://outsystemsrd.atlassian.net/browse/RMET-3684)
- Fix race condition that caused the `BrowserFinished` event to not be fired in some instances with the system browser.

## 1.0.1

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.outsystems</groupId>
<artifactId>osinappbrowser-android</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class OSIABCustomTabsSessionHelper: OSIABCustomTabsSessionHelperInterface {
}

override fun onServiceDisconnected(name: ComponentName) {
context.unbindService(this)
customTabsSessionCallback(null)
}
}
Expand All @@ -60,6 +61,8 @@ class OSIABCustomTabsSessionHelper: OSIABCustomTabsSessionHelperInterface {
) : CustomTabsCallback() {

private var isCustomTabsActivityOnTop = false
private var pendingTabHiddenEvent = false

init {
var browserEventsJob: Job? = null

Expand All @@ -68,9 +71,16 @@ class OSIABCustomTabsSessionHelper: OSIABCustomTabsSessionHelperInterface {
when (event.action) {
OSIABCustomTabsControllerActivity.EVENT_CUSTOM_TABS_RESUMED -> {
isCustomTabsActivityOnTop = true
if (pendingTabHiddenEvent) {
pendingTabHiddenEvent = false
lifecycleScope.launch {
OSIABEvents.postEvent(OSIABEvents.BrowserFinished(browserId))
}
}
}
OSIABCustomTabsControllerActivity.EVENT_CUSTOM_TABS_PAUSED -> {
isCustomTabsActivityOnTop = false
pendingTabHiddenEvent = false
}
OSIABCustomTabsControllerActivity.EVENT_CUSTOM_TABS_DESTROYED -> {
browserEventsJob?.cancel()
Expand All @@ -89,6 +99,7 @@ class OSIABCustomTabsSessionHelper: OSIABCustomTabsSessionHelperInterface {
}
else {
// App not open but custom tabs is hidden (home button, recent apps, etc.)
pendingTabHiddenEvent = true
return
}
}
Expand Down

0 comments on commit d43c1ed

Please sign in to comment.