getMessageOnlineUrl

Introduction

Get media message URL

Works since version 5.0.2.

In Flutter SDK 5.0.2 and above, the urls of all media messages (pictures, videos, voice, files) are empty. Users need to call this api to obtain the corresponding message urls and render them.

Parameter details

Parameter name Parameter type Required Platform Description
msgID String yes All message id

Returned template

V2TimValueCallback<V2TimMessageOnlineUrl>

{
    code : int
    desc : String
    data : {
      V2TimImageElem? imageElem;
      V2TimSoundElem? soundElem;
      V2TimVideoElem? videoElem;
      V2TimFileElem? fileElem;
    }
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the failure.
data V2TimMessageOnlineUrl The result of media message URL

Code example


    V2TimValueCallback<V2TimMessageOnlineUrl> getMessageOnlineUrlRes =
        await TencentImSDKPlugin.v2TIMManager
            .getMessageManager()
            .getMessageOnlineUrl(
              msgID: '', 
            );
    if (getMessageOnlineUrlRes.code == 0) {

    }

results matching ""

    No results matching ""