My app has a document interaction controller which is used to open documents in other apps. The following code displays a button that opens the 'Open in' menu and allows the user to open the file in other apps – i.e. Send it by mail if the user chose the mail app in the 'Open in' menu, the mail app creates a new email and automatically attaches the file to the mail body.
The following code worked fine in iOS7 but stopped working well on iOS8+. Files are not being attached to mails and I get an error log message.
Declaration for UIDocumentInteractionController:
@property (nonatomic, strong) UIDocumentInteractionController* interactionController;
Initialization:
self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:self.url];
self.interactionController.delegate = self;
self.interactionController.name = self.file.name;
The call for the 'Open in' menu:
[self.interactionController presentOpenInMenuFromBarButtonItem:self.openInBarButtonItem animated:YES];
Example for error message received after opening an excel file:
Unknown activity items supplied: ( { "com.microsoft.excel.xls" = <504b0304 ....000000>; }, "" )
viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x… {Message=Service Connection Interrupted} (lldb).
I would appreciate any ideas to fix this issue.
Thanks, Ori