I wanted to prevent users taking screenshots of my App and also hide it's content when it's on recent items. Do you know an equivalent to Android's FLAG_SECURE
feature? https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE
Asked
Active
Viewed 2,937 times
2

Ashley Mills
- 50,474
- 16
- 129
- 160

Anthony
- 589
- 3
- 15
-
You cannot prevent but you can find a workaround with deleting screenshots after they were taken. Refer to: https://stackoverflow.com/questions/41544567/programmatically-disabling-screenshot-in-app – Oleg Novosad Sep 14 '17 at 14:35
-
1There's equivalent in iOS, and does it really make sense anyway? It would be quite easy to take a photo of the screen using another device. – Ashley Mills Sep 14 '17 at 14:49
-
1The should read *"There's NO equivalent in iOS…"* – Ashley Mills Sep 14 '17 at 14:57
-
@AshleyMills Yes, someone can still take a photo using a separate device, but you can prevent that by not handing over your phone. What I'm after is to prevent malicious apps taking screenshots in the background without you knowing it. – Anthony Sep 14 '17 at 16:12
1 Answers
-1
Apps (malicious or not) cannot take screenshots on iOS (in background or not), period. So the problem does not exist in the first place.
Apps can:
Render their own UI into an image, but that's not the same thing as a screenshot. It's limited to their own windows, so not a problem.
Record screen, but with user's authorisation every time.
Record videos via ReplayKit, but, again, with user's authorisation every time.

Andrey Tarantsov
- 8,965
- 7
- 54
- 58
-
But can the user take a screenshot (or screen recording) of secured places (login, privacy-focused-chatting apps...)? – android developer Mar 26 '22 at 07:12