iOS Photo Kit Filter screenshots, screen recordings and assets saved other apps

172 Views Asked by At

G'day For a photos processing application, I have to fetch and filter out images and videos saved from other applications and exclude screenshots and screen recordings.

  1. For screenshots I'm using PHAsset's PHAssetMediaSubtype property to filter the PHAssetMediaSubtypePhotoScreenshot types and it works really well.

  2. For screen recordings I haven't found a good way unfortunately. I stumbled onto this but it is not really working well because calling PHAssetResource on each asset is a very heavy operation. The closest I've found is to use PHAssetCollection and use it's localised name but this not really a good way either.

  3. Lastly how do I filter out images and videos saved from other apps such as messenger apps and other apps such as tiktok. When you open apple's native Photos app and view info for an image/video it shows if the resource is taken from a camera or saved from other app. But is there a way to get this information from Photos Kit apis? Attached picture below to show what I mean by "saved by" shown on photos app.

saved by

Thanks!

0

There are 0 best solutions below