6 Replies
      Latest reply on Sep 14, 2019 4:52 PM by kanishka_408
      SushmaNayak Level 1 Level 1 (0 points)

        disable screenshot for a app

        • Re: How do we prevent a user from taking screenshot ?
          PBK Level 7 Level 7 (3,295 points)

          I would be surprised if you can disable it.  Snapchat requires that you be touching the screen to display the image - that prevents screenshots.  Another  thing you might be able to do is display the screen in quick shots of partial images, perhaps interleaving the image in some way.  That way a screenshot doesn't capture the entire image.

          • Re: How do we prevent a user from taking screenshot ?
            iTen Level 2 Level 2 (80 points)

            How do you stop someone from pressing the hardware key combination? - you can't let alone enabling screen recording.

            • Re: How do we prevent a user from taking screenshot ?
              oscar.perez.lopez Level 1 Level 1 (0 points)

              Hello,

               

              I know this is an old post but the question is still there.

               

              If avoiding the user taking a screenshot is not allowed and there's no way to disable that feature, is there any way or workaround that allows to show a security view if the user takes a screenshot in that image? I mean the screenshot shows the security view instead of the original data.

               

              Regards.

              • Re: How do we prevent a user from taking screenshot ?
                kanishka_408 Level 1 Level 1 (0 points)

                Not going in details but just giving some pointers..we can detect when a screenshot is taken sign the below code. Once the detection is done..we can either delete the last image in Potos or edit to obscure the content.

                 

                Objective C

                 

                NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];

                [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationUserDidTakeScreenshotNotification

                                                                  object:nil

                                                                   queue:mainQueue

                                                              usingBlock:^(NSNotification *note) {

                                                                 // executes after screenshot/

                                                                  //Write code here to delete/obscure the last image from photos                                                

                                                              }];

                Swift

                NotificationCenter.default.addObserver(

                    forName: UIApplication.userDidTakeScreenshotNotification,

                    object: nil,

                    queue: .main) { notification in

                                          // executes after screenshot

                                         //Write code here to delete/obscure the last image from photos

                 

                }