Skip to content

feat(android): open ordinary web links in default browser's Custom Tabs (1.28, #241) - #5357

Merged
stamp-build[bot] merged 1 commit into
release/1.28.0from
agent/reef/android-custom-tabs-default-128
Nov 22, 2026
Merged

stamp-build[bot] merged 1 commit into
release/1.28.0from
agent/reef/android-custom-tabs-default-128

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Reef (raft) opened via Stamp · View →


Summary

Implements #proj-mobile:#241 Option B on Android for release/1.28.0 (verified by artin on both HarmonyOS/Huawei 卓易通 and native Android):

  • Android-only change — zero iOS or shared files touched, no debug comparison switch.
  • Default browser Custom Tabs: When opening an ordinary HTTP(S) web link (!inBrowser, mimeType == null) on Android, Raft resolves the system default browser (https://example.com/) and checks whether that same default browser advertises android.support.customtabs.action.CustomTabsService.
    • If yes, opens it in Custom Tabs explicitly bound via setPackage(defaultBrowser) on top of the active Activity (preserving browser cookies/login state and returning straight to Raft on back/close).
    • If the default browser does not support Custom Tabs, or no default browser is selected (e.g. "android" resolver), or Custom Tabs launch fails, falls back cleanly to the existing default browser (externalUrlIntent -> openInAppBrowserFallback). Never leaves the Custom Tabs intent unbound (avoiding HarmonyOS's barebones built-in browser) and never hijacks to a non-default browser.
  • Preserves existing boundaries:
    • Apps entries and App cards keep opening in the in-app WebView untouched.
    • Explicit full-browser requests (inBrowser = true, e.g. passkey login, OAuth sign-in, Raft web pages outside App Links, APK update links) keep using externalUrlIntent.
  • Changeset: Added change-logs/1.28.0/changesets/android-custom-tabs-default-browser.md (zh-CN / en / ja).

Changes

  • compose/androidApp/src/main/AndroidManifest.xml: declare <queries> entry for android.support.customtabs.action.CustomTabsService.
  • compose/androidApp/src/main/java/build/raft/app/MainActivity.kt: add shouldPreferDefaultCustomTabs, selectDefaultCustomTabsBrowserPackage, and androidDefaultCustomTabsIntent.
  • compose/androidApp/src/main/java/build/raft/app/shared/RaftCmpActivity.kt: try default-browser Custom Tabs in RaftBridgeModule.openUrl before falling back to externalUrlIntent.
  • compose/androidApp/src/test/java/build/raft/app/MainActivityLaunchTest.kt: add unit tests covering default-browser binding, fallback when default lacks Custom Tabs, "android"/null/Raft default rejection, and eligibility gates (inBrowser, mimeType, schemes).
  • change-logs/1.28.0/changesets/android-custom-tabs-default-browser.md: release notes changeset.

Testing

  • python3 scripts/ci/check_source_constraints.py passed.
  • Hosted Android CI (Android compile & tests, including new MainActivityLaunchTest cases).
  • Real-device verified by artin on Huawei HarmonyOS (卓易通) and native Android via alpha comparison build 35437d68ab (Option B).

@stamp-build
stamp-build Bot merged commit f6aacfe into release/1.28.0 Nov 22, 2026
8 of 9 checks passed
stamp-build Bot added a commit that referenced this pull request Nov 22, 2026
…anges (#5358)

- Fixed (Android, iOS): runtime sign-in keeps its code dialog across the browser
  return (#5350, Hands 420d13cb); its changeset was missing, added here.
- Improved (Android): links that open in the default browser use its Custom Tabs
  when it has them (#5357, #241 option B, from that PR's changeset).

The other build-3 fixes (#5347 #5348 #5349 #5352) fix layout or regressions
inside 1.28 and need no note. Google Play's short notes are unchanged (491/500).

Co-authored-by: Lagoon <raft+lagoon@agents.stamp.build>
stamp-build Bot added a commit that referenced this pull request Nov 22, 2026
…bs (#241, forward-port #5357) (#5359)

Co-authored-by: Reef <raft+reef@agents.stamp.build>
stamp-build Bot added a commit that referenced this pull request Nov 23, 2026
…28 leave 1.29 (#5436)

Release SOP §9 merge-back for 1.28.0 (tag v1.28.0 = release/1.28.0 b44ffca; Android Play
production 12800012 since 11-22 18:15Z, iOS App Store since 11-23 02:19Z).

- change-logs/1.28.0 now equals the tag: the Android, iOS and Google Play release notes
  (en, ja, zh-CN) and the 9 changesets of fixes back-ported into 1.28 after the cut
  (#5302 #5303 #5305 #5306 #5308 #5310 #5319 via #5325, #5350, #5357).
- The 7 of those that main also listed under 1.29.0 move to 1.28.0, so the 1.29 notes
  do not announce them again.

Code: every release-branch fix is already on main (forward-ports #5327 #5335 #5337 #5356
#5359 #5361 #5364; #5328's Robolectric mirror is in compose/build.gradle.kts). #5363 only
adapted two 1.28 tests to the release branch's AuthSessionClearReason name; main keeps its own.
`git diff v1.28.0 -- change-logs/1.28.0` is empty on this branch.

Co-authored-by: Lagoon <raft+lagoon@agents.stamp.build>
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.

0 participants