I am using Gmail Share Extension from Google. I am providing implementation of:
- (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType;
- (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController;
- (NSString *)activityViewController:(UIActivityViewController *)activityViewController subjectForActivityType:(NSString *)activityType;
For Mail client (from Apple) it goes into delegate method below but Gmail
- (NSString *)activityViewController:(UIActivityViewController *)activityViewController subjectForActivityType:(NSString *)activityType;
Instead it shows subject same as body text. I am wondering how can I set subject different than body text for Gmail Share option.
The solutions is pretty simple - need pass NSUrl to the list of activity items.
Here is a sample on Swift:
Here is for Xamarin:
From that perspective, if you will pass any string items - they will be copied. App Store, Facebook and others are passing URLs or URLs+Images - which looks like also are handling somehow by Gmail client.
This is a GMail app issue
A bug report was filled on 12/06/2017
https://productforums.google.com/forum/#!topic/gmail/UJJx4BcRJiU;context-place=forum/gmail
Another discussion about the issue:
https://github.com/BranchMetrics/ios-branch-deep-linking/issues/789
I've been fighting this for a couple of days already and all I could find was marked as a known bug but browsing Reddit this morning just for fun I see that they successfully managed to have at least an empty Subject field, the question is, how? Anyone from Reddit maybe? If you share the same content on the native mail app it fills the subject field up with the title of the post which is the expected behavior.
UPDATE: Dude! This guy found how they do it on Reddit for iOS (and I noticed that Slack also does it) https://stackoverflow.com/a/51451433/1272263 They add a lot of empty spaces in the beginning of the body text! Took a screenshot comparing the original Mail (on the left) body and Gmail (on the right) one: