1

I can detect user attempt to take screenshot but unable to restrict him to take screenshot. My Code is provided below

NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationUserDidTakeScreenshotNotification
                                                  object:nil
                                                   queue:mainQueue
                                              usingBlock:^(NSNotification *note) {
    
    [self.delegate screenShotDetected];
    
                                              }];

Is there any technique or code to disable screenshot in the app?

Mahboob Nur
  • 739
  • 2
  • 9
  • 34
  • You can not stop a user from taking a screenshot on his device but you can manage the content that is taken when your app is active or inactive (background). `UIScreenshotServiceDelegate` the service can be found always (nonnull) `self.view.window.windowScene.screenshotService` (iOS13) – Ol Sen Nov 01 '20 at 18:28
  • @zeytin when I able to solve it I will definately share the solution. – Mahboob Nur Jan 13 '21 at 04:08
  • ok my answer wasn't helpful ? – zeytin Jan 13 '21 at 06:40

1 Answers1

1

No you can`t. Because you have not access to delete photos in the photo gallery of the user. It would be a security gap if it happened.

But, there are some inefficient ways which is used in SnapChat as written in the link, you can check out.

zeytin
  • 5,545
  • 4
  • 14
  • 38