{"action":"created","issue":{"url":"https://api.github.com/repos/layerhq/Atlas-iOS/issues/907","labels_url":"https://api.github.com/repos/layerhq/Atlas-iOS/issues/907/labels{/name}","comments_url":"https://api.github.com/repos/layerhq/Atlas-iOS/issues/907/comments","events_url":"https://api.github.com/repos/layerhq/Atlas-iOS/issues/907/events","html_url":"https://github.com/layerhq/Atlas-iOS/issues/907","id":97783098,"number":907,"title":"Different metadata to differentiate taking a live picture from picking an album picture","user":{"login":"rafbgarcia","id":1904314,"avatar_url":"https://avatars.githubusercontent.com/u/1904314?v=3","gravatar_id":"","url":"https://api.github.com/users/rafbgarcia","html_url":"https://github.com/rafbgarcia","followers_url":"https://api.github.com/users/rafbgarcia/followers","following_url":"https://api.github.com/users/rafbgarcia/following{/other_user}","gists_url":"https://api.github.com/users/rafbgarcia/gists{/gist_id}","starred_url":"https://api.github.com/users/rafbgarcia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafbgarcia/subscriptions","organizations_url":"https://api.github.com/users/rafbgarcia/orgs","repos_url":"https://api.github.com/users/rafbgarcia/repos","events_url":"https://api.github.com/users/rafbgarcia/events{/privacy}","received_events_url":"https://api.github.com/users/rafbgarcia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-28T19:27:03Z","updated_at":"2015-07-28T22:27:35Z","closed_at":null,"body":"Hello there!\r\n\r\nNot sure if that's possible as of now, I've just started using Atlas (which is pretty awesome btw!) and would like to know if the user sent an image from his Photo Album or if he just took that Picture from this camera.\r\n\r\nAs far as I've read in `ATLConversationViewController` I couldn't see a way of natively doing it, am I mistaken?\r\n\r\nAppreciate the help! :)"},"comment":{"url":"https://api.github.com/repos/layerhq/Atlas-iOS/issues/comments/125770748","html_url":"https://github.com/layerhq/Atlas-iOS/issues/907#issuecomment-125770748","issue_url":"https://api.github.com/repos/layerhq/Atlas-iOS/issues/907","id":125770748,"user":{"login":"kmahal","id":1753989,"avatar_url":"https://avatars.githubusercontent.com/u/1753989?v=3","gravatar_id":"","url":"https://api.github.com/users/kmahal","html_url":"https://github.com/kmahal","followers_url":"https://api.github.com/users/kmahal/followers","following_url":"https://api.github.com/users/kmahal/following{/other_user}","gists_url":"https://api.github.com/users/kmahal/gists{/gist_id}","starred_url":"https://api.github.com/users/kmahal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmahal/subscriptions","organizations_url":"https://api.github.com/users/kmahal/orgs","repos_url":"https://api.github.com/users/kmahal/repos","events_url":"https://api.github.com/users/kmahal/events{/privacy}","received_events_url":"https://api.github.com/users/kmahal/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T22:27:34Z","updated_at":"2015-07-28T22:27:34Z","body":"@rafbgarcia you can add your own `LYRMessagePart` to each image sent. \r\n\r\nIn your `ATLConversationViewController` subclass, you can check the image type:\r\n```objc\r\n- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info\r\n{\r\n    [super imagePickerController:picker didFinishPickingMediaWithInfo:info];\r\n    NSURL *assetURL = (NSURL *)info[UIImagePickerControllerReferenceURL];\r\n    if (assetURL) {\r\n        // from camera roll.  set your property here\r\n    } else {\r\n        // taken from live camera.  set your property here.\r\n    }\r\n}\r\n```\r\n The `ATLConversationViewController` delegate method: `conversationViewController:messagesForMediaAttachments:` is called before Atlas sends each of your messages.  For images we send over 3 parts, the full size image, a thumbnail, and sizing data.  You can add a 4th message part when it sends images:\r\n```objc\r\n- (NSOrderedSet *)conversationViewController:(ATLConversationViewController *)viewController messagesForMediaAttachments:(NSArray *)mediaAttachments\r\n{\r\n\tNSMutableOrderedSet *set = [NSMutableOrderedSet new];\r\n\tfor (ATLMediaAttachment *mediaAttachement in mediaAttachments) {\r\n\t\tif ([mediAttachment.MIMEtype isEqualToString:ATLMIMETypeImageJPEG]) {\r\n\t\t\tNSArray *array = ATLMessagePartsWithMediaAttachment(mediaAttachment);\r\n\t\t\tLYRMessagePart *part = [LYRMessagePart messagePartWithMIMEType:@\"<YOUR-MIME-HERE\" data:<MAKE YOUR PROPERTY SET ABOVE INTO A DATA OBJECT>];\r\n\t\t\tarray = [array arrayByAddingObject:part];\r\n\t\t    NSError *error;\r\n\t\t    LYRMessage *message = [self.layerClient newMessageWithParts:array options:pushOptions error:&error];\r\n\t\t    if (error) {\r\n\t\t        return nil;\r\n\t\t    }\r\n\t\t    [set addObject:message];\r\n    \t} else {\r\n    \t\t[set addObject:[self.layerClient newMessageWithParts:ATLMessagePartsWithMediaAttachment:mediaAttachment options:pushOptions error:nil];\r\n    \t}\r\n\t}\r\n\treturn set;\r\n}\r\n```\r\nNow you can just search for your new MIME type defined and have that info on the `LYRMessage` object as a part."}}