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.
Summary
Note: on iOS there is no straight forward way to prevent screenshots the same way there is for screen recordings, but the UITextFields that are marked as secure are omitted from the screenshots. So the way we made it work is by identifying a view that is rendered on screen and wrapping it's layer with a UITextField that does not respond to touches so that when a screenshot is taken then all the elements being wrapped are not visible in the screenshot.
The same way we apply the wrapper, there is also a mechanism to bring the layers to it's original state and remove the protection.
The interesting thing here is that we are swizzling react-native-navigation even without a reference to the library and extending UIView, UIViewController in order to detect when new screens are being presented, this applies to screens in the current stack, new stacks created by modals and also UIWindow created for overlays.
Ticket Link
https://mattermost.atlassian.net/browse/MM-63362
https://mattermost.atlassian.net/browse/MM-63364