使用他们的iOS挂钩将照片发布到Instagram [英] Post photo to Instagram using their iOS hooks

查看:75
本文介绍了使用他们的iOS挂钩将照片发布到Instagram的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的iOS应用程序中使用以下代码来使用Instagram iPhone挂钩将照片发布到Instagram。我只希望Open In ...菜单中有Instagram应用程序,没有其他应用程序。但在我的情况下,Camera +也出现了。我如何限制在Instagram?

I use the following code in my iOS app to use Instagram iPhone hooks to post a photo to Instagram. I only want the "Open In..." menu to have Instagram app, no other apps. But in my case Camera+ also shows up. How can I restrict to Instagram?

另外,我可以直接打开Instagram而不是显示打开菜单吗?

Also, can I directly open Instagram instead of showing Open In menu?

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];
}


推荐答案

只回答你的第一个问题:您可能可以将打开...菜单限制为仅为您的设备显示Instagram(例如,删除相机+应用程序),但您将无法限制安装应用程序的用户他们的设备。这是因为iPhone识别哪些应用程序能够打开特定类型的文件,并自动显示每个文件。

To answer only your first question: you may probably be able to restrict the "Open in ..." menu to just showing Instagram for your device (by deleting the Camera+ App, for example), but you won't be able to restrict users that install your app to their devices. And that's because the iPhone recognizes which applications are able to open a specific kind of files and it automatically show every one that does.

这篇关于使用他们的iOS挂钩将照片发布到Instagram的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆