Search code examples
iphoneiosfacebookemail-attachmentsphoto-gallery

How to send a photo to my app from default iOS Camera app?


I know my app can read the photos saved in iOS photo-library; also my app can save a new photo in the default iOS photo-library. But what I am trying to achieve is something like this: the default Photos app should be able to send a photo to my iOS app, just like you can share a photo to Facebook or send to iOS Mail app.

enter image description here

I want my application to be listed in this screen. Note: this is a screenshot of iOS6 Photo application.


Solution

  • POSSIBLE!!!

    This thing is very interesting on iOS.

    You have to tell iOS what kind of files your app can open (see pic below)

    enter image description here

    You have to implement -application:handleOpenURL: in AppDelegate

    -(BOOL) application:(UIApplication *)application handleOpenURL:(NSURL *)url {
          //url is a local url of photo you've chosen, iOS copied it into document folder of your app
          //do what you want
    }
    

    ================================================

    If you want to see how some app (Dropbox, GoogleDrive ...) can open some kind of files, you can see their info.plist files

    Good luck