METHOD_RegisterTempRemotePresence

This method sends a registration request to BEMS to receive a remote user's presence status changes.

The following table describes the parameters that you can include in this method.

Parameter

Type

Description

contactId

String

This parameter specifies the contact ID of the user to register for the presence status changes.

Note: The registration subscription persists until the user is unregistered (for example, UnRegisterTempRemotePresence) or the session times out. The user can be outside of the conversation list.
dependencies String This parameter specifies the other methods that this method is dependent on. It specifies the comma delimited dependent request IDs.
reconnect String This parameter specifies that the BlackBerry Connect app re-establish the existing session. For example, if BlackBerry Connect goes to the background, when it comes to the foreground the same session is continued.

BEMS response and notification

The following table describes the parameters that BEMS returns and the notification to send to the BlackBerry Connect app when a contact registers for the presence status.

Parameter

Type

Description

method

String

This parameter specifies the method invoked (for example, GetContactPhotos).

state String This parameter specifies the state of the request to BEMS (for example, Processing or complete).

Example code

The following code example sends a request to BEMS to obtain a user's presence status.

{    
  "method":"RegisterTempRemotePresence",
  "params":
    {
      "contactId":"sip:user_1@example.com"
    },
  "id":"c58",
  "jsonrpc":"2.0"
}

If the request is successful, BEMS sends the following response to the BlackBerry Connect app and processes the request.

{
  "id":"c58",     
  "error":null,
  "result": 
    {
     "data": 
      {
       "method":"RegisterTempRemotePresence",
       "state":"PROCESSING"
      }
    },
   "jsonrpc":"2.0",
   "background":false
}

If there are no errors, BEMS sends the following notification to the BlackBerry Connect app and displays the user's updated presence status.

{
   "id":"c58",
   "sequence":1018691100000047,
   "result": 
    {
     "data": 
      {
       "method":"RegisterTempRemotePresence",
       "state":"COMPLETE"
      }
    },
   "jsonrpc":"2.0"
}