Ama*_*der 12 objective-c ios instagram
我在我的iOS应用程序中使用以下代码来使用Instagram iPhone挂钩将照片发布到Instagram.我只希望"Open In ..."菜单中有Instagram应用程序,没有其他应用程序.但在我的情况下,Camera +也出现了.我怎么能限制在Instagram?
另外,我可以直接打开Instagram而不是显示Open In菜单吗?
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];
}
Run Code Online (Sandbox Code Playgroud)
Jos*_*ine 12
BTW Instagram为此添加了独占文件扩展(ig)和UTI(com.instagram.exclusivegram).它仍然打开Open with ...菜单,但唯一的选择是Instagram.
更多信息:https://instagram.com/developer/mobile-sharing/iphone-hooks/
小智 0
仅回答您的第一个问题:您也许可以将“打开方式...”菜单限制为仅显示设备上的 Instagram(例如,通过删除 Camera+ 应用程序),但您无法限制将您的应用程序安装到其设备上的用户。这是因为 iPhone 可以识别哪些应用程序能够打开特定类型的文件,并自动显示所有可以打开的文件。
归档时间: |
|
查看次数: |
21589 次 |
最近记录: |