diff --git a/.changeset/ios-open-url-linking-first.md b/.changeset/ios-open-url-linking-first.md new file mode 100644 index 00000000..4f10954b --- /dev/null +++ b/.changeset/ios-open-url-linking-first.md @@ -0,0 +1,5 @@ +--- +'@callstack/react-native-brownfield': patch +--- + +iOS (Expo host): `application(_:open:options:)` now always forwards the URL to React Native linking before asking the Expo app delegate subscribers, so a subscriber that returns `true` (for example `expo-dev-launcher` in a debug build) no longer prevents the JS `Linking` `url` event. This matches the existing `application(_:continue:restorationHandler:)` order. diff --git a/packages/react-native-brownfield/ios/Expo/ExpoHostRuntime.swift b/packages/react-native-brownfield/ios/Expo/ExpoHostRuntime.swift index 194fa7c9..d94b56ce 100644 --- a/packages/react-native-brownfield/ios/Expo/ExpoHostRuntime.swift +++ b/packages/react-native-brownfield/ios/Expo/ExpoHostRuntime.swift @@ -158,7 +158,8 @@ final class ExpoHostRuntime { open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:] ) -> Bool { - return (expoDelegate?.application(app, open: url, options: options) ?? false) || RCTLinkingManager.application(app, open: url, options: options) + let result = RCTLinkingManager.application(app, open: url, options: options) + return (expoDelegate?.application(app, open: url, options: options) ?? false) || result } // Universal Links; base implementation courtesy of Expo, licensed under the MIT License - changes were made to call the method on expo delegate - https://github.com/expo/expo/blob/main/apps/bare-expo/ios/AppDelegate.swift