Hacker News new | comments | show | ask | jobs | submit login

How are they implementing the screenshot detection on iOS?

I searched and found some stack overflow posts, but they all seem stumped (especially for iOS 6)

http://stackoverflow.com/questions/13484516/ios-detection-of... http://stackoverflow.com/questions/2121970/notification-of-o...




I looked into how SnapChat does it, it's pretty simple: http://blog.chpwn.com/post/38491252231


Oooh, thanks for the explanation. I figured it had something to do with touches dropping off (the other posts mentioned it, and it's kind of obvious since they ask you to long press to view). But I thought the touchesCancelled would be too unreliable, with push messages, system notifications, incoming calls, or just dragging the finger out of the screen.

How would you detect the lack of WillEnterBackground/DidResignActive to avoid false positives? Just set a timeout and send a "screenshot!" notification if the timeout expires without going to background?


Yeah, probably. Anything that gets in front of the app should call one of those two, and do so pretty immediately. A timer for a second or so later should be pretty safe.


Elaborate please...screenshot detection?


Haven't had the time to play much with this app, but if it's anything like Snapchat, the idea is to send photos that self-destruct after 5-10 seconds. Since there's absolutely no (known) way to actually prevent taking screenshots on iOS, the next best thing they implemented is "screenshot detection", which notifies the sender that the recipient did take a screenshot.


Nor is there a way to keep people from taking a picture of an iPhone screen with a secondary camera. The promise of "self-destructing" pictures seems like a disaster waiting to happen.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: