Class: ImageEvent

ImageEvent


new ImageEvent()

An image event

Source:

Extends

Methods


<async> del( [imageRepresentations])

Delete the image event, all 3 representations of it
passing only the one of the three URLs

Parameters:
Name Type Argument Default Description
imageRepresentations object <optional>
this.body.representations

the ImageEvent.body for the image to delete

Overrides:
  • NXMEvent#del
Source:
Returns:
Type
Promise

delivered()

Set the message status to 'delivered'

Overrides:
  • NXMEvent#delivered
Source:

<async> fetchImage( [type] [, representations])

Download an Image from Media service //3 representations

Parameters:
Name Type Argument Default Description
type string <optional>
"thumbnail"

original, medium, thumbnail,

representations string <optional>
this.body.representations

the ImageEvent.body for the image to download

Source:
Returns:

the dataUrl "data:image/jpeg;base64..."

Type
string
Example

Downloading an image from the imageEvent

imageEvent.fetchImage().then((imagedata) => {
   var img = new Image();
   img.onload = () => {};
   img.src = imagedata;

   // to cancel the request:
   // conversation.abortSendImage(imageRequest);
 });

seen()

Set the message status to 'seen'

Overrides:
  • NXMEvent#seen
Source: