killserver / react-native-screenshot-prevent

MIT License
98 stars 38 forks source link

Add support for images #36

Closed marco-mumtak closed 6 months ago

marco-mumtak commented 9 months ago

Description

Add support for images on RNPreventScreenshot.enableSecureView method as argument. Supports all types of URI such as https:// or file://

Solves https://github.com/killserver/react-native-screenshot-prevent/issues/34

riamon-v commented 9 months ago

Amazing ! Can it be merged ?

meierrap commented 7 months ago

Can't wait for this new feature ! Can it be merged ?

killserver commented 6 months ago

thx!

riamon-v commented 4 months ago

Here is how to use it for IOS

import LockScreenImage from 'path-to-your-image';

const setScreenshotDisabled = async () => {
  const preventScreenImage = Image.resolveAssetSource(LockScreenImage).uri;

  RNPreventScreenshot.enabled(true);
  RNPreventScreenshot.enableSecureView(preventScreenImage);
};