UIActivityViewController Not Sharing Both URL & Text in Messages

361 Views Asked by At

I have a UIActivityViewController which takes in an array of URLs that resolve to images within the app's Documents folder and Strings:

var contentArray = [Any]();
contentArray.append("Test Text");
contentArray.append(URL(<<valid url to image in app's documents folder>>));

let shareSheet = UIActivityViewController(activityItems: contentArray, applicationActivities: nil);

if let popoverController = shareSheet.popoverPresentationController {
    popoverController.sourceView = <<valid reference to sending view>>;
}

self.present(shareSheet, animated: true);

When the user clicks "Messages" it only shows the image that was retrieved from the local URL and the String "Test Text" is not appended to the message body.

However, if the URL is changed to an external URL such as https://google.com, both the URL and the "Test Text" appear in the Messages body.

Is there a reason both text (Strings) and images (URLs linking to the app's documents folder) aren't shown in the Messages body?

0

There are 0 best solutions below