Realtime Messaging
Public Member Functions | Static Public Member Functions | Properties | List of all members
RealtimeMessaging.DotNetCore.Extensibility.Presence Class Reference

Presence info, such as total subscriptions and metadata. More...

Public Member Functions

 Presence ()
 Initializes a new instance of the Presence class. More...
 

Static Public Member Functions

static Presence Deserialize (string message)
 Deserializes the specified json string to a presence object. More...
 
static void GetPresence (String url, bool isCluster, String applicationKey, String authenticationToken, String channel, OnPresenceDelegate callback)
 Gets the subscriptions in the specified channel and if active the first 100 unique metadata. More...
 
static void EnablePresence (String url, bool isCluster, String applicationKey, String privateKey, String channel, bool metadata, OnEnablePresenceDelegate callback)
 Enables presence for the specified channel with first 100 unique metadata if metadata is set to true. More...
 
static void DisablePresence (String url, bool isCluster, String applicationKey, String privateKey, String channel, OnDisablePresenceDelegate callback)
 Disables presence for the specified channel. More...
 

Properties

long Subscriptions [get]
 Gets the subscriptions value. More...
 
Dictionary< String, long > Metadata [get]
 Gets the first 100 unique metadata. More...
 

Detailed Description

Presence info, such as total subscriptions and metadata.

Constructor & Destructor Documentation

◆ Presence()

RealtimeMessaging.DotNetCore.Extensibility.Presence.Presence ( )

Initializes a new instance of the Presence class.

Member Function Documentation

◆ Deserialize()

static Presence RealtimeMessaging.DotNetCore.Extensibility.Presence.Deserialize ( string  message)
static

Deserializes the specified json string to a presence object.

Parameters
messageJson string to deserialize.
Returns

◆ DisablePresence()

static void RealtimeMessaging.DotNetCore.Extensibility.Presence.DisablePresence ( String  url,
bool  isCluster,
String  applicationKey,
String  privateKey,
String  channel,
OnDisablePresenceDelegate  callback 
)
static

Disables presence for the specified channel.

Parameters
urlServer containing the presence service.
isClusterSpecifies if url is cluster.
applicationKeyApplication key with access to presence service.
privateKeyThe private key provided when the ORTC service is purchased.
channelChannel to disable presence.
callbackCallback with error OrtcPresenceException and result.

◆ EnablePresence()

static void RealtimeMessaging.DotNetCore.Extensibility.Presence.EnablePresence ( String  url,
bool  isCluster,
String  applicationKey,
String  privateKey,
String  channel,
bool  metadata,
OnEnablePresenceDelegate  callback 
)
static

Enables presence for the specified channel with first 100 unique metadata if metadata is set to true.

Parameters
urlServer containing the presence service.
isClusterSpecifies if url is cluster.
applicationKeyApplication key with access to presence service.
privateKeyThe private key provided when the ORTC service is purchased.
channelChannel to activate presence.
metadataDefines if to collect first 100 unique metadata.
callbackCallback with error OrtcPresenceException and result.
client.EnablePresence("http://ortc-developers.realtime.co/server/2.1", true, "myApplicationKey", "myPrivateKey", "presence-channel", false, (error, result) =>
{
if (error != null)
{
Console.WriteLine(error.Message);
}
else
{
Console.WriteLine(result);
}
});

◆ GetPresence()

static void RealtimeMessaging.DotNetCore.Extensibility.Presence.GetPresence ( String  url,
bool  isCluster,
String  applicationKey,
String  authenticationToken,
String  channel,
OnPresenceDelegate  callback 
)
static

Gets the subscriptions in the specified channel and if active the first 100 unique metadata.

Parameters
urlServer containing the presence service.
isClusterSpecifies if url is cluster.
applicationKeyApplication key with access to presence service.
authenticationTokenAuthentication token with access to presence service.
channelChannel with presence data active.
callbackOnPresenceDelegateCallback with error OrtcPresenceException and result Presence.
client.Presence("http://ortc-developers.realtime.co/server/2.1", true, "myApplicationKey", "myAuthenticationToken", "presence-channel", (error, result) =>
{
if (error != null)
{
Console.WriteLine(error.Message);
}
else
{
if (result != null)
{
Console.WriteLine(result.Subscriptions);
if (result.Metadata != null)
{
foreach (var metadata in result.Metadata)
{
Console.WriteLine(metadata.Key + " - " + metadata.Value);
}
}
}
else
{
Console.WriteLine("There is no presence data");
}
}
});

Property Documentation

◆ Metadata

Dictionary<String,long> RealtimeMessaging.DotNetCore.Extensibility.Presence.Metadata
get

Gets the first 100 unique metadata.

◆ Subscriptions

long RealtimeMessaging.DotNetCore.Extensibility.Presence.Subscriptions
get

Gets the subscriptions value.


The documentation for this class was generated from the following file: