Search code examples
iosobjective-cjsqmessagesviewcontroller

JSQMessage with video and photo content


I seeking, but cannot find information about this. Can I add video and photo in one bubble message cell?

I implemented sending attachments one by one.

JSQPhotoMediaItem *photoItem = [[JSQPhotoMediaItem alloc] initWithImage:[UIImage imageNamed:@"goldengate"]];   
JSQMessage *photoMessage = [JSQMessagemessageWithSenderId:kJSQDemoAvatarIdSquires displayName:kJSQDemoAvatarDisplayNameSquires media:photoItem];

But how to send it together?


Solution

  • JSQMessagesViewController does not currently support adding multiple media items (location, photo or video) to a single message. Have a look at JSQMessage.h:

    + (instancetype)messageWithSenderId:(NSString *)senderId displayName:(NSString *)displayName text:(NSString *)text;
    + (instancetype)messageWithSenderId:(NSString *)senderId displayName:(NSString *)displayName media:(id<JSQMessageMediaData>)media;
    

    You would have to implement this functionality yourself or send them in separate messages.