Gmail Extension crashes when sending images using UIActivityViewController

对着背影说爱祢 提交于 2020-01-04 11:08:09

问题


I use UIActivityViewController to share multiple images but when I choose a Gmail in the list, it opens it, then I see my attached files and then Gmail extension crashes. Next time it even doesn't open when I choose it.

But everything works fine with Mail app or other apps in the list in UIActivityViewController.

NSArray *scans = self.document.scans;
NSMutableArray *imagesData = [NSMutableArray arrayWithCapacity:[scans count]];

    for (DScan *scan in scans) {
         UIImage *image = [scan fullImageWithError:nil];
         [imagesData addObject:UIImageJPEGRepresentation(image, 0.6)];
    }

UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:imagesData applicationActivities:nil];
[self presentViewController:controller animated:YES completion:nil];

Please help my understand what is wrong in the code.

Thank you in advance!

来源:https://stackoverflow.com/questions/36275448/gmail-extension-crashes-when-sending-images-using-uiactivityviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!