ConnectyCube / connectycube-js-sdk-releases

Releases materials for ConnectyCube JS SDK platform https://connectycube.com
9 stars 2 forks source link

attachment sending docs confusing #22

Closed krisbaum74 closed 4 years ago

krisbaum74 commented 4 years ago
const prepareMessageWithAttachmentAndSend = file => {
  const message = {
    type: dialog.type === 3 ? "chat" : "groupchat",
    body: "attachment",
    extension: {
      save_to_history: 1,
      dialog_id: dialog._id,
      attachments: [{ uid: result.uid, type: "photo" }]
    }
  };

  // send the message
  // ...

this the doc. are you saying with the //send the message that a sendmessage should be envoked or does connectycube already send a message with -->>

// JS SDK v2
ConnectyCube.storage
  .createAndUpload(fileParams)
  .then(prepareMessageWithAttachmentAndSend)
  .catch(error => {});
krisbaum74 commented 4 years ago

actually, can someone please update this example to have a full working one?

DaveLomber commented 4 years ago

@krisbaum74 you are right - 'send the message' means you should call a send message API like here https://developers.connectycube.com/js/messaging?id=sendreceive-chat-messages

We will update the guide to make it easier

Thanks for reporting!

DaveLomber commented 4 years ago

The guide is updated

https://developers.connectycube.com/js/messaging?id=attachments-photo-video

Thank you !