Подскажите, что я сделал не так, что фото не отображается в новом инстаграме? Он вообще не экспортируется туда.
РЕДАКТИРОВАТЬ: я вижу проблему в том, что она не отображается в предварительном просмотре Instagram. Когда я иду «Далее», появляется миниатюра. Мое выходное изображение 1000x1000, если это имеет значение.
NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Image.igo"];
// Write image to PNG
[UIImageJPEGRepresentation(preview.image, 1.0) writeToFile:savePath atomically:YES];
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL])
{
//imageToUpload is a file path with .ig file extension
documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
documentInteractionController.UTI = @"com.instagram.exclusivegram";
documentInteractionController.delegate = self;
documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"bla bla bla" forKey:@"InstagramCaption"];
[documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];