Когда я использую UIDocumentInteractionController
, чтобы разрешить пользователям делиться через Instagram, он работает, он открывает возможность «открыть с» и «Instagram» в качестве одного из параметров ... проблема заключается в том, что он также отображает множество других приложений, таких как «Facebook» и «Twitter» ...UIDocumentInteractionController share через Instagram (и ТОЛЬКО Instagram)
есть ли способ, что я могу сделать это только дать возможность открытия в приложении Instagram?
Instagram утверждает, что есть способ сделать это: http://instagram.com/developer/iphone-hooks/ но они упоминают это:
"Alternatively, if you want to show only Instagram in the application list (instead of Instagram plus any other public/jpeg-conforming apps) you can specify the extension class igo, which is of type com.instagram.exclusivegram."
но я честно понятия не имеют, что значит эта часть, "
extension class igo
"
Мои код:
UIImage *imageToUse = [UIImage imageNamed:@"imageToShare.png"];
NSString *documentDirectory=[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *saveImagePath=[documentDirectory stringByAppendingPathComponent:@"Image.ig"];
NSData *imageData=UIImagePNGRepresentation(imageToUse);
[imageData writeToFile:saveImagePath atomically:YES];
NSURL *imageURL=[NSURL fileURLWithPath:saveImagePath];
docController = [UIDocumentInteractionController interactionControllerWithURL:imageURL];
docController.delegate = self;
docController.annotation = [NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"This is the users caption that will be displayed in Instagram"], @"InstagramCaption", nil];
docController.UTI = @"com.instagram.exclusivegram";
[docController presentOpenInMenuFromRect:CGRectMake(1, 1, 1, 1) inView:self.view animated:YES];
показать эту ошибку - *** Завершить приложение из-за неперехваченного исключения «NSInternalInconsistencyException», причина: UIDocumentInteractionController ушел преждевременно! ios 10.3 – Sushobhit