6

我想将文字/照片/视频分享到 Instagram。我搜索了很长时间,但我没有得到任何适当的文档。如果有人知道 Instagram 上的分享,请告诉我。

4

2 回答 2

2

Instagram 媒体端点

目前,无法通过 API 上传。我们有意识地选择不添加它,原因如下:

Instagram 是关于你在旅途中的生活——我们希望鼓励从应用程序中拍摄照片。但是,将来我们可能会根据具体情况授予对单个应用程序的白名单访问权限。

我们要打击垃圾邮件和低质量的照片。一旦我们允许从其他来源上传,就很难控制进入 Instagram 生态系统的内容。尽管如此,我们正在努力确保用户在我们的平台上获得一致且高质量的体验。

也许你可以试试钩子:http: //instagram.com/developer/iphone-hooks/https://instagram.com/developer/mobile-sharing/android-intents/

于 2013-10-10T19:35:53.140 回答
0

试试下面的代码。

@property (nonatomic, retain) UIDocumentInteractionController *dic;    

CGRect rect = CGRectMake(0 ,0 , 0, 0);
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIGraphicsEndImageContext();
NSString  *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/test.igo"];

NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", jpgPath]];
//    NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@", screenshot]];

self.dic.UTI = @"com.instagram.photo";
self.dic = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.dic=[UIDocumentInteractionController interactionControllerWithURL:igImageHookFile];
self.dic.annotation = [NSDictionary dictionaryWithObject:@"Here Give what you want to share" forKey:@"InstagramCaption"];
[self.dic presentOpenInMenuFromRect: rect    inView: self.view animated: YES ];


- (UIDocumentInteractionController *) setupControllerWithURL: (NSURL*) fileURL usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate {
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL: fileURL];
interactionController.delegate = interactionDelegate;
return interactionController;
}

这个对我有用。希望它可以帮助你。

于 2013-04-03T04:45:17.250 回答