iphone - *发送到 Instagram* 通过 *100 台相机合二为一*

标签 iphone objective-c xcode instagram

从第一天起,我就被告知每个第三方 iOS 应用程序都是完美的沙盒,因此除了一些预定义的 URL 之外,第三方应用程序无法将消息传输到另一个应用程序。

但是这个 发送到 Instagram 的技巧由 100 Cameras in 1 完成,引起了我的注意。当用户触发这个 Action 时,他立即从 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 也无法访问该图像。

编辑(第 2 次):虽然我还没有尝试过,但 Tom H 的回答可能最终导致了解决方案。所以我接受了他的回答作为最终答案。至于 unset 的回答,unset 一直提到 url scheme 的事情(但是伙计,我们都知道这一点。让我们感到困惑的不是通过调用 url 在应用程序之间切换。这是 Instagram 从另一个应用程序访问该图像的方式使我们感到困惑。)由于 unset 的回答没有提供太多有用的信息,也没有回答我的问题,所以我对他的回答投了反对票,我建议那些投赞成票的人相应地调整您的投票。 Stack Overflow 是一个很棒的地方,因为我们几乎总能得到切中要点的答案,而不是因为有些人的答案没有错,但从来没有真正切题。

编辑(第 3 次):The official Instagram developer page现给出官方解决方案。

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.

最佳答案

如果有人感兴趣,这里是执行此操作所需的实际文档:

http://instagram.com/developer/iphone-hooks/

关于iphone - *发送到 Instagram* 通过 *100 台相机合二为一*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6197445/

相关文章:

iphone - 从 iOS 4 切换到 5 时出现 NavigationBarStyle 问题

iphone - 需要 iPhone 程序员判断每一步和每个指针 == nil 吗?

ios - 未找到 Bitrise.io 方案

objective-c - 将文件从 NSBundle 复制到文档错误

ios - 放大特定的 MKMapView 框架

xcode - 播放 mp4 文件,然后切换到 View Controller ,文件播放正常,但无法找出切换到另一个 View 的代码

ios - 用于开发配置文件的通配符应用程序 ID/"No Code Signing Identity Found"

iphone - iOS plot 3d图形库

iphone - UIimageView 圆顶角 BezierPath 不起作用?

iphone - UIPopoverController 中的 UINavigationController : setting the title