I'm trying to detect if user take a screenshot in order to warn them this is a video with copyright. I've tried Darwin Notification, but it didn't work... NSMetadataQuery might be a solution, but we want the app to run on iOS4 as well. Can somebody help me? Thanks!:p
Asked
Active
Viewed 7,484 times
3
-
@jjmontes While it's a technically valid question, it's an anti-user "feature", like websites that block right-clicking. It's just as likely to piss people off as it is to effectively protect anyone's IP. – Nick Forge Jan 03 '12 at 11:33
-
oops...I won't do anything to prevent user doing what they want to do. Such as capture screen or watch video. Just warning them about the copyright things :[ – Black Pai Jan 03 '12 at 14:42
-
[This question][1] has [the correct answer][2]. [1]: http://stackoverflow.com/questions/13484516/ios-detection-of-screenshot [2]: http://stackoverflow.com/a/14120549/9636 – Heath Borders Jan 22 '13 at 22:17
3 Answers
2
It is not possible to detect a screenshot has (or will) be taken on iOS 5.
In iOS 4.0, there was a Darwin notification fired PictureWasTakenNotification
, but not anymore.
The documentation does not mention anything, and using NSNotificationCenter
to subscribe to all notifications only shows silence after taking a screenshot.

Guillaume
- 21,685
- 6
- 63
- 95
1
you can detect it with adding an observer to UIApplicationUserDidTakeScreenshotNotification
.
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationUserDidTakeScreenshotNotification
object:nil
queue:mainQueue
usingBlock:^(NSNotification *note) {
// executes after screenshot
}];

brush51
- 5,691
- 6
- 39
- 73
1
before ios 4.0 you can register for PictureWasTakenNotification
.This notification is sent when screenshot is taken.No notifications will be sent before the screenshot was taken.
But after that this has been discontinued and IMHO there is no other way round... :/

Ankit Srivastava
- 12,347
- 11
- 63
- 115