UIDocumentInteractionController funktioniert unter iOS6 nicht mehr
Ich habe eine App, die sich mit Instagram teilt, das für iOS5 und jetzt für iOS6 entwickelt wurde. Die Freigabe funktioniert jedoch nicht mehrcanOpenURL
gibt true zurück und der Code wird ausgeführt. Die Bilder werden im Dokumentenordner der Anwendung mit einem gespeichert.igo
Erweiterung. Dies wird mit com.instagram.exclusivegram an instagram übergeben.
Der Code ist unten, er gibt die if-Anweisung ein und zeigt "hier in" an, öffnet jedoch nicht das Dialogfeld "Teilen mit", wie es früher am unteren Bildschirmrand verwendet wurde.
NSLog(@"%@", _imgToUpload);
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
uidController = [[UIDocumentInteractionController alloc] init];
//imageToUpload is a file path with .igo file extension
uidController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:_imgToUpload]];
uidController.UTI = @"com.instagram.exclusivegram";
uidController.delegate = self;
CGRect navRect = self.view.frame;
[uidController presentOpenInMenuFromRect:navRect inView:[UIApplication sharedApplication].keyWindow animated:YES];
NSLog(@"here in");
}
_imgToUpload
liefert auch den richtigen Dateipfad.
Danke, Nick