Skip to content

[pull] main from expo:main#24

Merged
pull[bot] merged 5 commits into
code:mainfrom
expo:main
Jul 21, 2025
Merged

[pull] main from expo:main#24
pull[bot] merged 5 commits into
code:mainfrom
expo:main

Conversation

@pull

@pull pull Bot commented Jul 21, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

hryhoriiK97 and others added 5 commits July 21, 2025 17:09
# Why
Unlike Android, which provides built-in app switcher protection through
the FLAG_SECURE window flag, iOS doesn't offer an official API to
protect app content in the app switcher or background mode. This PR
implements a custom solution that addresses this privacy gap.

# How

The feature uses iOS app lifecycle notifications
(`willResignActive`/`didBecomeActive`) to automatically show/hide a
configurable blur overlay when the app is inactive. It leverages
`UIViewPropertyAnimator` for blur control and smooth animations, with
blur intensity configurable from JavaScript via the Expo module bridge.

# Test Plan

To test this feature: Run the bare-expo app, navigate to the
ScreenCapture screen, and enable "App Switcher Protection." Then, put
the app in app switcher/background mode and verify that the screen is
blurred. Next, disable the protection and put the app in app
switcher/background mode again to confirm that the content is now
visible. I've attached a screen recording of the testing process.


https://github.com/user-attachments/assets/3d8d04cb-d57b-4d7e-849e-77dfde56b3ec

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [ ] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
# Why

When using `ScreenStackItem` with presentation `formSheet`, the `flex`
does not work on iOS. This is a known issue in screens -
https://github.com/software-mansion/react-native-screens/blob/main/ios/RNSScreen.mm#L182

This PR adds warning, so that users can more easily spot the issue.

For example for this code:

```tsx
<Modal
  presentationStyle="formSheet"
  ....
  style={{
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  }}>
  ...
</Modal>
```

The modal content will be placed at the top of formsheet, because `flex:
1` will not work. For this reason the warning will be displayed.

<img height="512" alt="image"
src="https://github.com/user-attachments/assets/2f5def04-afc7-4711-a341-8301a3f5b68a"
/>

# How

1. Flattening the styles for modal and checking for `flex`. This will
not catch 100% of cases, but should be good for most.

# Test Plan

1. Manual testing

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [x] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
@pull pull Bot locked and limited conversation to collaborators Jul 21, 2025
@pull pull Bot added the ⤵️ pull label Jul 21, 2025
@pull pull Bot merged commit e9f8027 into code:main Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants