【发布时间】:2012-01-30 09:44:43
【问题描述】:
我在我的 iOS 应用程序中使用以下代码来使用 Instagram iPhone 挂钩将照片发布到 Instagram。我只希望“打开方式...”菜单有 Instagram 应用程序,没有其他应用程序。但就我而言,Camera+ 也出现了。如何限制 Instagram?
另外,我可以直接打开 Instagram 而不是显示“打开方式”菜单吗?
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
//imageToUpload is a file path with .ig file extension
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:imageToUpload]];
self.documentInteractionController.UTI = @"com.instagram.photo";
self.documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"my caption" forKey:@"InstagramCaption"];
[self.documentInteractionController presentOpenInMenuFromBarButtonItem:self.exportBarButtonItem animated:YES];
}
【问题讨论】:
-
你能告诉我什么是 self.exportBarButtonItem 以及它会做什么我也在尝试整合它......
-
嘿,你这样做了吗?我也需要你的帮助
-
@amaltasCoder 你这样做了吗?请分享它的代码。上面的代码没有像我一样工作。
-
你们找到解决办法了吗?
-
只是添加到 cmets - 如果找到解决方案,请发布 - 谢谢!
标签: objective-c ios instagram