Managing a Message

Upload/Download media message#

Whenever you receive a media message from a user, or when retrying to upload a already sent media message you can use built-in sdk functions to upload/download the media content / The below method is applicable only if you are using sdk media server.

    FlyMessenger.uploadMedia(MEDIA_MESSAGE_ID)
    FlyMessenger.downloadMedia(MEDIA_MESSAGE_ID)
    ArgumentTypeDescription
    MEDIA_MESSAGE_IDStringMessageID of the ChatMeassage

    Note: Use same methods for Upload/Download Media Retry.

    Cancel upload/download#

    Whenever you would like to cancel upload/download of a media message , you can use built-in sdk functions to cancel the media content upload/download.The below method is applicable only if you are using sdk media server.

      FlyMessenger.cancelMediaUploadOrDownload(MESSAGE_ID)
      ArgumentTypeDescription
      MESSAGE_IDStringMessageID of the media message

      When the user cancelled the media download, then user need to restart the download using FlyMessenger.downloadMedia(messageId: String) method. In case of media upload, the upload initiated once the user sent the message In case of retry call FlyMessenger.uploadMedia(messageId: String).

      Save unsent message#

      To save a message which is not sent yet but typed can be saved for each user/group can be done by calling the below method.

        FlyMessenger.saveUnsentMessage(ID,MESSAGE,MENTIONEDUSERS,MENTIONSEARCH,MENTIONLOCATION,MENTIONLENGHT)
        ArgumentTypeDescription
        IDStringJid of the user/group
        MESSAGEStringText message content
        MENTIONEDUSERS[String]Users id of mentioned
        MENTIONSEARCH[String]Search words of mention
        MENTIONLOCATION[Int]Search words locations
        MENTIONLENGHT[Int]Search words length

        Note : MENTIONEDUSERS, MENTIONSEARCH, MENTIONLOCATION, MENTIONLENGHT for group mention values, otherwise it will be empty.

        Get unsent message of a user/group#

        To get the saved unsent message of a user/group call the below method.

          let unsentMessage : UnsentMessage = FlyMessenger.getUnsentMessageOf(ID)
          ArgumentTypeDescription
          IDStringJid of the user/group
          UnsentMessageUnsentMessageUnsent message content