5

I came across the app LIKEtoKNOW.it. They have an interesting feature where the user takes a screenshot outside of their app (i.e. instagram), then their app will detect the screenshot and send a push notification to the user.

Any ideas on how this is achieved?

My assumption is that they're monitoring the 'screenshots' photo album, and when a new screenshot is added they execute some code on it. If the code returns a certain result, then a local push notification is created. However in this case, wouldn't there be limits to how and when the monitoring of the 'screenshots' photo album can occur? Or can it occur indefinitely?

jscs
  • 63,694
  • 13
  • 151
  • 195
David T
  • 2,724
  • 1
  • 17
  • 27
  • 1
    Have you looked at PHPhotoLibraryChangeObserver? https://developer.apple.com/documentation/photos/phphotolibrarychangeobserver – DonMag Mar 20 '18 at 15:00

1 Answers1

0

You can combine the "Photo Library Observer API" and the PHAssetMediaSubtypePhotoScreenshot media type to be notified of screenshots as they are taken in different apps / contexts.

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

joakim
  • 3,533
  • 2
  • 23
  • 28