的作品我有與iOS5的,現在在iOS6的內置Instagram的分享,分享不再起作用雖然canOpenURL
返回true,代碼執行的應用程序。圖像以.igo
的擴展名保存到應用程序的文檔文件夾中。這通過com.instagram.exclusivegram傳遞給instagram。UIDocumentInteractionController不再iOS6的
的代碼如下,它進入if語句,並顯示「在這裏」,但沒有打開分享對話框喜歡它在屏幕的底部使用。
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
也提供了正確的文件路徑。
謝謝 尼克
謝謝,我已經想通了,忘了發佈!良好的結果 –
感謝這個作品。但是沒有任何方法可以直接進入Instagram,沒有「Open In」操作表? – GeneCode