Skip to content

Get Message Status

Backendless processes push notification delivery asynchronously. Even when the client app uses blocking/synchronous API, the server creates a push notification delivery task and adds to a queue. Server assigns an ID to the task and returns it to the client as messageId. As a result, push notification delivery status is not available right away. To retrieve the status, the client application must make a separate API call documented below:

Method

Blocking API

public MessageStatus Backendless.Messaging.GetMessageStatus( string messageId )

Non-Blocking API

public void GetMessageStatus( string messageId, AsyncCallback<MessageStatus> callback )

public Task<MessageStatus> GetMessageStatusAsync( string messageId )

where:

Argument                Description
messageId ID of the message for which the publishing status is retrieved.

Return value

Returns an object containing message status details. The object contains the following properties:

where:

Argument                Description
messageId ID of the message for which the publishing status is retrieved.
status Can be one of the following values: FAILED, PUBLISHED, SCHEDULED, CANCELLED, UNKNOWN
errorMessage Contains a detailed error message when status is "failed".
sendingTimeInMillis Time required to process the message.
successfulSendsAmount The number of successfully sent messages.
failedSendsAmount The number of undelivered messages.

Example

Blocking API

String messageID = "message id from request";

var status = Backendless.Messaging.GetMessageStatus(messageID);

Console.WriteLine("Current Status:" + status.Status);

Non-Blocking API

// Example 1
String messageID = "message id from request";

Backendless.Messaging.GetMessageStatus(messageID, new AsyncCallback<BackendlessAPI.Messaging.MessageStatus>(
  response =>
  {
     Console.WriteLine("Current Status:" + response.Status);
  },
  fault =>
  {
    Console.WriteLine("ERROR");
   }
));


 // Example 2
String messageID = "message id from request";

var status = await Backendless.Messaging.GetMessageStatusAsync(messageID);

Console.WriteLine("Current Status:" + status.Status);

Codeless Reference

push_get_message_status_1

where:

Argument                Description
message id ID of the message for which the publishing status is retrieved.

Returns an object containing message status details. The object contains the following properties:

where:

Argument                Description
messageId ID of the message for which the publishing status is retrieved.
status Can be one of the following values: FAILED, PUBLISHED, SCHEDULED, CANCELLED, UNKNOWN
errorMessage Contains a detailed error message when status is "failed".
sendingTimeInMillis Time required to process the message.
successfulSendsAmount The number of successfully sent messages.
failedSendsAmount The number of undelivered messages.

The example below checks the status of the message having the following identifier: "message:6052643A-F96C-4253-BCF0-F606A4BBB794".

pubsub_api_get_message_status_2