expo-screen-capture allows you to protect screens in your app from being captured or recorded, as well as be notified if a screenshot is taken while your app is foregrounded. The two most common reasons you may want to prevent screen capture are:
If a screen is displaying sensitive information (password, credit card data, etc.)
You are displaying paid content that you don't want recorded and shared
This is especially important on Android, since the android.media.projection API allows third-party apps to perform screen capture or screen sharing (even if the app is backgrounded).
Currently, taking screenshots on iOS cannot be prevented. This is due to underlying OS limitations.
key (string) [Optional] If provided, this will prevent multiple instances of this hook or the preventScreenCaptureAsync and allowScreenCaptureAsync methods from conflicting with each other. This argument is useful if you have multiple active components using the allowScreenCaptureAsync hook. Defaults to default.
key (string) [Optional] If provided, this will help prevent multiple instances of the preventScreenCaptureAsync and allowScreenCaptureAsync methods (and usePreventScreenCapture hook) from conflicting with each other. When using multiple keys, you'll have to re-allow each one in order to re-enable screen capturing. Defaults to default.
Adds a listener that will fire whenever the user takes a screenshot while the app is foregrounded. On Android, this method requires the READ_EXTERNAL_STORAGE permission- you can request this with Permissions.askAsync(Permissions.CAMERA_ROLL).