Soweit ich weiß, haben Sie com.instagram.photo verwenden, um die allgemeinen Optionen und com.instagram.exclusivegram für die documentinteractioncontroller UTI, wenn Sie wirklich zu bekommen Nur Instagram + verwenden Sie die korrekte Erweiterung .ig für allgemeine und .igo für exklusive Instagram.Instagram Haken com.instagram.exclusivegram nicht so exklusiv
Aus irgendeinem Grund sehe ich mehrere Optionen und nicht nur Instagram wie ich will ..
Habe ich etwas vergessen? Ist es anders gemacht?
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 ];
}
Ich habe das gleiche Problem ... – daidai
Bitte stellen Sie Ihre 'setupControllerWithURL: usingDelegate:' Methode. Das Ergebnis dieser Methode wird der 'documentInteractionController' -Eigenschaft zugewiesen, nachdem Sie' UTI' string gesetzt haben. – vokilam