iOS Question Detect screenshot

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use this code:
B4X:
Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   Page1.Title = "Page 1"
   Page1.RootPanel.Color = Colors.White
   NavControl.ShowPage(Page1)
   Dim no As NativeObject = Me
   no.RunMethod("addListener", Null)
End Sub

#if OBJC
- (void)addListener {
  [[NSNotificationCenter defaultCenter] addObserver:self
  selector:@selector(_screenshot_taken)
  name:UIApplicationUserDidTakeScreenshotNotification  object:nil];
}
#end if

Private Sub Screenshot_Taken
   Log("Screenshot taken")
End Sub
 
Upvote 0
Top