# SessionDelegate

## Public Method Summary

| Type | Methods                                                                 | Description                                                                                                 | Parameters                                                                                                                                                                 |
| ---- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void | onSessionConnected(sessionId: String, participants: \[Participant])     | This event handler is invoked when a session is connected                                                   | <ul><li><strong>sessionId</strong> - a unique identifier of a session</li><li><strong>participants</strong> - an array of users currently available in a session</li></ul> |
| void | onSessionDisconnect()                                                   | This event handler is invoked when a session finished                                                       | <p><br></p>                                                                                                                                                                |
| void | onSessionError(error: Error)                                            | This event handler is invoked when a session reported an error                                              | <ul><li><strong>error</strong> - an error produced</li></ul>                                                                                                               |
| void | onRemoteParticipantJoined(participant: Participant)                     | This event handler is invoked when a remote participant joined a session                                    | <ul><li><strong>participant</strong> - an object representing a participant</li></ul>                                                                                      |
| void | onRemoteParticipantLeft(participant: Participant)                       | This event handler is invoked when a participant left a session                                             | <ul><li><strong>participant</strong> - an object representing a participant</li></ul>                                                                                      |
| void | onRemoteParticipantStartMedia(participant: Participant)                 | This event handler is invoked when a remote participant started publishing media                            | <ul><li><strong>participant</strong> - an object representing a participant</li></ul>                                                                                      |
| void | onRemoteParticipantStopMedia(participant: Participant)                  | This event handler is invoked when a remote participant stopped publishing media                            | <ul><li><strong>participant</strong> - an object representing a participant</li></ul>                                                                                      |
| void | onRemoteParticipantNotification(message: String, participantId: String) | This event handler is invoked when a remote participant send message                                        | <ul><li><strong>message</strong> - text sent by participant</li><li><strong>participantId -</strong> sender's id</li></ul>                                                 |
| void | onDisconnected(reason: String?, initiator: String)                      | This event handler is invoked when a remote participant kick you from session, with optional message/reason | <p></p><ul><li><strong>reason</strong> - text sent by participant as kick reason</li><li><strong>initiator -</strong> sender's id</li></ul>                                |
