Messages
- Methods
PropertiesMembersAttributesAttributes
A Message
represents an individual message that is sent to or received from Ably.
nameName
The event name, if provided.
Type: String
dataData
The message payload, if provided.
Type: String
, StringBuffer
, JSON Object
String
, ByteArray
, JSONObject
, JSONArray
String
, byte[]
, plain C# object that can be serialized to JSON
String
, Binary
(ASCII-8BIT String), Hash
, Array
String
, Bytearray
, Dict
, List
String
, Binary String
, Associative Array
, Array
NSString *
, NSData *
, NSDictionary *
, NSArray *
String
, NSData
, Dictionary
, Array
String
, Map
, List
extrasExtras
Metadata and/or ancillary payloads, if provided. The only currently valid payload for extras is the push
object.
Type: JSONObject
, JSONArray
plain C# object that can be converted to JSONJSON Object
Hash
, Array
Dict
, List
Dictionary
, Array
NSDictionary *
, NSArray *
Associative Array
, Array
idId
A Unique ID assigned by Ably to this message.
Type: String
clientIdClientIdclient_idclient_id
The client ID of the publisher of this message.
Type: String
connectionIdConnectionIdconnection_idconnection_id
The connection ID of the publisher of this message.
Type: String
timestampTimestamp
Timestamp when the message was received by the Ably, as milliseconds since the epocha Time
object
.Type: Integer
Long Integer
DateTimeOffset
Time
NSDate
encodingEncoding
This will typically be empty as all messages received from Ably are automatically decoded client-side using this value. However, if the message encoding cannot be processed, this attribute will contain the remaining transformations not applied to the data
payload.
Type: String
Message methods
Message.fromEncoded
Message.fromEncoded(Object encodedMsg, ChannelOptions channelOptions?) → Message
A static factory method to create a Message
from a deserialized Message
-like object encoded using Ably’s wire protocol.
Parameters
- encodedMsg
- a
Message
-like deserialized object.
Type:Object
- channelOptions
- an optional
ChannelOptions
. If you have an encrypted channel, use this to allow the library can decrypt the data.
Type:Object
Returns
A Message
object
Message.fromEncodedArray
Message.fromEncodedArray(Object[] encodedMsgs, ChannelOptions channelOptions?) → Message[]
A static factory method to create an array of Messages
from an array of deserialized Message
-like object encoded using Ably’s wire protocol.
Parameters
- encodedMsgs
- an array of
Message
-like deserialized objects.
Type:Array
- channelOptions
- an optional
ChannelOptions
. If you have an encrypted channel, use this to allow the library can decrypt the data.
Type:Object
Returns
An Array
of Message
objects