Block screen recording and screenshots
complete
Evan Bacon
complete
Completed in SDK 38 https://dev.to/expo/expo-sdk-38-is-now-available-5aa0
Michael Wood
Charlie Cruzan
This is now available in SDK 38 - https://dev.to/expo/expo-sdk-38-is-now-available-5aa0 - check out the expo-screen-capture module!
V
Vishva Shukla
Charlie Cruzan: thank you
Charlie Cruzan
This is now available in SDK 38 - https://dev.to/expo/expo-sdk-38-is-now-available-5aa0 - check out the
expo-screen-capture
module!Chanho
I need a function to detect or block like this article.
Michael Wood
Michael Wood
Merged in a post:
Blur app screenshots for privacy [Android]
P
Peter Rattew
Applications that have sensitive data normally blur or hide the screen when the application is inactive, goes into the background or a screenshot is taken.
On iOS you can use the AppState to check when the application goes into the background and change the render to hide content but you can't do this on Android without writing native code.
Is there any plan to add functionality to expo to handle this?
Chintan Savjiyani
+1 .
Chintan Savjiyani
+1 for if they also add for IOS
Alex Russell
Have you tried simply using RN's own
AppState
(https://facebook.github.io/react-native/docs/appstate.html) listener and changing your screen based on that. I'm not saying it will definitely work (I haven't tried, and iOS may take its 'screenshot' before your JS code is able to update the layout) but it's possible it will.FWIW the official Apple docs for this (https://developer.apple.com/library/content/qa/qa1838/_index.html) says you should use
applicationDidEnterBackground
or UIApplicationDidEnterBackgroundNotification
, which I would have thought RN's AppState
module would be using in the background.(Those docs may well be out of date though, as they were apparently last updated four years ago! It's possible the latest advice is to use
applicationWillResignActive
(https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622950-applicationwillresignactive), which RN may not be listening for.)Brent Vatne
Alex Russell: indeed you can use AppState for this
M
Mahesha
Alex Russell: I tried with AppState but as you mentioned 'screenshot' will be taken before js code gets executed. so i need some work around in expo without detaching.
Subham Goyal
Brent Vatne: I tried AppState but app state doesn't change when I use any screen recording application.
vihari
Subham Goyal: i even need the same feature to block screen recorder or exit the app on using it is there a way to do it?
Michael Wood
vihari: Did you try this? https://docs.expo.io/versions/latest/sdk/screen-capture/#usepreventscreencapturekey
vihari
Michael Wood: yes when i tried it doesn't support for ios and for third party apps like du recorder
Michael Wood
vihari: Then I suggest you create an issue here with your example code that works on Android but does not work on iOS and provide as much information as you can about where it does work or does not work:
Load More
→