I'm attempting to share an image in my app using Gmail sharing extension
. Everything works okay except for the recipient of the email who receives a malformed file.
Sample project can be downloaded from here.
Using iOS 8.3
, Xcode 4.6.3
, Gmail 4.0
Sharing code looks like this:
UIImage *image = [UIImage imageNamed:@"image"];
NSData *imageData = UIImagePNGRepresentation(image);
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[imageData]
applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
This presents the activity sheet like this:
Pressing Gmail button shows:
And the email arrives like this:
But, everything is okay if I try to use iOS's Mail.app: