Tio
Tio

Reputation: 73

Possible to get notification from camera when my app is running in the background?

I'm building an iOS mobile app that needs to be notified whenever the user takes a new picture with the camera of the iPhone (with the phone's default camera app).

I tried to google it, but I couldn't find out if this is possible:

  1. my app runs in the background
  2. user takes a new picture with the camera (outside of my app, using the phone's default camera app)
  3. my app gets notified by NotificationCenter and I can save the picture the user has just taken right after the user took the picture

Swift or Objective-C solution would be good as well. Any help is appreciated, even a yes or no answer (whether it's possible or not)

Upvotes: 0

Views: 776

Answers (1)

Revanth Kausikan
Revanth Kausikan

Reputation: 683

I don't think there are any possibilities, as of now.
I don't know why, but my guess would be that for security reasons Apple won't let camera run in the background at all.

Other alternatives may include:

  1. Using UIImagePickerControllerUserDidCaptureItem to listen to camera button press event, as mentioned here.
  2. As suggested in your question comments by @dharmesh, you can obtain your photos, when the user opens your app.

EDIT

You can observe the changes made in the photo library to track if any changes (here, addition) of photos are done.

Upvotes: 1

Related Questions