[英]Sharing to Instagram in ios 7
所以我曾经为iOS6提供以下代码片段
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if([[UIApplication sharedApplication] canOpenURL:instagramURL])
{
NSURL *imageURL = [NSURL fileURLWithPath:originalImagePath];
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:imageURL];
self.documentInteractionController.delegate = self;
self.documentInteractionController.UTI = @"com.instagram.exclusivegram";
[self.documentInteractionController presentOpenInMenuFromRect:self.view.frame inView:self.view animated:YES];
}
但随着iOS7的发布,我得到一个对话框窗口,显示Instagram中的Open图标,我收到以下错误:
Invalid LSOpenOperation request - No applications found to open document
有谁知道Instagram是否已经改变了他们的UTI
for iOS7或者什么是合适的开发人员钩子让它在7上工作?
我的文件扩展名是罪魁祸首。
根据Instagram文档:
您必须先以PNG或JPEG(首选)格式保存文件,并使用文件扩展名“.ig”。 使用iOS文档交互API,您可以触发Instagram打开的照片。
看起来像旧的版本的Instagram没有强制执行(我只是传递.jpg或.png文件)
现在我们必须有.ig文件扩展名...
使用为Instagram设计的UIActivity并添加到您的UIActivityViewController代码中。
看到; https://www.cocoacontrols.com/controls/dmactivityinstagram
我在我的所有应用程序中都使用它,效果很好!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.