检测在我的 iOS 应用程序中的任何应用程序上截取的屏幕截图
Detect screenshots taken ON ANY APP within my iOS app
当我的应用程序处于后台时,是否可以检测用户何时在任何应用程序中截图?我该怎么做?
如果没有,我可以定期检查照片库中的屏幕截图(不是来自相机的照片)吗?喜欢每分钟或每小时吗?
让您的应用检测屏幕截图的一种方法是:
向照片库的 PHPhotoLibraryChangeObserver 注册
当您的应用收到已添加照片的通知时,
检查它的 PHAssetMediaSubtype
如果子类型是PHAssetMediaSubtypePhotoScreenshot,你知道一个新的
已截图。
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
当我的应用程序处于后台时,是否可以检测用户何时在任何应用程序中截图?我该怎么做?
如果没有,我可以定期检查照片库中的屏幕截图(不是来自相机的照片)吗?喜欢每分钟或每小时吗?
让您的应用检测屏幕截图的一种方法是:
向照片库的 PHPhotoLibraryChangeObserver 注册
当您的应用收到已添加照片的通知时, 检查它的 PHAssetMediaSubtype
如果子类型是PHAssetMediaSubtypePhotoScreenshot,你知道一个新的 已截图。
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