Is it possible to detect when the user takes a screenshot in any app while my app is in the background ? And how would I do that ?
If not, can I background check regularly for screenshots (not pictures from the camera) in the photo library ? Like every minute or hour ?
One way to get your app to detect Screenshots is:
Register with the Photo Library's PHPhotoLibraryChangeObserver
When your app receives a notification that a photo has been added, check its PHAssetMediaSubtype
If the Subtype is PHAssetMediaSubtypePhotoScreenshot, you know a new Screenshot has been taken.
The PHPhotoLibraryChangeObserver protocol notifies you of changes that occur in the Photos library, regardless of whether those changes are made by your app, by a user in the Photos app, or by another app that uses the Photos framework.
https://developer.apple.com/reference/photos/phphotolibrarychangeobserver