How to prevent screen recording in ios11

For some reason, our APP does not want people to record the screen, but in ios11 a new function can allow the user to record the iphone screen there, so is there an API or a notification indicating that the user is recording now Thank you very much, very much.

+4
source share
2 answers

You can determine if the screen is being recorded:

UIScreen.main.isCaptured
// True if this screen is being captured (e.g. recorded, AirPlayed, mirrored, etc.)

You cannot prevent it from using project settings, but you can use modal or something to ask the user to disable it. Not sure how this will affect your AppStore.

+6
source

kvo UIScreenCapturedDidChangeNotification iOS 11,

NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
    [[NSNotificationCenter defaultCenter] addObserverForName:UIScreenCapturedDidChangeNotification object:nil queue:mainQueue usingBlock:^(NSNotification * _Nonnull note) { 
 //code you want execute
}];
-1

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


All Articles