Я использую следующий код в своем приложении для iOS, чтобы использовать хуки Instagram для iPhone для публикации фотографии в Instagram. Я хочу, чтобы в меню «Открыть в ...» было только приложение Instagram, а не другие приложения. Но в моем случае Camera + тоже появляется. Как я могу ограничиться Instagram?
Кроме того, могу ли я напрямую открывать Instagram вместо отображения меню «Открыть в»?
NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
//imageToUpload is a file path with .ig file extension
self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:imageToUpload]];
self.documentInteractionController.UTI = @"com.instagram.photo";
self.documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"my caption" forKey:@"InstagramCaption"];
[self.documentInteractionController presentOpenInMenuFromBarButtonItem:self.exportBarButtonItem animated:YES];
}