• Parameters

    Returns Promise<IUploadImageResponse>

    Description

    Upload a image to get image url for sending image message

    Since

    2.43.0

    Async

    Example

    // For Web usage
    // get the image blob data from image uri, uri could be local file uri
    const imageBlob = await fetch(imageUri).then(res => res.blob())
    // create formdata and append "type" and "image" keys
    const imageFormData = new FormData();
    imageFormData.append('type', 'file')
    imageFormData.append('image', imageBlob)

    const { image_url } = await uploadImage({
    roomId: "<chat-room-id>",
    imageFormData: imageFormData
    });

Generated using TypeDoc