React Native privacy toolkit for Android with a fast-track API focused on:
- Screen capture blocking (
FLAG_SECURE) - Best-effort content sensitivity (
View.setContentSensitivity(...)where available) - Samsung Privacy Display support detection and Settings guidance (no third-party Samsung toggle API assumed)
Samsung Privacy Display on Galaxy S26 Ultra is a hardware privacy feature, but there is no documented public third-party API (yet) for apps to toggle it programmatically.
This project exists to provide immediate value now:
- expose Android privacy protections apps can use today (
FLAG_SECURE, best-effort content sensitivity) - give apps a clean Samsung-specific integration path (support detection + Settings guidance)
- preserve a stable API surface that can later grow into official Samsung Privacy Display controls if Samsung publishes supported APIs
This library intentionally separates different privacy controls:
FLAG_SECURE: blocks screenshots and non-secure displays/casting at the window levelsetContentSensitivity: best-effort selective screen-sharing privacy on newer Android versions- Samsung Privacy Display: hardware shoulder-surfing/privacy-angle feature on supported Samsung devices, exposed here only as support detection + Settings navigation until Samsung documents a public app API
npm install react-native-private-screenRebuild your Android app after installation.
import React, { useEffect } from 'react';
import { Button, Text, View } from 'react-native';
import { PrivateScreen } from 'react-native-private-screen';
export function SensitiveScreen() {
useEffect(() => {
void PrivateScreen.setScreenCaptureProtection('flagSecureOnDemand');
void PrivateScreen.setContentSensitivity('sensitive');
return () => {
void PrivateScreen.setScreenCaptureProtection('off');
void PrivateScreen.setContentSensitivity('notSensitive');
};
}, []);
return (
<View>
<Text>Sensitive content</Text>
<Button
title="Open Samsung display privacy settings"
onPress={() => {
void PrivateScreen.openSamsungPrivacyDisplaySettings();
}}
/>
</View>
);
}Modes:
'off''flagSecure''flagSecureOnDemand'
Modes:
'notSensitive''sensitive''auto'
On Android versions/builds without setContentSensitivity, this call is a no-op.
Returns:
{ availability: { status: 'unavailable', reason: '...' } }on non-Samsung/non-Android{ availability: { status: 'unknown', reason: 'No public app API...' } }on Samsung devices
Best-effort navigation to Android settings screens (Display, app details, or general Settings) so users can enable Samsung Privacy Display manually when supported by their device/firmware.
- This library does not claim to programmatically toggle Samsung Privacy Display.
- Samsung-specific programmatic controls should be added only after an official public API/intent contract is documented and verified on hardware.