0

I am really struggling to get a UIActivityViewController to work as as a UIViewControllerRepresentable in SwiftUI. When trying to share to WhatsApp, for example, the screen just moves slightly as if some action is going to happen, then it returns to where it was, with the following litany of errors (some timestamps etc. removed for readability):

[core] HOST: Failed to load remote view controller with error: 
Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 2539 named
net.whatsapp.WhatsApp.ShareExtension.viewservice was interrupted, but the message was
sent over an additional proxy and therefore this proxy has become invalid."
[core] Sheet not being presented, calling premature completion
[net.whatsapp.WhatsApp.ShareExtension(2.20.111)] Connection to plugin interrupted while in use.
[net.whatsapp.WhatsApp.ShareExtension(2.20.111)] Connection to plugin invalidated while in use.

Is this just to do with the (seemingly horrendously buggy) behaviour of modals when working with SwiftUI? I just can't seem to solve this ongoing problem.

codewithfeeling
  • 6,236
  • 6
  • 41
  • 53
  • Does this answer your question https://stackoverflow.com/a/59433735/12299030? – Asperi Nov 09 '20 at 13:11
  • Thanks @Asperi but no - the modal does appear, but just doesn't work correctly. My code is very similary to the accepted answer in that question, but is not working correctly, giving the errors shown in my question. – codewithfeeling Nov 09 '20 at 13:46
  • Retested referenced code with Xcode 12.1 / iOS 14.1 - works fine. Would you prepare reproducible example? – Asperi Nov 09 '20 at 15:26
  • Hi @Asperi - that simple example of sharing a URL works fine for me too. My share content is not so simple - it's a generated screenshot, so sharing a reproducible exanple might just prove too complicated. I really just want to try and understand what is causing the error messages. I will try to improve my question with more detail. – codewithfeeling Nov 09 '20 at 16:43

0 Answers0