Why Expo Screen Capture not preventing from taking screenshot?

import { usePreventScreenCapture } from 'expo-screen-capture';
import React from 'react';
import { Text, View } from 'react-native';

export default function ScreenCaptureExample() {
  usePreventScreenCapture();

  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text>As long as this component is mounted, this screen is unrecordable!</Text>
    </View>
  );
}

Hey @bossfitnesstips, I tested the example it is working on Android. However, taking screenshots on iOS cannot be prevented. This is due to underlying OS limitations.

I am trying it with an android emulator it is not working. Will it work on a physical device? I am using expo sdk 46.

Yeah, it works on the physical Android device (that’s where I tested). Not sure if the screen capture is bypassed on the Android emulator or not but when I test it on the emulator, the screenshot is not saved.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.