ObjectMessageRequest

Sends an object containing custom data to some or all Users in a Room.


The data object is delivered to the selected Users (or all Users, excluding the sender) inside the target Room through the SFSEvent.OBJECT_MESSAGE event.

Constructor

new ObjectMessageRequest(obj, targetRoomopt, recipientsopt)

Creates a new instance of the ObjectMessageRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
objSFSObjectAn object containing custom parameters to be sent to the recipients.
targetRoomSFSRoom<optional>
nullThe object representing the Room where the message should be dispatched; if null, the last Room joined by the User is used.
recipientsArray.<SFSUser><optional>
nullA collection of objects representing the message recipients; if null or empty, the message is sent to all Users in the target Room, except the sender itself.