1

I have studied the background syncing and multitasking capabilities of iOS 7. What cant figure out is the possibility to upload new photo's taken with the camera app.

The part to upload a file in the background isnt the hardest part, but what delegates do i have to use to detect wether a photo is taken and upload this particular latest photo?

Possible duplicate: iOS - Background uploading of photos

Community
  • 1
  • 1
Andrew Ho
  • 618
  • 9
  • 21

2 Answers2

1

I think you can use Photos Framework to do it. There is a delegate method to callback if one photo is edited or added.

First Photos Framework only supports iOS8+;

@import Photos;

Implement PHPhotoLibraryChangeObserver protocol;

- (void)photoLibraryDidChange:(PHChange *)changeInstance {

    if (![collectionChanges hasIncrementalChanges] || [collectionChanges hasMoves]) {} else {}
}
Changwei
  • 672
  • 1
  • 5
  • 16
  • 1
    Please provide more information about how this can be done with the software (and don't just post an external link please) – bish Jul 18 '15 at 09:15
-1

If I understand correctly, what you want to do just cannot be done on iOS (Apple security limitations).

If you want to upload a photo each time user takes a photo with Camera app (the OS built in Camera app), you would have to implement something such as folder scanning, to detect there is a new image in Photos folder. That would require access to complete file system, including files of all applications, which cannot be done due to Sandbox restriction.

In iOS, each application has it's own directory and you are allowed to write only to that directory. Access to files outside of it is always rejected (unless you are super user on a jailbroken phone).

Read more about iOS Sandbox:

So what you can do on iOS, is to open a Camera picker view and allow the user to take a photo. After that you can easily access the photo and upload it to your server. Read more about it on the links below:

Community
  • 1
  • 1
Legoless
  • 10,942
  • 7
  • 48
  • 68