0

I am getting the following error just after I press one of the document interaction controller buttons i.e. mail etc:

LaunchServices: invalidationHandler called

My email is not configured with iPhone Device.I want to show the alert for that.

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.

- (void)openAppList:(FileInfo *)fileinfo {

NSURL *fileURL = [NSURL fileURLWithPath:fileinfo.fullName];

UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
[interactionController retain];

interactionController.delegate = self;
BOOL present = [interactionController presentOptionsMenuFromRect:CGRectZero                                       inView:self.tabBarController.view
                                                        animated:YES];
if (!present) {
    [MainteOrErrorDialog initWithErrorCode:kAlertNotOpenInFileId filename:fileInfo.filename target:nil action:nil];
} else {
    [interactionController retain];
}

}

UIDocumentInteractionDelegate Method

- (void)documentInteractionController:(UIDocumentInteractionController *)controller
    willBeginSendingToApplication:(NSString *)application
{
     NSLog(@"Will Begin: %@", application);   
}

- (void)documentInteractionController:(UIDocumentInteractionController *)controller 
       didEndSendingToApplication:(NSString *)application
{
    NSLog(@"Did End: %@", application);    
}
Verma
  • 239
  • 1
  • 5
  • 16
  • Why are you retaining? but its nothing short of a bug. worry not. also a duplicate question of http://stackoverflow.com/questions/26183334/uiactivityviewcontroller-launchservices-invalidationhandler-called – soulshined Jan 23 '15 at 05:50
  • If i won't retain then it show the Unhandled exception and LaunchServices: invalidationHandler called – Verma Jan 23 '15 at 06:02
  • its just a bug, and it doesn't effect user performance or do anything really but display in the console log – soulshined Jan 23 '15 at 06:03
  • Can you Please explain me how it is duplicate question of http://stackoverflow.com/questions/26183334/uiactivityviewcontroller-launchservices-invalidationhandler-called ,it only show same error,But it is not same thing. – Verma Jan 23 '15 at 06:04
  • 1
    it's part of the [Launch Services Keys Network](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html) doesn't matter if it's UIActivityViewController or not, it's purpose is the same. – soulshined Jan 23 '15 at 06:13
  • you can check if a user has email set up like this : `if ([MFMailComposeViewController canSendMail])` – soulshined Jan 23 '15 at 06:16
  • Thanks for your suggestion,But i am not using the MFMailCompose it automatically came into document interaction. Just tell me how can i call the delegate method when i press mail button from document interaction – Verma Jan 23 '15 at 06:21
  • you said "My email is not configured with iPhone Device.I want to show the alert for that" i assumed that meant you want to show an alert if email isn't set up. I know that it automatically comes up, the apps automatically generate based off the document type your sharing. if your asking about the MFMailCompose delegate method is : `- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error` – soulshined Jan 23 '15 at 06:24
  • Please refer the link for better understanding of my bug http://stackoverflow.com/questions/28085606/uidocumentinteractioncontroller-delegate-method-do-not-called-when-pressed-on-ma – Verma Jan 23 '15 at 06:48

0 Answers0