Class: MessageEvent

MessageEvent


new MessageEvent()

A message event

Source:

Extends

Methods


del()

Delete the messageEvent

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

Delete the messageEvent

 messageEvent.del().then(() => {
   console.log("message event deleted");
 }).catch((error)=>{
	  console.log("error deleting message event  ", error);
 });

delivered()

Set the messageEvent status to 'delivered'.
handled by the SDK

Overrides:
  • NXMEvent#delivered
Source:
Returns:
Type
Promise
Example

Set the messageEvent status to 'delivered'

 messageEvent.delivered().then(() => {
   console.log("message event status set to delivered");
 }).catch((error)=>{
	  console.log("error setting message event status to delivered  ", error);
 });

<async> fetchImage()

Download an Image from Media service

Source:
Returns:

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

Type
string
Example

Downloading an image from the messageEvent

 messageEvent.fetchImage().then((imageData) => {
   const img = new Image();
   img.src = imageData;
   document.body.appendChild(img);
 }).catch((error) => {
   console.log("error getting image ", error);
 });

seen()

Set the messageEvent status to 'seen'

Overrides:
  • NXMEvent#seen
Source:
Returns:
Type
Promise
Example

Set the messageEvent status to 'seen'

 messageEvent.seen().then(() => {
   console.log("message event status set to seen");
 }).catch((error)=>{
	  console.log("error setting message event status to seen ", error);
 });