Seeing this error message in the logs, though not consistently, around the time that I use SLComposeViewController
to open a Twitter or Facebook share sheet. I am not using any new iOS 8 API, just testing existing code on iOS 8. I see others have had this problem and even seen crashes when using other modal view controllers from the Cocoa Touch SDK.
LaunchServices: invalidationHandler called
Are there new precautions to take with SLComposeViewController
and UIActivityViewController
in iOS 8? Something else to consider?
Looking at the developer forums: "That log message does not indicate any error on your part."
This gets rid of the Error message for me and works as expected. You have to get rid of the if statement that calls "isAvailableForServiceType:"
It should look like this. Happy coding.
Add this code after you present your activity view controller:
You may also need to define the
sourceRect
. I used the following code to display a SLComposeViewController from a tableView.I had a similar problem with a UIDocumentInteractionController, where when I tapped outside it to dismiss it, or selected another app to open the document in, it would crash with the "LaunchServices: invalideationHandler called" console message displayed twice (only using iOS 8).
A workaround is to add the call to
presentOpenInMenuFromRect:inView:animated
to the main queue, i.e.Regarding the auto-closing (not the crash): I think it's probably related to the link you are trying to share. I'm seeing the same thing when trying to post music links (Spotify, SoundCloud,...). The same tweet works if I replace the link by a link to some non-media-content. I'll file radar on this to see whether it's intentional...