The UIDocumentInteractionController invokes an unknown application identifier. Error com.apple.mobilemail

I get the following error immediately after clicking one of the buttons of the controller for interacting with the document, that is, copying, printing, etc.:

Launch Services: Registering unknown app identifier com.apple.mobilemail failed Launch Services: Unable to find app identifier com.apple.mobilemail 

Here is the code that the interaction controller creates - a URL, etc. everything works, however delegate calls do not get to my controller, although I implemented delegate methods that are weird:

 UIDocumentInteractionController *documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL]; documentInteractionController.delegate = self; [documentInteractionController presentOptionsMenuFromRect:self.view.bounds inView:self.view animated:YES]; //None of these delegate methods are ever called which is weird: - (void) documentInteractionController: (UIDocumentInteractionController *) controller willBeginSendingToApplication: (NSString *) application { DebugLog(@"skldjfklsdjflksdjflsdk %@", application); } - (void) documentInteractionController: (UIDocumentInteractionController *) controller didEndSendingToApplication: (NSString *) application { DebugLog(@"skldjfklsdjflksdjflsdk %@", application); } - (void)documentInteractionControllerDidDismissOptionsMenu:(UIDocumentInteractionController *)controller { } - (void)documentInteractionControllerDidDismissOpenInMenu:(UIDocumentInteractionController *)controller { } 
+4
source share
1 answer

I managed to figure this out - for one reason or another there is an auto-detection error in the class, and you need to use the property when you start the interaction controller - it is very strange, but works fine for me:

 @property (nonatomic, strong) UIDocumentInteractionController *documentInteractionController; self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL]; self.documentInteractionController.delegate = self; [self.documentInteractionController presentOptionsMenuFromRect:self.view.bounds inView:self.view animated:YES]; 
+3
source

All Articles