【发布时间】:2014-03-31 08:31:12
【问题描述】:
我正在开发需要在 Instagram 上发布图片/视频的应用。我已经成功地使用以下代码在 Instagram 上发布了图片:
NSString* filename = [NSString stringWithFormat:@"myimage.igo"];
NSString* savePath = [imagesPath stringByAppendingPathComponent:filename];
[UIImagePNGRepresentation(myImage) writeToFile:savePath atomically:YES];
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL])
{
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
self.documentInteractionController.UTI = @"com.instagram.image";
self.documentInteractionController.delegate = self;
[self.documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}
但没有找到任何方法来发布视频。我检查了 Instagram 应用程序,发现我们也可以发布/上传视频。这意味着通过代码应该是可能的。有人知道吗?
提前致谢。
【问题讨论】:
标签: ios objective-c instagram