I'm trying to share a photo to Instagram. So far my method is like this:
- (void)shareToInsta:(UIImage *)finalImage
{
NSString *savePath = [NSHomeDirectory() stringByAppendingString:@"Documents/instagramTmp.igo"];
[UIImageJPEGRepresentation(finalImage, 1.0) writeToFile:savePath atomically:YES];
_documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
_documentInteractionController.UTI = @"com.instagram.exclusivegram";
_documentInteractionController.delegate = self;
[_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
}
The Instagram option is presented in UIDocumentInteractionController
, but when I choose it, nothing happens. Anyone knows what I'm doing wrong?
PS: I'm already using a method just like this, but for WhatsApp, and it works just fine.