ios - Sharing attachments using Gmail sharing extension -


i'm attempting share image in app using gmail sharing extension. works okay except recipient of email receives malformed file.

sample project can downloaded here.

using ios 8.3, xcode 4.6.3, gmail 4.0

sharing code looks 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 activity sheet this:

uiactivityviewcontroller sheet

pressing gmail button shows:

gmail extension image attached

and email arrives this:

received email showing malformed attachment unable open image

but, okay if try use ios's mail.app:

mail.app attached image received email showing correct attachment


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -