Provide option to not blindly foreground app's lastWindow from deepLinks #1355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please select one of the following
Summary
Messenger Desktop is a multi-window application (chat, calling, settings, …) and we maintain the various windows with a windowNativeModule which allows JS interaction.
When receiving deep-links from other apps we don’t want to necessary re-open the lastWindow open as the deep-link might contain information about a particular scenario (open login page, start a call). Hence, we need to disable this behavior app wide and use our windowNativeModule to foreground the specific window related to the deep link.
To use this 'feature' you would add this line in AppDelegate
Changelog
[macOS] [Added] - Provide option to not blindly foreground app's lastWindow from deepLinks
Test Plan
Using js/examples/Linking/LinkingExample.js I simply added an eventListener
as otherwise the LinkingManager.mm does not observe:
https://github.com/microsoft/react-native-macos/blob/main/Libraries/LinkingIOS/macos/RCTLinkingManager.mm#L44
https://github.com/microsoft/react-native-macos/blob/main/React/Modules/RCTEventEmitter.m#L115
Disable alwaysForegroundLastWindow
dontF.mov
Current behavior, always foreground
Fore.mov