I am sharing Some content via UIActivityController
.
It is working fine for other Options.
I am able to get subject
and body
in Default Mail App.
But when I use to share the content with gmail
then my Subject
of the mail is gone and I am getting Body
content in Gmail Subject's
section:
Here is my code:
NSString *body = @"I am Body";
NSString *tagLine = @"I am Subject";
NSArray *objectToShare = [NSArray arrayWithObjects:body, nil];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectToShare applicationActivities:nil];
[activityVC setValue:tagLine forKey:@"subject"];
NSArray *excludeActivities = @[UIActivityTypeAirDrop,
UIActivityTypePrint,
UIActivityTypeAssignToContact,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypePostToVimeo];
activityVC.excludedActivityTypes = excludeActivities;
[self presentViewController:activityVC animated:YES completion:nil];
For better Picture Here is the screenshot:
With Default App:
With Gmail:
I also tried different answers on SO. But none of them works.