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.