Presence is the representation of all devices present in the Ditto mesh. You can read more about presence in the Mesh Networking section.
presence
namespace on the root Ditto
object:
localPeer
is the metadata set by the end user within your app. The remotePeers
property provides an array
of the other client devices connected to the mesh. (See End-User Defined Metadata for more information.)
Consideration | Best Practice |
---|---|
Peer metadata syncs across the mesh with each new connection. Therefore, sharing large data over low-bandwidth transports, such as Bluetooth Low Energy (LE), and low-quality connections may slow or disrupt the connection process. | Keep the size of peer metadata to a minimum, especially when syncing over Bluetooth LE or similar low-bandwidth transports. This is because peer metadata exceeding 128 KB, the maximum limit, results in the operation failing and Ditto throwing an error. |
Peer metadata is visible to all peers connected in the mesh. | Include only non-sensitive information in peer metadata. |
setPeerMetadata
API method as follows: