Detect when iOS screenshot is added to album

I came across the LIKEtoKNOW.it application. They have an interesting opportunity when a user takes a screenshot outside their application (i.e. Instagram), then their application will detect a screenshot and send a push notification to the user.

Any ideas on how this is achieved?

My assumption is that they are tracking the “screenshots” photo album, and when a new screenshot is added, they execute some code on it. If the code returns a specific result, a local push notification is generated. However, in this case there would be no restrictions on how and when monitoring of the “screenshots” photo album can take place? Or can it happen endlessly?

+5
source share
1 answer

You can combine the "Photo Library Observer API" and the media type PHAssetMediaSubtypePhotoScreenshot to receive notifications about screenshots as they run in different applications / contexts.

This method shows how to filter screenshots only from the library.

0
source

Source: https://habr.com/ru/post/1275974/


All Articles