¿Es posible detectar si un usuario está presionando los botones de captura de pantalla en iOS?

I need to know if the user is trying to take a screen capture of a specific section on an app we are building. Any advice would be helpful. We would like to then black out the screen to prevent a screen shot from being taken.

preguntado el 01 de febrero de 12 a las 14:02

Good question, but my curiosity begs me to ask what you want to stop them taking screen shots of? -

3 Respuestas

No. Its not possible to find out.

Respondido 01 Feb 12, 18:02

You cann't control Home and Switch buttons actions. It is the default hardware behaviour.

Respondido 01 Feb 12, 18:02

I also believe it to be impossible to detect.

I did a few tests, thinking that the iOS might call

-(void) applicationDidEnterBackground:(UIApplication*)application or

- (void)applicationWillResignActive:(UIApplication *)application

might be called, but NSLogs in those methods weren't called when I took a screenshot.

I did find this but it's also not available in iOS 5.0+. (perhaps even not after iOS 4.0+)

The PictureWasTakenNotification Darwin notification will be sent when the user takes a screenshot. However, this is sent after the screenshot is taken.

[Fuente]

contestado el 23 de mayo de 17 a las 12:05

What about this? Do this- set up a program, run a debug, and watch the events that pass through the debug. What we believe is that once you hit the screen capture buttons, it invokes a command and a call to action on the viewer to transform the transparent PNG to an opaque PNG. The opaque PNG is what the screen capture captures and is what you would see in your photo files. This is for the viewer portion of the app we will build as well. - Jimmy Smith

can you tell me something about darwing notification - Sunil Pandey

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.