TheLearner
TheLearner

Reputation: 19507

UIDocumentInteractionController causes unknown app identifier com.apple.mobilemail failed error

I am getting the following error just after I press one of the document interaction controller buttons i.e. copy, print 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 creates the interaction controller - the URL etc is all valid however the delegate calls don't hit my controller even though I have implemented the delegate methods which is 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
{

}

Upvotes: 4

Views: 2242

Answers (1)

TheLearner
TheLearner

Reputation: 19507

I managed to sort this out - for some or other reason there is an autorelease bug in the class and you need to use a property when you init the interaction controller - very weird but works perfectly 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];

Upvotes: 3

Related Questions