Skip to content Skip to sidebar Skip to footer

How To Disabled Screenshoots In React-native App?

I have made a mobile app using react-native (only android for now and it is not an expo app) and I would like to forbid users to take screenshots while the app is open. I know it i

Solution 1:

try this code in MainActivity.java file:

  @Override
  protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
    if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) 
    {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, 
        WindowManager.LayoutParams.FLAG_SECURE);
    };

 }

Post a Comment for "How To Disabled Screenshoots In React-native App?"