Member-only story

Detecting screenshots taken by the user using React Native

Davyd NRB
2 min readDec 27, 2022

--

When talking online with relatives, coworkers, or close acquaintances, it’s important to ensure that confidential information won’t be copied and shared with further parties.

This basic function, screenshot detection, has been present in well-known apps like Instagram and Snapchat for a while.

How things are in the react-native ecosystem? For current moment I found three modules that compatible with latest version of react-native@0.65.x (see below)

How is the ecosystem of React Native doing?

I currently have three modules that work with the most recent version of react-native@0.65.x (see below)

⚠️ Note: Both modules has one limitation on Android, that required a READ_EXTERNAL_STORAGE permission

Android uses ContentObserver to listen when a picture file is created and the filename contains the word “screenshot” in order to detect when a screenshot was captured.

If you have any questions, please feel free to ask them in the comments section.

© MurAmur ❤️

--

--

Davyd NRB
Davyd NRB

Written by Davyd NRB

React Native guru 🧘\ DevOps adjutant \ Linux lover ❤️

No responses yet

Write a response