Skip to content

feat: tighten navigation SPI hooks - #4374

Merged
mfazekas merged 1 commit into
mainfrom
feat/navigation-spi-polish
Oct 19, 2026
Merged

mfazekas merged 1 commit into
mainfrom
feat/navigation-spi-polish

Conversation

@mfazekas

Copy link
Copy Markdown
Contributor

Description

Polishes the native hooks @rnmapbox/navigation uses. RNMBXCameraDelegate is now @MainActor, so main-actor conformers no longer need @preconcurrency. Map view factories receive the RNMBXMapView parent instead of a plain UIView/ViewGroup, so they don't need to cast it; existing { _, parent in ... } registrations keep compiling. On Android, addOnCameraWillMoveMapListener returns a Cancelable that removes the listener.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

The example app was built (not run) for iOS simulator and Android, and @rnmapbox/navigation main was built against this branch on both platforms.

- iOS: RNMBXCameraDelegate is @mainactor
- Map view factories receive the RNMBXMapView parent instead of UIView/ViewGroup
- Android: addOnCameraWillMoveMapListener returns a Cancelable
@mfazekas
mfazekas merged commit 6ae18f0 into main Oct 19, 2026
9 checks passed
@mfazekas
mfazekas deleted the feat/navigation-spi-polish branch October 19, 2026 19:06
mfazekas added a commit to rnmapbox/navigation that referenced this pull request Oct 20, 2026
Use the tightened navigation SPI from rnmapbox/maps#4374: the factories
get an RNMBXMapView parent, so the casts and @preconcurrency go away, and
the Android camera-will-move listener is unregistered through the returned
Cancelable when the map detaches.

rnmapbox/maps#4375 keeps the factory map's gesture delegate on iOS, so the
gesture-recognizer workaround is replaced by
NavigationMapViewDelegate.navigationMapViewUserDidStartInteraction.
mfazekas added a commit to rnmapbox/navigation that referenced this pull request Oct 20, 2026
Use the tightened navigation SPI from rnmapbox/maps#4374: the factories
get an RNMBXMapView parent, so the casts and @preconcurrency go away, and
the Android camera-will-move listener is unregistered through the returned
Cancelable when the map detaches.

rnmapbox/maps#4375 keeps the factory map's gesture delegate on iOS, so the
gesture-recognizer workaround is replaced by
NavigationMapViewDelegate.navigationMapViewUserDidStartInteraction.
mfazekas added a commit to rnmapbox/navigation that referenced this pull request Oct 20, 2026
Use the tightened navigation SPI from rnmapbox/maps#4374: the factories
get an RNMBXMapView parent, so the casts and @preconcurrency go away, and
the Android camera-will-move listener is unregistered through the returned
Cancelable when the map detaches.

rnmapbox/maps#4375 keeps the factory map's gesture delegate on iOS, so the
gesture-recognizer workaround is replaced by
NavigationMapViewDelegate.navigationMapViewUserDidStartInteraction.

This branch was previously deployed

1 inactive deployment
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.

1 participant