Skip to content

Conversation

@alexgerardojacinto
Copy link
Collaborator

@alexgerardojacinto alexgerardojacinto commented Jul 28, 2025

Description

  • Migrates back navigation on OSIABWebViewActivity.kt replacing the deprecated onBackPressed override with onBackPressedDispatcher and OnBackPressedCallback, following the recommendation from the Android 16 Behaviour Changes documentation page.
  • Also enables predictive back navigation on when closing the WebView on OSIABWebViewActivity.kt for Android 13+.
  • Also updates the library to Android 16 (API 36) - targetSdk and compileSdk updated.
  • And also updates other versions: Kotlin, AGP, Gradle.

Context

References: https://outsystemsrd.atlassian.net/browse/RMET-4335

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Platforms affected

  • Android
  • iOS
  • JavaScript

Tests

MABS 11 build

MABS 10 build

No MABS 12 build yet because the Capacitor plugin wasn't updated yet. There should be no differences though, because all the changes are done here at the library side.

Instructions on how to test:

  1. Start by testing the plugin with an Android 15 build by simply using the MABS build or building your own.
  2. Use the openInWebView client action using our InAppBrowser Sample App and test the back button navigation. Test clicking/gesturing the back button right after opening the WebView, which should close the WebView and return to the sample app screen. Also test navigating inside the WebView to other URLs, and then clicking/gesturing the back button to go back in the URLs.
  3. Also test the predictive back navigation animation that should occur when closing the WebView with the back button gesture.
  4. Then, to test the plugin with an Android 16 build (an app targeting Android 16), since there is currently no MABS version available that targets Android 16, you need to do that yourself.
  5. Download the source code for the build and open it on Android Studio
  6. Update the app to Android 16: This includes changing targetSdk, compileSdk in the app-level Gradle file, then possibly also updating the AGP version in the project-level Gradle file and the Gradle version in gradle-wrapper.properties.
  7. Test the plugin / app again, and confirm that the behaviour remains the same - clicking/gesturing the back button has the correct behaviour.

Screenshots / Screen recordings (if appropriate)

Predictive back navigation animation

screen-20250729-150328.1.mp4

Checklist

  • Pull request title follows the format RNMT-XXXX <title>
  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

@cssecautomation
Copy link

cssecautomation commented Jul 28, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

@alexgerardojacinto
Copy link
Collaborator Author

Note about Unit-Tests check failing: The tests are passing, but our SonarCloud configuration is broken and the check fails when it tries to send the test results to SonarCloud.

Context: If it is false, it means we want to simply close the WebView and not navigate to the previous URL. This means that we can simply use predictive back navigation instead of handling this case in the `onBackPressedCallback`

References: https://outsystemsrd.atlassian.net/browse/RMET-4335
@alexgerardojacinto alexgerardojacinto merged commit 67e46a1 into main Jul 30, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants