Mike
Mike

Reputation: 35

Skype Web SDK Sending Images via IM

I'm developing an application that incorporates the Skype for Business Online Web SDK. Within my application, I've managed to get Instant Messaging working by starting new conversations and making use of the chatService.sendMessage method as such:

var sendMessage = function(text) {
     currentConversation.chatService.sendMessage(text);
};

However, it is my understanding that this method only accepts text and it is crucial in this application for users to be able to send images (either as files/attachments or embedded within the chat itself).

I currently see no way to send a message via the SDK that includes a file / attachment. Is this possible?

Thanks in advance.

Upvotes: 1

Views: 576

Answers (2)

Sid - Microsoft
Sid - Microsoft

Reputation: 136

Currently we don't support image as a first class message type. But you could always Base64 encode your image file (if you want to transmit a file) and send the contents across to the remote party. Of course, in this case the remote party needs to understand that this message is a base64 encoded representation of an image.

Upvotes: 0

Ankit Vijay
Ankit Vijay

Reputation: 4078

Chat service has supports both "text" and "html" as message format. See property supportedMessageFormats.

You can try and use supported format as html to send image path in html. I'm facing issues with my Visual Studio hence could not create a sample. But documentation should help you.

Update

Looking at the comment it seems we may not be able to use image tag. Are you sending this message to Skype for Web App only? If yes, then you can send image url as text and then render the image in the chat window on the other side since you have full control over the chat history UI (unlike Skype for Business client)

Upvotes: 1

Related Questions