Насколько я знаю, вы должны использовать com.instagram.photo, чтобы получить общие параметры и com.instagram.exclusivegram для документа interfacecontroller UTI, если вы действительно только для Instagram + используйте правильное расширение .ig для общего и .igo для эксклюзивной Instagram.
По какой-то причине я вижу несколько параметров, а не только Instagram, как я хочу.
Я что-то забыл? Это делается по-другому?
UIImage *image = (UIImage *)[info valueForKey:UIImagePickerControllerOriginalImage];
NSURL *instagramURL = [NSURL URLWithString:@"instagram://"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
CGRect rect = CGRectMake(0,0,0,0);
CGRect cropRect=CGRectMake(0,0,612,612);
// ig voor gewone instagram, igo voor exclusive instagram
NSString *jpgPath=[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/temp/photo.igo"];
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], cropRect);
UIImage *img = [[UIImage alloc] initWithCGImage:imageRef];
CGImageRelease(imageRef);
[UIImageJPEGRepresentation(img, 1.0) writeToFile:jpgPath atomically:YES];
NSURL *igImageHookFile = [[NSURL alloc] initWithString:[[NSString alloc] initWithFormat:@"file://%@",jpgPath]];
// exclusive zou direct in de instagram app moeten openen, helaas toont hij meerdere opties met instagram ergenes helemaal achteraan
self.documentInteractionController.UTI = @"com.instagram.exclusivegram";
self.documentInteractionController = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"Alweer een Nostalgie deelnemer! #nostalgiebusje" forKey:@"InstagramCaption"];
[self.documentInteractionController presentOpenInMenuFromRect: rect inView: self.view animated: YES ];
}