I am working on an application where I need to post an image / video on instagram. I successfully posted an image on Instagram with the following code:
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]; }
But I did not find a way to publish the video on it. I checked the Instagram app and found that we can send and upload videos. This means that with code this should be possible. Does anyone know about this?
Thanks in advance.
ios objective-c instagram
Sudha tiwari
source share