Chat/Attachments

Ask tech team
From QuickBlox Developers (API docs, code samples, SDK)
Jump to: navigation, search

Chat: attachments (sending photo, video etc files in chat conversations)

File attachments feature fully supported by QuickBlox allows sending files (photo pictures, videos, or any data formats really) to other users in the same chat conversation. Two options are available:

  • Peer to peer (P2P) file transfer

This uses XMPP mechanism of P2P file transfer and is only suitable for when both users are online. We usually recommend using cloud stored file transfer (see below) unless you have concerns / limitations on server-side.

  • Cloud stored file transfer

This uses QB Content API to store files when sent by the user and to retrieve them when other user(s) are ready to download them. The user experience is seamless and allows the user to send/receive files even when the other user is offline, the other user can open the conversation any time and download/play the file.

On client side, typically you want to handle things like progress bars, thumbnails for photos and videos etc. Find below a code sample on how to do that.

Code sample

Title APIs used Description
Simple iOS Chat code sample Chat, Users The Chat sample connects and socializes your users with the chat module. Features include: Peer to Peer Chat; Group chat; Location based chat; Push notifications for offline users.


Simple Android Chat code sample Chat, Users The Chat sample connects and socializes your users with the chat module. Features include: Peer to Peer Chat; Group chat; Location based chat; Push notification for offline users.


Simple JavaScript Chat (XMPP) code sample Chat, Users The Chat code sample connects and socializes your users with the chat module. Features include: Peer to Peer Chat; Group Chat; Location-based Chat.