I am using UIActivityViewController
to share but on gmail when I set its subject specifically it does not set. Any help please.
let eventURL = eventShare[sender.tag]
let eventTitleText = eventTitle[sender.tag]
let contentDescription = eventDescription[sender.tag]
let contentURL:NSURL = NSURL(string:eventURL)!
let activityViewController : UIActivityViewController = UIActivityViewController(activityItems: [contentDescription, contentURL],applicationActivities: nil)
activityViewController.setValue("Our Buzz - \(eventTitleText)", forKey: "Subject")
activityViewController.popoverPresentationController?.sourceView = self.view
self.presentViewController(activityViewController, animated: true, completion: nil)
Try "subject" instead of "Subject" (lower case)
This seems to be a bug with the Gmail/Inbox apps. Using "Subject" as the key works correctly for Apple's Mail app but not for Gmail/Inbox. Other keys which also do not work include "subject", "title", "Title".
Another thing to be aware of is that the subject for Gmail/Inbox will include all the items in activityItems that you pass.
Since "Subject" sets the subject, people might be inclined to think that "Body" or some variant may work; but that results in a crash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With