我有一个应用程序与Instagram共享为iOS5和现在在iOS6,共享不再工作,但 canOpenURL
返回true并执行代码。使用a将图像保存到应用程序的文档文件夹中 .igo
延期。这是通过com.instagram.exclusivegram传递给Instagram的。
代码如下,它进入if语句并显示“here in”但不会像屏幕底部那样打开Share With对话框。
NSLog(@"%@", _imgToUpload);
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
uidController = [[UIDocumentInteractionController alloc] init];
//imageToUpload is a file path with .igo file extension
uidController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:_imgToUpload]];
uidController.UTI = @"com.instagram.exclusivegram";
uidController.delegate = self;
CGRect navRect = self.view.frame;
[uidController presentOpenInMenuFromRect:navRect inView:[UIApplication sharedApplication].keyWindow animated:YES];
NSLog(@"here in");
}
_imgToUpload
也提供了正确的文件路径。
谢谢, 缺口