Skip to content

fix: allow unregistering the navigation delegate#336

Merged
hurali97 merged 6 commits into
mainfrom
fix/issue-307
May 19, 2026
Merged

fix: allow unregistering the navigation delegate#336
hurali97 merged 6 commits into
mainfrom
fix/issue-307

Conversation

@hurali97
Copy link
Copy Markdown
Member

@hurali97 hurali97 commented May 15, 2026

Summary

Fixes #307

Introduced a new API:

   BrownfieldNavigationManager.clearDelegate()

Test plan

CI passes

@hurali97 hurali97 changed the title Fix/issue 307 fix: allow unregistering the navigation delegate May 15, 2026
@hurali97 hurali97 marked this pull request as ready for review May 18, 2026 07:05
Copilot AI review requested due to automatic review settings May 18, 2026 07:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds explicit support for releasing Brownfield navigation delegate ownership, addressing scenarios where multiple native hosts (Activities/scenes) may alternately own navigation and must not leave stale delegates registered.

Changes:

  • Introduces clearDelegate() on both iOS and Android navigation managers.
  • Updates native integration docs to describe ownership-based lifecycle registration/clearing patterns.
  • Updates the Android and iOS sample apps to register/unregister delegates based on host lifecycle.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
skills/brownfield-navigation/references/native-ios-integration.md Updates iOS integration guidance to include ownership-based delegate clearing.
skills/brownfield-navigation/references/native-android-integration.md Updates Android integration guidance to clear delegate on lifecycle teardown.
packages/brownfield-navigation/ios/BrownfieldNavigationManager.swift Adds clearDelegate() API on iOS manager.
packages/brownfield-navigation/android/src/main/java/com/callstack/nativebrownfieldnavigation/BrownfieldNavigationManager.kt Adds clearDelegate() API on Android manager.
docs/docs/docs/api-reference/brownfield-navigation/native-integration.mdx Expands docs with lifecycle ownership contract and updated snippets.
apps/AppleApp/Brownfield Apple App/BrownfieldAppleApp.swift Moves delegate registration to scenePhase ownership and clears on inactive/background.
apps/AndroidApp/app/src/main/java/com/callstack/brownfield/android/example/MainActivity.kt Moves delegate registration to onResume and clearing to onPause.
.changeset/quiet-papayas-unite.md Adds a patch changeset for the navigation package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/AppleApp/Brownfield Apple App/BrownfieldAppleApp.swift Outdated
@hurali97 hurali97 requested a review from artus9033 May 18, 2026 08:21
Copy link
Copy Markdown
Collaborator

@artus9033 artus9033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hurali97 hurali97 merged commit 35b6f0a into main May 19, 2026
14 checks passed
@hurali97 hurali97 deleted the fix/issue-307 branch May 19, 2026 05:50
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.

Support unregistering delegate from BrownfieldNavigationManager

3 participants