我正在开发应用程序,我需要在instagram上发布图像/视频。我已经能够成功地张贴在图像上的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的应用程序,发现我们也可以发布/上传视频。这意味着通过代码它应该是可能的。有人知道这个吗?
在此先感谢。
这仍然适合你吗? – user3344977