From Day One I was told that each third-party iOS app was perfectly sand-boxed and therefore there was no way for a third-party app to transfer messages other than some pre-defined urls to another app.
But this Send to Instagram trick done by 100 Cameras in 1 just caught my attention. When the user triggers this action, he jumps from 100 Cameras in 1 to Instagram right away (which is OK and could be easily implemented by the url trick mentioned above.) However, what is interesting is that Instagram will display the image just processed by 100 Camera in 1 as if it was displaying a image from its own sandbox.
I understand that Cocoa Touch must have some APIs to support this. My question is, what are they? Are they only limited to images?
Thanks a lot in advance.
Edited: I understand there’s the Cocoa Touch URL scheme thing, but if it’s the url scheme that did the trick… the url scheme must contain info of a pointer/reference to the image. Otherwise even if we jump from 100 Cameras in 1 to Instagram, Instagram won’t have access to that image.
Edited (2nd time): Though I haven’t tried yet, Tom H’s answer might finally led to a solution. So I accepted his answer as the final answer. As for unset’s answer, unset kept mentioning the url scheme thing (but dude, we all know that. And it’s not the switching-between-apps-by-calling-url that confused us. It’s how Instagram accessed that image from another app that confused us.) Since unset’s answer doesn’t provide much useful info and never answered my question to the point, I down-voted his answer, and I suggest those who up-voted adjust your votes accordingly. Stack Overflow is a great place because we could almost always have answers that are to the point, not because there are people who’s answers are nothing wrong but are never really to the point.
Edited (3rd time): The official Instagram developer page now gives the official solution.
If your application creates photos and
you’d like your users to share these
photos using Instagram, you can use
the Document Interaction API to open
your photo in Instagram’s sharing
flow.You must first save your file in PNG
or JPEG (preferred) format and use the
filename extension “.ig”. Using the
iOS Document Interaction APIs you can
trigger the photo to be opened by
Instagram. The Identifier for our
Document Interaction UTI is
com.instagram.photo, and it conforms
to the public/jpeg and public/png
UTIs. See the Apple documentation
articles: Previewing and Opening Files
and the
UIDocumentInteractionController Class
Reference for more information.When triggered, Instagram will
immediately present the user with our
filter screen. The image is preloaded
and sized appropriately for Instagram.
Other than using the appropriate image
format, described above, our only
requirement is that the image is at
least 612px tall and/or wide. For best
results, Instagram prefers opening a
JPEG that is 612px by 612px square. If
the image is larger, it will be
resized dynamically.An important note: If either dimension
of the image is less than 612 pixels,
Instagram will present an alert to the
user saying we were unable to open the
file. It’s our current policy not to
upscale or stretch images to our
minimum dimension.
If anyone’s interested, here’s the actual documentation needed to do such a thing:
http://instagram.com/developer/iphone-hooks/