Event_PC_MessageReceived
This notification specifies that a message was received in the group discussion that the user has joined.
The following table lists the parameters that you can include in this method.
Parameter | Type | Description |
---|---|---|
roomId | String | This parameter specifies the group discussion ID the message was in. |
roomName | String | This parameter specifies the name of the group discussion the message was received in. |
message | String | This parameter specifies the message content. |
authorId | String | This parameter specifies the ID of the user that sent the message to the group discussion. |
autherDisplayName | String | This parameter specifies the display name of the user that sent the message to the group discussion. |
messageId | String | This parameter specifies the ID of the message sent to the group discussion. |
isAlert | Boolean | This parameter specifies if the message sent to the group discussion is an alert. |
timeStamp | Number | This parameter specifies the time stamp date of the message sent to the group discussion. The timeStamp is specified in epoch time format. |
fileLinkCount | Number | This parameter specifies the number of file links in the message. |
clientMessageId | String | This parameter specifies that this is sent by the BlackBerry Connect client in the pc.SendMessage call. This parameter is returned only when a user receives their own message. |
Code example
If the notification is successful,
BEMS
sends the following response to the BlackBerry Connect
app and includes the group discussion name that the message was sent, the message, the time the message was sent, and the sender's name. In the following example, Jack sent a message to the Project updates group discussion. { "id":"S38", "error":null, "result": { "data": { "method":"pc.MessageReceived" "roomId":"ma-chan://gems.sw.rim.net/25ac15e7-9bff-4e78-9261-6e08aa43231e", "roomName":"Project updates", "message":"Release build ready", "authorId":"sip:jackL@example.com", "authorDisplayName":"Jack Lemon", "messageId":"125988FKKFJFHI2345", "isAlert":False, "timeStamp":1487015741 } }, "jsonrpc":"2.0" }