你能告诉我,我做错了什么,照片没有在新的Instagram中显示?它根本不会出口。
编辑:我发现问题是它没有显示在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];
答案 0 :(得分:0)