Sharing attachments using the Gmail extension

I am trying to use an image in my application using Gmail sharing extension

. Everything works fine, except for the recipient of the email receiving the wrong file.

A sample project can be downloaded from here .

Using iOS 8.3

, Xcode 4.6.3

,Gmail 4.0

The general 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];

      

Here is the list of activities as follows:

UIActivityViewController sheet

Pressing the Gmail button shows:

Gmail extension with image attached

And the letter comes in like this:

Received email showing malformed attachmentUnable to open image

But it's ok if I try to use iOS Mail.app:

Mail.app with attached imageReceived email showing correct attachment

+3
ios gmail uiactivityviewcontroller ios-extensions


source to share


No one has answered this question yet

Check out similar questions:

841
Sending email in .NET via Gmail
380
Send email with GMail SMTP server from PHP page
271
How do I send an email using Gmail as a provider using Python?
82
Gmail mailing count not working
nineteen
UIActivityViewController Gmail Share Theme and Body
6
Gmail attachment and custom extension
five
UIActivityViewController Gmail Share cannot set subject field in swift
five
UIActivityViewController Gmail Body Duplication Extension
five
UIActivityViewController: Exclude Non-Apple Extensions?
0
Configure email sender and share recipient (ios)



All Articles
Loading...
X
Show
Funny
Dev
Pics