Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new ChatClient in constructor
More...
|
void | DebugReturn (DebugLevel level, string message) |
| All debug output of the library will be reported through this method. Print it or put it in a buffer to use it on-screen. More...
|
|
void | OnDisconnected () |
| Disconnection happened. More...
|
|
void | OnConnected () |
| Client is connected now. More...
|
|
void | OnChatStateChange (ChatState state) |
| The ChatClient's state changed. Usually, OnConnected and OnDisconnected are the callbacks to react to. More...
|
|
void | OnGetMessages (string channelName, string[] senders, object[] messages) |
| Notifies app that client got new messages from server Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with number '0', sender with number '1' corresponds to message with number '1' and so on More...
|
|
void | OnPrivateMessage (string sender, object message, string channelName) |
| Notifies client about private message More...
|
|
void | OnSubscribed (string[] channels, bool[] results) |
| Result of Subscribe operation. Returns subscription result for every requested channel name. More...
|
|
void | OnUnsubscribed (string[] channels) |
| Result of Unsubscribe operation. Returns for channel name if the channel is now unsubscribed. More...
|
|
void | OnStatusUpdate (string user, int status, bool gotMessage, object message) |
| New status of another user (you get updates for users set in your friends list). More...
|
|
void | OnUserSubscribed (string channel, string user) |
| A user has subscribed to a public chat channel More...
|
|
void | OnUserUnsubscribed (string channel, string user) |
| A user has unsubscribed from a public chat channel More...
|
|
Callback interface for Chat client side. Contains callback methods to notify your app about updates. Must be provided to new ChatClient in constructor
◆ DebugReturn()
void Photon.Chat.IChatClientListener.DebugReturn |
( |
DebugLevel |
level, |
|
|
string |
message |
|
) |
| |
All debug output of the library will be reported through this method. Print it or put it in a buffer to use it on-screen.
- Parameters
-
level | DebugLevel (severity) of the message. |
message | Debug text. Print to System.Console or screen. |
◆ OnChatStateChange()
void Photon.Chat.IChatClientListener.OnChatStateChange |
( |
ChatState |
state | ) |
|
The ChatClient's state changed. Usually, OnConnected and OnDisconnected are the callbacks to react to.
- Parameters
-
◆ OnConnected()
void Photon.Chat.IChatClientListener.OnConnected |
( |
| ) |
|
Client is connected now.
Clients have to be connected before they can send their state, subscribe to channels and send any messages.
◆ OnDisconnected()
void Photon.Chat.IChatClientListener.OnDisconnected |
( |
| ) |
|
◆ OnGetMessages()
void Photon.Chat.IChatClientListener.OnGetMessages |
( |
string |
channelName, |
|
|
string[] |
senders, |
|
|
object[] |
messages |
|
) |
| |
Notifies app that client got new messages from server Number of senders is equal to number of messages in 'messages'. Sender with number '0' corresponds to message with number '0', sender with number '1' corresponds to message with number '1' and so on
- Parameters
-
channelName | channel from where messages came |
senders | list of users who sent messages |
messages | list of messages it self |
◆ OnPrivateMessage()
void Photon.Chat.IChatClientListener.OnPrivateMessage |
( |
string |
sender, |
|
|
object |
message, |
|
|
string |
channelName |
|
) |
| |
Notifies client about private message
- Parameters
-
sender | user who sent this message |
message | message it self |
channelName | channelName for private messages (messages you sent yourself get added to a channel per target username) |
◆ OnStatusUpdate()
void Photon.Chat.IChatClientListener.OnStatusUpdate |
( |
string |
user, |
|
|
int |
status, |
|
|
bool |
gotMessage, |
|
|
object |
message |
|
) |
| |
New status of another user (you get updates for users set in your friends list).
- Parameters
-
user | Name of the user. |
status | New status of that user. |
gotMessage | True if the status contains a message you should cache locally. False: This status update does not include a message (keep any you have). |
message | Message that user set. |
◆ OnSubscribed()
void Photon.Chat.IChatClientListener.OnSubscribed |
( |
string[] |
channels, |
|
|
bool[] |
results |
|
) |
| |
Result of Subscribe operation. Returns subscription result for every requested channel name.
If multiple channels sent in Subscribe operation, OnSubscribed may be called several times, each call with part of sent array or with single channel in "channels" parameter. Calls order and order of channels in "channels" parameter may differ from order of channels in "channels" parameter of Subscribe operation.
- Parameters
-
channels | Array of channel names. |
results | Per channel result if subscribed. |
◆ OnUnsubscribed()
void Photon.Chat.IChatClientListener.OnUnsubscribed |
( |
string[] |
channels | ) |
|
Result of Unsubscribe operation. Returns for channel name if the channel is now unsubscribed.
If multiple channels sent in Unsubscribe operation, OnUnsubscribed may be called several times, each call with part of sent array or with single channel in "channels" parameter. Calls order and order of channels in "channels" parameter may differ from order of channels in "channels" parameter of Unsubscribe operation.
- Parameters
-
channels | Array of channel names that are no longer subscribed. |
◆ OnUserSubscribed()
void Photon.Chat.IChatClientListener.OnUserSubscribed |
( |
string |
channel, |
|
|
string |
user |
|
) |
| |
A user has subscribed to a public chat channel
- Parameters
-
channel | Name of the chat channel |
user | UserId of the user who subscribed |
◆ OnUserUnsubscribed()
void Photon.Chat.IChatClientListener.OnUserUnsubscribed |
( |
string |
channel, |
|
|
string |
user |
|
) |
| |
A user has unsubscribed from a public chat channel
- Parameters
-
channel | Name of the chat channel |
user | UserId of the user who unsubscribed |
The documentation for this interface was generated from the following file: