When is ios auto screen capture performed?

I am trying to change a screenshot that iOS automatically captures when the application enters the background.

However, I'm not quite sure when this screen shot will be taken.

For instance:

If you pull out the notification bar when the following method is called in the application:

- (void) applicationWillResignActive:(UIApplication *) application { } 

Also, if you double-click the home button when the same method is called in the application. In addition, if a warning is displayed, the applicationWillResignActive application appears.

But in both cases

 - (void) applicationDidEnterBackground:(UIApplication *) application { } 

not called.

So my question is: is there a screenshot after calling the WillResignActive application, even if the application is not in the background? Or does iOS capture only a screenshot after applicationDidEnterBackground?

+6
source share
4 answers

you can view it here , eventually change the view before returning from applicationDidEnterBackground:

+3
source

See the white paper, โ€œPreventing Sensitive Information in the Task Switch . โ€

It states that applicationDidEnterBackground: should be used for this purpose.

+5
source

Yes.

- (void) applicationWillResignActive:(UIApplication *) application { }

Called when the notification bar is displayed, or even when you double-click the home button. You must do something here to prevent the capture of your OS confidential information. One way could be:

  • Set the blurry overlay of the screen before the application enters the background.
  • Once the application becomes active, delete this overlay.

Something like that:

 -(void)applicationWillResignActive:(UIApplication *)application { imageView = [[UIImageView alloc]initWithFrame:[self.window frame]]; [imageView setImage:[UIImage imageNamed:@"blurryImage.png"]]; [self.window addSubview:imageView]; } 

Then remove this overlay before the application launches in the foreground:

 - (void)applicationDidBecomeActive:(UIApplication *)application { if(imageView != nil) { [imageView removeFromSuperview]; imageView = nil; } } 
+1
source

Called when the notification bar is displayed, or even when you double-click the home button. You must do something here to prevent the capture of your OS confidential information. One way could be:

Set the blurry overlay of the screen before the application enters the background mode. When the application becomes active, delete this overlay

0
source

Source: https://habr.com/ru/post/1012821/


All Articles