*发送到 Instagram* *100 个相机合二为一的技巧*
从第一天起,我就被告知每个第三方 iOS 应用程序都是完美的沙盒,因此第三方应用程序无法将除某些预定义 URL 之外的消息传输到另一个应用程序。
但是 100 Cameras in 1 完成的这个发送到 Instagram 技巧引起了我的注意。当用户触发这个动作时,他会立即从100 Cameras in 1跳转到Instagram(这是可以的,并且可以通过上面提到的url技巧轻松实现。)然而,有趣的是Instagram将显示刚刚由 100 Camera in 1 处理的图像,就像显示来自自己的沙箱的图像一样。
我知道 Cocoa Touch 必须有一些 API 来支持这一点。我的问题是,它们是什么?它们仅限于图像吗?
预先非常感谢。
已编辑:我知道有 Cocoa Touch URL 方案,但如果是 url 方案完成了这个任务... url 方案必须包含对图像的指针/引用的信息。否则,即使我们从 100 Cameras in 1 跳转到 Instagram,Instagram 也无法访问该图像。
编辑(第二次):虽然我还没有尝试过,但Tom H的回答可能最终会带来解决方案。所以我接受了他的回答作为最终答案。至于unset的答案,unset不断提到url方案的事情(但是伙计,我们都知道这一点。让我们困惑的不是通过调用url在应用程序之间切换。而是Instagram如何从另一个应用程序访问该图像让我们感到困惑。)由于 unset 的答案没有提供太多有用的信息,也没有回答我的问题,我对他的答案投了反对票,我建议那些投赞成票的人相应地调整你的投票。 Stack Overflow 是一个很棒的地方,因为我们几乎总能得到切中要害的答案,而不是因为有些人的答案没有任何错误,但从来没有真正切中要点。
已编辑(第 3 次)时间):Instagram官方开发者页面现在给出了官方解决方案。
如果您的应用程序创建照片并且 您希望您的用户分享这些 使用 Instagram 拍摄的照片,您可以使用 要打开的文档交互 API 您在 Instagram 分享中的照片 流量。
您必须先将文件保存为 PNG 格式 或 JPEG(首选)格式并使用 文件扩展名“.ig”。使用 您可以使用 iOS 文档交互 API 触发照片打开 Instagram。我们的标识符 文档交互 UTI 是 com.instagram.photo,它符合 向公众/jpeg 和公众/png 尿路感染。请参阅苹果文档 文章:预览和打开文件 和 UIDocumentInteractionController 类 更多信息请参考。
触发后,Instagram 将 立即向用户展示我们的 过滤网。图像已预加载 并且尺寸适合 Instagram。 除了使用适当的图像 格式,如上所述,我们唯一的 要求是图像位于 高度和/或宽度至少为 612 像素。为了最好 结果,Instagram更喜欢开一个 JPEG,大小为 612 像素 x 612 像素正方形。如果 图像更大,它会 动态调整大小。
重要提示:如果任一维度 图像的像素小于 612 像素, Instagram 将向以下人士发出警报 用户说我们无法打开 文件。我们目前的政策是不 高档或拉伸图像到我们的 最小尺寸。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果有人感兴趣,这里是执行此类操作所需的实际文档:
http://instagram.com/developer/iphone-hooks/
If anyone's interested, here's the actual documentation needed to do such a thing:
http://instagram.com/developer/iphone-hooks/
Instagram 已注册网址方案
instagram://
(在 iPhone safari 中输入“instagram://something”并点击“打开”)。也许您的应用已经发现了将图像发送到 Instagram 的格式 - 或者 Instagram 提供了记录的 API。有关可能的参数,请查看这篇文章。
Instagram has registered the URL scheme
instagram://
(type "instagram://something" in your iPhones safari and hit "open"). Maybe your app has discovered the format to send images into Instagram – or Instagram provides a documented API.For the possible parameters, check this post.
我认为正在发生的事情(或者可能发生的事情,也谢谢你 Angelo)是第一:
100 个相机合一将图像保存到 Photos.app。
然后,它将图像的名称/文件名/路径传递到 Instagram(通过 url 方案)。
然后,Instagram 从 Photos.app 检索照片并加载。
除了图像之外,可能没有其他方法可以做到这一点,但是如果您查看 UIDocumentInteractionController 类,它可以在一定程度上允许您在其他应用程序中打开文件。
I think what's happening (or what could possibly happen, also thank you Angelo) is first:
100 Cameras in 1 saves the image to Photos.app.
Then, it passes the name/filename/path of the image to Instagram (via the url scheme).
Then, Instagram retrives the photo from Photos.app, and loads it up.
There is probably not a way to do this with things other than images, however if you have a look at the UIDocumentInteractionController class which lets you open files in other apps, to an extent.