# ILoginSession

> Reference the ILoginSession interface for user login and transmission management.

An instance of an account that is signing in to the Vivox network.

`#include <ILoginSession.h>`

## Public Types

|                                                                         | Name                                                                                                                                                                                                  |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| typedef FDelegateBeginLoginCompleted::FDelegate                         | **[FOnBeginLoginCompletedDelegate](#typedef-fonbeginlogincompleteddelegate)** The delegate that is called when `BeginLogin()` completes.                                                              |
| typedef FDelegateBeginSetCrossMutedCommunicationsCompleted::FDelegate   | **[FOnBeginSetCrossMutedCommunicationsCompletedDelegate](#typedef-fonbeginsetcrossmutedcommunicationscompleteddelegate)** The delegate to call when BeginSetCrossMutedCommunications completes.       |
| typedef FDelegateBeginClearCrossMutedCommunicationsCompleted::FDelegate | **[FOnBeginClearCrossMutedCommunicationsCompletedDelegate](#typedef-fonbeginclearcrossmutedcommunicationscompleteddelegate)** The delegate to call when BeginClearCrossMutedCommunications completes. |
| typedef FDelegateBeginAddBlockedSubscriptionCompleted::FDelegate        | **[FOnBeginAddBlockedSubscriptionCompletedDelegate](#typedef-fonbeginaddblockedsubscriptioncompleteddelegate)** The delegate to call when BeginAddBlockedSubscription completes.                      |
| typedef FDelegateBeginRemoveBlockedSubscriptionCompleted::FDelegate     | **[FOnBeginRemoveBlockedSubscriptionCompletedDelegate](#typedef-fonbeginremoveblockedsubscriptioncompleteddelegate)** The delegate to call when BeginRemoveBlockedSubscription completes.             |
| typedef FDelegateBeginAddAllowedSubscriptionCompleted::FDelegate        | **[FOnBeginAddAllowedSubscriptionCompletedDelegate](#typedef-fonbeginaddallowedsubscriptioncompleteddelegate)** The delegate to call when BeginAddAllowedSubscription completes.                      |
| typedef FDelegateBeginRemoveAllowedSubscriptionCompleted::FDelegate     | **[FOnBeginRemoveAllowedSubscriptionCompletedDelegate](#typedef-fonbeginremoveallowedsubscriptioncompleteddelegate)** The delegate to call when BeginRemoveAllowedSubscription completes.             |
| typedef FDelegateBeginAddPresenceSubscriptionCompleted::FDelegate       | **[FOnBeginAddPresenceSubscriptionCompletedDelegate](#typedef-fonbeginaddpresencesubscriptioncompleteddelegate)** The delegate to call when BeginAddPresenceSubscription completes.                   |
| typedef FDelegateBeginRemovePresenceSubscriptionCompleted::FDelegate    | **[FOnBeginRemovePresenceSubscriptionCompletedDelegate](#typedef-fonbeginremovepresencesubscriptioncompleteddelegate)** The delegate to call when BeginRemovePresenceSubscription completes.          |
| typedef FDelegateBeginSendSubscriptionReplyCompleted::FDelegate         | **[FOnBeginSendSubscriptionReplyCompletedDelegate](#typedef-fonbeginsendsubscriptionreplycompleteddelegate)** The delegate to call when BeginSendSubscriptionReply completes.                         |
| typedef FDelegateBeginSendDirectedMessageCompleted::FDelegate           | **[FOnBeginSendDirectedMessageCompletedDelegate](#typedef-fonbeginsenddirectedmessagecompleteddelegate)** The delegate to call when BeginSendDirectedMessage completes.                               |
| typedef FDelegateBeginStartAudioInjectionCompleted::FDelegate           | **[FOnBeginStartAudioInjectionCompletedDelegate](#typedef-fonbeginstartaudioinjectioncompleteddelegate)** The delegate to call when BeginStartAudioInjection completes.                               |
| typedef FDelegateBeginSetSafeVoiceConsentCompleted::FDelegate           | **[FOnBeginSetSafeVoiceConsentCompletedDelegate](#typedef-fonbeginsetsafevoiceconsentcompleteddelegate)**                                                                                             |
| typedef FDelegateBeginGetSafeVoiceConsentCompleted::FDelegate           | **[FOnBeginGetSafeVoiceConsentCompletedDelegate](#typedef-fonbegingetsafevoiceconsentcompleteddelegate)**                                                                                             |

## Public Functions

|                                                                                                                                         | Name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| virtual const TMap\< [ChannelId](./class_channel_id.md), TSharedPtr\< [IChannelSession](./class_i_channel_session.md) > > &             | **[ChannelSessions](#function-channelsessions)**() const =0The list of channel sessions associated with this login session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| virtual const TMap\< [AccountId](./class_account_id.md), TSharedPtr\< [IPresenceSubscription](./class_i_presence_subscription.md) > > & | **[PresenceSubscriptions](#function-presencesubscriptions)**() const =0The list of presence subscriptions associated with this login session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| virtual const TSet\< [AccountId](./class_account_id.md) > &                                                                             | **[BlockedSubscriptions](#function-blockedsubscriptions)**() const =0The list of accounts blocked from seeing this account's online status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| virtual const TSet\< [AccountId](./class_account_id.md) > &                                                                             | **[AllowedSubscriptions](#function-allowedsubscriptions)**() const =0The list of accounts allowed to see this account's online status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| virtual const TSet\< [AccountId](./class_account_id.md) > &                                                                             | **[CrossMutedCommunications](#function-crossmutedcommunications)**() const =0The list of accounts which have bi-directionally muted communications with this login session.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| virtual LoginState                                                                                                                      | **[State](#function-state)**() const =0The current state of this login session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| virtual const [Presence](./class-presence.md) &                                                                                         | **[CurrentPresence](#function-currentpresence)**() =0The online status that is sent to accounts that subscribe to the presence of this account.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| virtual VivoxCoreError                                                                                                                  | **[SetCurrentPresence](#function-setcurrentpresence)**(const [Presence](./class-presence.md) & value) =0Set this player's online status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| virtual const [AccountId](./class_account_id.md) &                                                                                      | **[LoginSessionId](#function-loginsessionid)**() const =0The unique identifier for this login session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| virtual VivoxCoreError                                                                                                                  | **[BeginLogin](#function-beginlogin)**(const FString & server, const FString & accessToken, SubscriptionMode subscriptionMode, const TSet\< [AccountId](./class_account_id.md) > & presenceSubscriptions, const TSet\< [AccountId](./class_account_id.md) > & blockedPresenceSubscriptions, const TSet\< [AccountId](./class_account_id.md) > & allowedPresenceSubscriptions, [FOnBeginLoginCompletedDelegate](#typedef-fonbeginlogincompleteddelegate) theDelegate =[FOnBeginLoginCompletedDelegate](#typedef-fonbeginlogincompleteddelegate)()) =0Begin the sign in process for this session with presence. |
| virtual VivoxCoreError                                                                                                                  | **[BeginLogin](#function-beginlogin)**(const FString & server, const FString & accessToken, [FOnBeginLoginCompletedDelegate](#typedef-fonbeginlogincompleteddelegate) theDelegate =[FOnBeginLoginCompletedDelegate](#typedef-fonbeginlogincompleteddelegate)()) =0Begin the sign in process for this session with no presence.                                                                                                                                                                                                                                                                                |
| virtual [IChannelSession](./class_i_channel_session.md) &                                                                               | **[GetChannelSession](#function-getchannelsession)**(const [ChannelId](./class_channel_id.md) & channelId) =0Gets the channel session for this channelId. If necessary, this creates a channel session.                                                                                                                                                                                                                                                                                                                                                                                                       |
| virtual void                                                                                                                            | **[DeleteChannelSession](#function-deletechannelsession)**(const [ChannelId](./class_channel_id.md) & channelId) =0Delete the channel session for this channelId, and disconnect the session if necessary.                                                                                                                                                                                                                                                                                                                                                                                                    |
| virtual VivoxCoreError                                                                                                                  | **[BeginSetCrossMutedCommunications](#function-beginsetcrossmutedcommunications)**(const [AccountId](./class_account_id.md) & accountId, const bool & muted, [FOnBeginSetCrossMutedCommunicationsCompletedDelegate](#typedef-fonbeginsetcrossmutedcommunicationscompleteddelegate) theDelegate) =0Crossmute an [AccountId](./class_account_id.md), which bi-directionally mutes audio and text between that account and this login session.                                                                                                                                                                   |
| virtual VivoxCoreError                                                                                                                  | **[BeginSetCrossMutedCommunications](#function-beginsetcrossmutedcommunications)**(const TSet\< [AccountId](./class_account_id.md) > & accountIdSet, const bool & muted, [FOnBeginSetCrossMutedCommunicationsCompletedDelegate](#typedef-fonbeginsetcrossmutedcommunicationscompleteddelegate) theDelegate) =0Crossmute a set of AccountIds, which bi-directionally mutes audio and text between those accounts and this login session.                                                                                                                                                                       |
| virtual VivoxCoreError                                                                                                                  | **[BeginClearCrossMutedCommunications](#function-beginclearcrossmutedcommunications)**([FOnBeginClearCrossMutedCommunicationsCompletedDelegate](#typedef-fonbeginclearcrossmutedcommunicationscompleteddelegate) theDelegate) =0Clear the bi-directionally muted communications list. This unmutes all AccountIds and allows audio and text through any means that are not otherwise prevented.                                                                                                                                                                                                               |
| virtual VivoxCoreError                                                                                                                  | **[BeginAddBlockedSubscription](#function-beginaddblockedsubscription)**(const [AccountId](./class_account_id.md) & accountId, [FOnBeginAddBlockedSubscriptionCompletedDelegate](#typedef-fonbeginaddblockedsubscriptioncompleteddelegate) theDelegate =[FOnBeginAddBlockedSubscriptionCompletedDelegate](#typedef-fonbeginaddblockedsubscriptioncompleteddelegate)()) =0Block incoming subscription requests from the specified account.                                                                                                                                                                     |
| virtual VivoxCoreError                                                                                                                  | **[BeginRemoveBlockedSubscription](#function-beginremoveblockedsubscription)**(const [AccountId](./class_account_id.md) & accountId, [FOnBeginRemoveBlockedSubscriptionCompletedDelegate](#typedef-fonbeginremoveblockedsubscriptioncompleteddelegate) theDelegate =[FOnBeginRemoveBlockedSubscriptionCompletedDelegate](#typedef-fonbeginremoveblockedsubscriptioncompleteddelegate)()) =0Unblock incoming subscription requests from the specified account. Subscription requests from the specified account cause an event to be raised to the application.                                                |
| virtual VivoxCoreError                                                                                                                  | **[BeginAddAllowedSubscription](#function-beginaddallowedsubscription)**(const [AccountId](./class_account_id.md) & accountId, [FOnBeginAddAllowedSubscriptionCompletedDelegate](#typedef-fonbeginaddallowedsubscriptioncompleteddelegate) theDelegate =[FOnBeginAddAllowedSubscriptionCompletedDelegate](#typedef-fonbeginaddallowedsubscriptioncompleteddelegate)()) =0Allow incoming subscription requests from the specified account.                                                                                                                                                                     |
| virtual VivoxCoreError                                                                                                                  | **[BeginRemoveAllowedSubscription](#function-beginremoveallowedsubscription)**(const [AccountId](./class_account_id.md) & accountId, [FOnBeginRemoveAllowedSubscriptionCompletedDelegate](#typedef-fonbeginremoveallowedsubscriptioncompleteddelegate) theDelegate =[FOnBeginRemoveAllowedSubscriptionCompletedDelegate](#typedef-fonbeginremoveallowedsubscriptioncompleteddelegate)()) =0Disallow automatic acceptance of incoming subscription requests from the specified account. Subscription requests from the specified account cause an event to be raised to the application.                       |
| virtual VivoxCoreError                                                                                                                  | **[BeginAddPresenceSubscription](#function-beginaddpresencesubscription)**(const [AccountId](./class_account_id.md) & accountId, [FOnBeginAddPresenceSubscriptionCompletedDelegate](#typedef-fonbeginaddpresencesubscriptioncompleteddelegate) theDelegate =[FOnBeginAddPresenceSubscriptionCompletedDelegate](#typedef-fonbeginaddpresencesubscriptioncompleteddelegate)()) =0Subscribe to the specified account.                                                                                                                                                                                            |
| virtual VivoxCoreError                                                                                                                  | **[BeginRemovePresenceSubscription](#function-beginremovepresencesubscription)**(const [AccountId](./class_account_id.md) & accountId, [FOnBeginRemovePresenceSubscriptionCompletedDelegate](#typedef-fonbeginremovepresencesubscriptioncompleteddelegate) theDelegate =[FOnBeginRemovePresenceSubscriptionCompletedDelegate](#typedef-fonbeginremovepresencesubscriptioncompleteddelegate)()) =0Unsubscribe from the specified account.                                                                                                                                                                      |
| virtual VivoxCoreError                                                                                                                  | **[BeginSendSubscriptionReply](#function-beginsendsubscriptionreply)**(const [AccountId](./class_account_id.md) & accountId, const SubscriptionReply & replyType, [FOnBeginSendSubscriptionReplyCompletedDelegate](#typedef-fonbeginsendsubscriptionreplycompleteddelegate) theDelgate =[FOnBeginSendSubscriptionReplyCompletedDelegate](#typedef-fonbeginsendsubscriptionreplycompleteddelegate)()) =0Reply to a subscription request received from EventSubscriptionRequestReceived.                                                                                                                        |
| virtual VivoxCoreError                                                                                                                  | **[BeginSendDirectedMessage](#function-beginsenddirectedmessage)**(const [AccountId](./class_account_id.md) & accountId, const FString & language, const FString & message, const FString & applicationStanzaNamespace, const FString & applicationStanzaBody, [FOnBeginSendDirectedMessageCompletedDelegate](#typedef-fonbeginsenddirectedmessagecompleteddelegate) theDelegate =[FOnBeginSendDirectedMessageCompletedDelegate](#typedef-fonbeginsenddirectedmessagecompleteddelegate)()) =0Send a message to a specific account.                                                                            |
| virtual VivoxCoreError                                                                                                                  | **[BeginSendDirectedMessage](#function-beginsenddirectedmessage)**(const [AccountId](./class_account_id.md) & accountId, const FString & message, [FOnBeginSendDirectedMessageCompletedDelegate](#typedef-fonbeginsenddirectedmessagecompleteddelegate) theDelegate =[FOnBeginSendDirectedMessageCompletedDelegate](#typedef-fonbeginsenddirectedmessagecompleteddelegate)()) =0Send a message to a specific account.                                                                                                                                                                                         |
| virtual VivoxCoreError                                                                                                                  | **[BeginStartAudioInjection](#function-beginstartaudioinjection)**(const FString & filePath, [FOnBeginStartAudioInjectionCompletedDelegate](#typedef-fonbeginstartaudioinjectioncompleteddelegate) theDelegate =[FOnBeginStartAudioInjectionCompletedDelegate](#typedef-fonbeginstartaudioinjectioncompleteddelegate)()) =0Start broadcasting audio from a file to all connected ChannelSessions.                                                                                                                                                                                                             |
| virtual VivoxCoreError                                                                                                                  | **[StopAudioInjection](#function-stopaudioinjection)**() =0Stop broadcasting audio from a file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| virtual bool                                                                                                                            | **[IsAudioInjecting](#function-isaudioinjecting)**() =0True if currently broadcasting audio from a file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| virtual VivoxCoreError                                                                                                                  | **[BeginSetSafeVoiceConsentStatus](#function-beginsetsafevoiceconsentstatus)**(const bool & consentToSet, const FString & environmentId, const FString & projectId, const FString & UASToken, FOnBeginSetSafeVoiceConsentCompletedDelegate theDelegate =FOnBeginSetSafeVoiceConsentCompletedDelegate()) =0Sets the SafeVoice consent for the LoginSession.                                                                                                                                                                                                                                                    |
| virtual VivoxCoreError                                                                                                                  | **[BeginGetSafeVoiceConsentStatus](#function-begingetsafevoiceconsentstatus)**(const FString & environmentId, const FString & projectId, const FString & UASToken, FOnBeginGetSafeVoiceConsentCompletedDelegate theDelegate =FOnBeginGetSafeVoiceConsentCompletedDelegate()) =0Gets the SafeVoice consent for the LoginSession.                                                                                                                                                                                                                                                                               |
| virtual VivoxCoreError                                                                                                                  | **[SetTransmissionMode](#function-settransmissionmode)**(TransmissionMode mode, [ChannelId](./class_channel_id.md) singleChannel =[ChannelId](./class_channel_id.md)()) =0Set whether microphone audio and injected audio should be transmitted to no channels, all channels, or a specific single channel.                                                                                                                                                                                                                                                                                                   |
| virtual TransmissionMode                                                                                                                | **[GetTransmissionMode](#function-gettransmissionmode)**() const =0Get the transmission policy that is set for the player.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| virtual TArray\< [ChannelId](./class_channel_id.md) >                                                                                   | **[GetTransmittingChannels](#function-gettransmittingchannels)**() const =0Get the [ChannelId](./class_channel_id.md) of each channel that will broadcast non-muted microphone input and injected audio.                                                                                                                                                                                                                                                                                                                                                                                                      |
| virtual VivoxCoreError                                                                                                                  | **[SetParticipantSpeakingUpdateRate](#function-setparticipantspeakingupdaterate)**(ParticipantSpeakingUpdateRate rate) =0Set how often the SDK raises [IChannelSession::EventAfterParticipantUpdated](./class_i_channel_session.md#variable-eventafterparticipantupdated) events that relate to speaking activity.                                                                                                                                                                                                                                                                                            |
| virtual ParticipantSpeakingUpdateRate                                                                                                   | **[GetParticipantSpeakingUpdateRate](#function-getparticipantspeakingupdaterate)**() const =0Get the frequency set for speech-related participant events for all participants in all connected channels.                                                                                                                                                                                                                                                                                                                                                                                                      |
| virtual [ITextToSpeech](./class_i_text_to_speech.md) &                                                                                  | **[TTS](#function-tts)**() =0The text-to-speech (TTS) subsystem instance associated with this login session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| virtual void                                                                                                                            | **[Logout](#function-logout)**() =0Sign the account out of the Vivox system. Unlike in the case of an unexpected sign out due to loss of network connectivity, calling this method raises the EventStateChanged event with a value of LoginState::LoggingOut first, before raising a second event for LoginState::LoggedOut.                                                                                                                                                                                                                                                                                  |
| virtual FString                                                                                                                         | **[GetLoginToken](#function-getlogintoken)**(const FString & tokenSigningKey, FTimespan tokenExpirationDuration) const =0Get a login token for this account.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## Public Attributes

|                               | Name                                                                                                                                                     |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SubscriptionRequestReceived   | **[EventSubscriptionRequestReceived](#variable-eventsubscriptionrequestreceived)** An event that indicates a new subscription request has been received. |
| DirectedTextMessageReceived   | **[EventDirectedTextMessageReceived](#variable-eventdirectedtextmessagereceived)** An event that indicates another player has sent you a text message.   |
| StateChanged                  | **[EventStateChanged](#variable-eventstatechanged)** The event that raises when `State()` changes.                                                       |
| ChannelJoined                 | **[EventChannelJoined](#variable-eventchanneljoined)** The event that fires when a new ChannelSession is joined.                                         |
| ChannelLeft                   | **[EventChannelLeft](#variable-eventchannelleft)** The event that fires when a ChannelSession is le.                                                     |
| SendDirectedTextMessageFailed | **[EventSendDirectedTextMessageFailed](#variable-eventsenddirectedtextmessagefailed)** An event that indicates a directed message delivery failed.       |
| AudioInjectionCompleted       | **[EventAudioInjectionCompleted](#variable-eventaudioinjectioncompleted)** An event that indicates you are no longer injecting audio.                    |

## Public Types Documentation

### typedef FOnBeginLoginCompletedDelegate

```cpp
typedef FDelegateBeginLoginCompleted::FDelegate ILoginSession::FOnBeginLoginCompletedDelegate;
```

The delegate that is called when `BeginLogin()` completes.

### typedef FOnBeginSetCrossMutedCommunicationsCompletedDelegate

```cpp
typedef FDelegateBeginSetCrossMutedCommunicationsCompleted::FDelegate ILoginSession::FOnBeginSetCrossMutedCommunicationsCompletedDelegate;
```

The delegate to call when BeginSetCrossMutedCommunications completes.

### typedef FOnBeginClearCrossMutedCommunicationsCompletedDelegate

```cpp
typedef FDelegateBeginClearCrossMutedCommunicationsCompleted::FDelegate ILoginSession::FOnBeginClearCrossMutedCommunicationsCompletedDelegate;
```

The delegate to call when BeginClearCrossMutedCommunications completes.

### typedef FOnBeginAddBlockedSubscriptionCompletedDelegate

```cpp
typedef FDelegateBeginAddBlockedSubscriptionCompleted::FDelegate ILoginSession::FOnBeginAddBlockedSubscriptionCompletedDelegate;
```

The delegate to call when BeginAddBlockedSubscription completes.

### typedef FOnBeginRemoveBlockedSubscriptionCompletedDelegate

```cpp
typedef FDelegateBeginRemoveBlockedSubscriptionCompleted::FDelegate ILoginSession::FOnBeginRemoveBlockedSubscriptionCompletedDelegate;
```

The delegate to call when BeginRemoveBlockedSubscription completes.

### typedef FOnBeginAddAllowedSubscriptionCompletedDelegate

```cpp
typedef FDelegateBeginAddAllowedSubscriptionCompleted::FDelegate ILoginSession::FOnBeginAddAllowedSubscriptionCompletedDelegate;
```

The delegate to call when BeginAddAllowedSubscription completes.

### typedef FOnBeginRemoveAllowedSubscriptionCompletedDelegate

```cpp
typedef FDelegateBeginRemoveAllowedSubscriptionCompleted::FDelegate ILoginSession::FOnBeginRemoveAllowedSubscriptionCompletedDelegate;
```

The delegate to call when BeginRemoveAllowedSubscription completes.

### typedef FOnBeginAddPresenceSubscriptionCompletedDelegate

```cpp
typedef FDelegateBeginAddPresenceSubscriptionCompleted::FDelegate ILoginSession::FOnBeginAddPresenceSubscriptionCompletedDelegate;
```

The delegate to call when BeginAddPresenceSubscription completes.

### typedef FOnBeginRemovePresenceSubscriptionCompletedDelegate

```cpp
typedef FDelegateBeginRemovePresenceSubscriptionCompleted::FDelegate ILoginSession::FOnBeginRemovePresenceSubscriptionCompletedDelegate;
```

The delegate to call when BeginRemovePresenceSubscription completes.

### typedef FOnBeginSendSubscriptionReplyCompletedDelegate

```cpp
typedef FDelegateBeginSendSubscriptionReplyCompleted::FDelegate ILoginSession::FOnBeginSendSubscriptionReplyCompletedDelegate;
```

The delegate to call when BeginSendSubscriptionReply completes.

### typedef FOnBeginSendDirectedMessageCompletedDelegate

```cpp
typedef FDelegateBeginSendDirectedMessageCompleted::FDelegate ILoginSession::FOnBeginSendDirectedMessageCompletedDelegate;
```

The delegate to call when BeginSendDirectedMessage completes.

**Remark**: The VivoxCoreError parameter is a status code for the request, and the FString parameter is a request ID unique to the directed message that is sent. If the message cannot be delivered to the intended recipient, then EventSendDirectedTextMessageFailed is raised with an error code and a matching request ID. You can compare this request ID with the ID returned by this delegate to determine which message failed to be delivered.

### typedef FOnBeginStartAudioInjectionCompletedDelegate

```cpp
typedef FDelegateBeginStartAudioInjectionCompleted::FDelegate ILoginSession::FOnBeginStartAudioInjectionCompletedDelegate;
```

The delegate to call when BeginStartAudioInjection completes.

### typedef FOnBeginSetSafeVoiceConsentCompletedDelegate

```cpp
typedef FDelegateBeginSetSafeVoiceConsentCompleted::FDelegate ILoginSession::FOnBeginSetSafeVoiceConsentCompletedDelegate;
```

### typedef FOnBeginGetSafeVoiceConsentCompletedDelegate

```cpp
typedef FDelegateBeginGetSafeVoiceConsentCompleted::FDelegate ILoginSession::FOnBeginGetSafeVoiceConsentCompletedDelegate;
```

## Public Functions Documentation

### function ChannelSessions

```cpp
virtual const TMap< ChannelId, TSharedPtr< IChannelSession > > & ChannelSessions() const =0
```

The list of channel sessions associated with this login session.

### function PresenceSubscriptions

```cpp
virtual const TMap< AccountId, TSharedPtr< IPresenceSubscription > > & PresenceSubscriptions() const =0
```

The list of presence subscriptions associated with this login session.

**Remark**: This typically corresponds to a list of friends or followers.

### function BlockedSubscriptions

```cpp
virtual const TSet< AccountId > & BlockedSubscriptions() const =0
```

The list of accounts blocked from seeing this account's online status.

### function AllowedSubscriptions

```cpp
virtual const TSet< AccountId > & AllowedSubscriptions() const =0
```

The list of accounts allowed to see this account's online status.

### function CrossMutedCommunications

```cpp
virtual const TSet< AccountId > & CrossMutedCommunications() const =0
```

The list of accounts which have bi-directionally muted communications with this login session.

### function State

```cpp
virtual LoginState State() const =0
```

The current state of this login session.

### function CurrentPresence

```cpp
virtual const Presence & CurrentPresence() =0
```

The online status that is sent to accounts that subscribe to the presence of this account.

### function SetCurrentPresence

```cpp
virtual VivoxCoreError SetCurrentPresence(
    const Presence & value
) =0
```

Set this player's online status.

### function LoginSessionId

```cpp
virtual const AccountId & LoginSessionId() const =0
```

The unique identifier for this login session.

### function BeginLogin

```cpp
virtual VivoxCoreError BeginLogin(
    const FString & server,
    const FString & accessToken,
    SubscriptionMode subscriptionMode,
    const TSet< AccountId > & presenceSubscriptions,
    const TSet< AccountId > & blockedPresenceSubscriptions,
    const TSet< AccountId > & allowedPresenceSubscriptions,
    FOnBeginLoginCompletedDelegate theDelegate =FOnBeginLoginCompletedDelegate()
) =0
```

Begin the sign in process for this session with presence.

**Parameters**:

* **server** The URI of the Vivox instance assigned to you.
* **accessToken** An access token provided by your game server that enables the sign in process.
* **subscriptionMode** Determine how to handle incoming subscriptions (friend/follower requests).
* **presenceSubscriptions** A list of accounts for which this user wants to monitor online status.
* **blockedPresenceSubscriptions** A list of accounts that are not allowed to see this user's online status.
* **allowedPresenceSubscriptions** A list of accounts that are allowed to see this user's online status.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

**Remark**: Developers of games that do not have secure communications requirements can use GetLoginToken to generate the required access token.

### function BeginLogin

```cpp
virtual VivoxCoreError BeginLogin(
    const FString & server,
    const FString & accessToken,
    FOnBeginLoginCompletedDelegate theDelegate =FOnBeginLoginCompletedDelegate()
) =0
```

Begin the sign in process for this session with no presence.

**Parameters**:

* **server** The URI of the Vivox instance assigned to you.
* **accessToken** An access token provided by your game server that enables the sign in process.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

**Remark**: Developers of games that do not have secure communications requirements can use GetLoginToken to generate the required access token.

### function GetChannelSession

```cpp
virtual IChannelSession & GetChannelSession(
    const ChannelId & channelId
) =0
```

Gets the channel session for this channelId. If necessary, this creates a channel session.

**Parameters**:

* **channelId** The channel ID.

**Return**: The channel session.

### function DeleteChannelSession

```cpp
virtual void DeleteChannelSession(
    const ChannelId & channelId
) =0
```

Delete the channel session for this channelId, and disconnect the session if necessary.

**Parameters**:

* **channelId** The channel ID.

**See**: [IChannelSession::Disconnect()](./class_i_channel_session.md#function-disconnect)

**Remark**: For timing restrictions related to the process of joining or rejoining channels during a disconnect, see [IChannelSession::Disconnect()](./class_i_channel_session.md#function-disconnect). Note that there are no timing restrictions when using this method to remove a session which already has a ChannelState() of Disconnected.

### function BeginSetCrossMutedCommunications

```cpp
virtual VivoxCoreError BeginSetCrossMutedCommunications(
    const AccountId & accountId,
    const bool & muted,
    FOnBeginSetCrossMutedCommunicationsCompletedDelegate theDelegate
) =0
```

Crossmute an [AccountId](./class_account_id.md), which bi-directionally mutes audio and text between that account and this login session.

**Parameters**:

* **accountId** The [AccountId](./class_account_id.md) to bi-directionally mute or unmute.
* **muted** The status to set: true to mute, false to unmute.

**Return**: 0 on success.

### function BeginSetCrossMutedCommunications

```cpp
virtual VivoxCoreError BeginSetCrossMutedCommunications(
    const TSet< AccountId > & accountIdSet,
    const bool & muted,
    FOnBeginSetCrossMutedCommunicationsCompletedDelegate theDelegate
) =0
```

Crossmute a set of AccountIds, which bi-directionally mutes audio and text between those accounts and this login session.

**Parameters**:

* **accountIdSet** The TSet of AccountIds to bi-directionally mute or unmute
* **muted** The status to set: true to mute, false to unmute.

**Return**: 0 on success.

### function BeginClearCrossMutedCommunications

```cpp
virtual VivoxCoreError BeginClearCrossMutedCommunications(
    FOnBeginClearCrossMutedCommunicationsCompletedDelegate theDelegate
) =0
```

Clear the bi-directionally muted communications list. This unmutes all AccountIds and allows audio and text through any means that are not otherwise prevented.

**Return**: 0 on success.

### function BeginAddBlockedSubscription

```cpp
virtual VivoxCoreError BeginAddBlockedSubscription(
    const AccountId & accountId,
    FOnBeginAddBlockedSubscriptionCompletedDelegate theDelegate =FOnBeginAddBlockedSubscriptionCompletedDelegate()
) =0
```

Block incoming subscription requests from the specified account.

**Parameters**:

* **accountId** The account ID to block.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

### function BeginRemoveBlockedSubscription

```cpp
virtual VivoxCoreError BeginRemoveBlockedSubscription(
    const AccountId & accountId,
    FOnBeginRemoveBlockedSubscriptionCompletedDelegate theDelegate =FOnBeginRemoveBlockedSubscriptionCompletedDelegate()
) =0
```

Unblock incoming subscription requests from the specified account. Subscription requests from the specified account cause an event to be raised to the application.

**Parameters**:

* **accountId** The account ID to unblock.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

### function BeginAddAllowedSubscription

```cpp
virtual VivoxCoreError BeginAddAllowedSubscription(
    const AccountId & accountId,
    FOnBeginAddAllowedSubscriptionCompletedDelegate theDelegate =FOnBeginAddAllowedSubscriptionCompletedDelegate()
) =0
```

Allow incoming subscription requests from the specified account.

**Parameters**:

* **accountId** The account ID to allow.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

### function BeginRemoveAllowedSubscription

```cpp
virtual VivoxCoreError BeginRemoveAllowedSubscription(
    const AccountId & accountId,
    FOnBeginRemoveAllowedSubscriptionCompletedDelegate theDelegate =FOnBeginRemoveAllowedSubscriptionCompletedDelegate()
) =0
```

Disallow automatic acceptance of incoming subscription requests from the specified account. Subscription requests from the specified account cause an event to be raised to the application.

**Parameters**:

* **accountId** The account ID to disallow.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

### function BeginAddPresenceSubscription

```cpp
virtual VivoxCoreError BeginAddPresenceSubscription(
    const AccountId & accountId,
    FOnBeginAddPresenceSubscriptionCompletedDelegate theDelegate =FOnBeginAddPresenceSubscriptionCompletedDelegate()
) =0
```

Subscribe to the specified account.

**Parameters**:

* **accountId** The account ID to subscribe to.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

**Remark**: This method automatically allows accountId to see the subscriber's online status.

### function BeginRemovePresenceSubscription

```cpp
virtual VivoxCoreError BeginRemovePresenceSubscription(
    const AccountId & accountId,
    FOnBeginRemovePresenceSubscriptionCompletedDelegate theDelegate =FOnBeginRemovePresenceSubscriptionCompletedDelegate()
) =0
```

Unsubscribe from the specified account.

**Parameters**:

* **accountId** The account ID to subscribe to.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

### function BeginSendSubscriptionReply

```cpp
virtual VivoxCoreError BeginSendSubscriptionReply(
    const AccountId & accountId,
    const SubscriptionReply & replyType,
    FOnBeginSendSubscriptionReplyCompletedDelegate theDelgate =FOnBeginSendSubscriptionReplyCompletedDelegate()
) =0
```

Reply to a subscription request received from EventSubscriptionRequestReceived.

**Parameters**:

* **accountId** The accountId to reply to.
* **replyType** The SubscriptionReply type to use: Allow or Block.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success.

### function BeginSendDirectedMessage

```cpp
virtual VivoxCoreError BeginSendDirectedMessage(
    const AccountId & accountId,
    const FString & language,
    const FString & message,
    const FString & applicationStanzaNamespace,
    const FString & applicationStanzaBody,
    FOnBeginSendDirectedMessageCompletedDelegate theDelegate =FOnBeginSendDirectedMessageCompletedDelegate()
) =0
```

Send a message to a specific account.

**Parameters**:

* **accountId** The intended recipient of the message.
* **language** The language of the message, for example: "en". To use the default language ("en" for most systems), set this to null. This must conform to BCP 47 ([https://tools.ietf.org/html/bcp47](https://tools.ietf.org/html/bcp47)).
* **message** The body of the message.
* **applicationStanzaNamespace** An optional namespace element for additional application data.
* **applicationStanzaBody** The additional application data body.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success, or VxErrorInvalidOperation if BeginLogin was called with no presence enabled (short form).

### function BeginSendDirectedMessage

```cpp
virtual VivoxCoreError BeginSendDirectedMessage(
    const AccountId & accountId,
    const FString & message,
    FOnBeginSendDirectedMessageCompletedDelegate theDelegate =FOnBeginSendDirectedMessageCompletedDelegate()
) =0
```

Send a message to a specific account.

**Parameters**:

* **accountId** The intended recipient of the message.
* **message** The body of the message.
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success, or VxErrorInvalidOperation if BeginLogin was called with no presence enabled (short form).

### function BeginStartAudioInjection

```cpp
virtual VivoxCoreError BeginStartAudioInjection(
    const FString & filePath,
    FOnBeginStartAudioInjectionCompletedDelegate theDelegate =FOnBeginStartAudioInjectionCompletedDelegate()
) =0
```

Start broadcasting audio from a file to all connected ChannelSessions.

**Parameters**:

* **filePath** The full pathname for the .wav file to play (this must be single channel, 16-bit PCM).
* **theDelegate** A delegate to call when this operation completes.

**Return**: 0 on success, or VxErrorInvalidState if not in an audio-connected ChannelSession.

**Remark**: Injected audio is treated like a second microphone that you are speaking into. Muting or disconnecting your input device does not stop others from hearing the file audio. Muting yourself in a channel, stopping transmission to a channel, or disconnecting the channel AudioState does stop others from hearing the file audio.

### function StopAudioInjection

```cpp
virtual VivoxCoreError StopAudioInjection() =0
```

Stop broadcasting audio from a file.

### function IsAudioInjecting

```cpp
virtual bool IsAudioInjecting() =0
```

True if currently broadcasting audio from a file.

### function BeginSetSafeVoiceConsentStatus

```cpp
virtual VivoxCoreError BeginSetSafeVoiceConsentStatus(
    const bool & consentToSet,
    const FString & environmentId,
    const FString & projectId,
    const FString & UASToken,
    FOnBeginSetSafeVoiceConsentCompletedDelegate theDelegate =FOnBeginSetSafeVoiceConsentCompletedDelegate()
) =0
```

Sets the SafeVoice consent for the LoginSession.

**Parameters**:

* **consentToSet** The SafeVoice consent status to update to
* **environmentId** The Unity Dashboard Environment Id
* **projectId** The Unity Dashboard Project Id
* **UASToken** The Authentication Token provided by the Unity Authentication Service. The Unity Authentication Service is most readily available through the Unity Gaming Services Unreal Plugin
* **theDelegate** The Delegate to handle once the SetSafeVoiceConsentStatus request is completed , which will contain the updated SafeVoice consent status

**Remark**: The Account Name for the LoginSession should be the PlayerId returned from signing into the Authentication Service to receive the UASToken

### function BeginGetSafeVoiceConsentStatus

```cpp
virtual VivoxCoreError BeginGetSafeVoiceConsentStatus(
    const FString & environmentId,
    const FString & projectId,
    const FString & UASToken,
    FOnBeginGetSafeVoiceConsentCompletedDelegate theDelegate =FOnBeginGetSafeVoiceConsentCompletedDelegate()
) =0
```

Gets the SafeVoice consent for the LoginSession.

**Parameters**:

* **environmentId** The Unity Dashboard Environment Id
* **projectId** The Unity Dashboard Project Id
* **UASToken** The Authentication Token provided by the Unity Authentication Service. The Unity Authentication Service is most readily available through the Unity Gaming Services Unreal Plugin
* **theDelegate** The Delegate to handle once the SetSafeVoiceConsentStatus request is completed , which will contain the updated SafeVoice consent status

**Remark**: The Account Name for the LoginSession should be the PlayerId returned from signing into the Authentication Service to receive the UASToken

### function SetTransmissionMode

```cpp
virtual VivoxCoreError SetTransmissionMode(
    TransmissionMode mode,
    ChannelId singleChannel =ChannelId()
) =0
```

Set whether microphone audio and injected audio should be transmitted to no channels, all channels, or a specific single channel.

**Parameters**:

* **mode** An enum that specifies a transmission policy.
* **singleChannel** The specific channel to transmit to when TransmissionMode::Single is set (this is otherwise ignored).

**Return**: VxErrorInvalidArgument if the mode is TransmissionMode::Single and the default or no [ChannelId](./class_channel_id.md) argument is provided.

**Remark**: Audio transmission changes take effect immediately in all channels this user is already connected to. The changes also affect future channels that are joined:

* None: Audio does not automatically transmit to new channels or to text-only channels when audio is added.
* All: Audio automatically transmits to new channels and to text-only channels when audio is added.
* Single: Audio only transmits into the specified channel, and does not automatically switch to new channels even if this channel is disconnected.

Important: You can override and change this setting by passing "true" for the switchTransmission argument in [IChannelSession::BeginConnect()](./class_i_channel_session.md#function-beginconnect) and [IChannelSession::BeginSetAudioConnected()](./class_i_channel_session.md#function-beginsetaudioconnected).

### function GetTransmissionMode

```cpp
virtual TransmissionMode GetTransmissionMode() const =0
```

Get the transmission policy that is set for the player.

**See**: [SetTransmissionMode()](#function-settransmissionmode)

**Return**: The active TransmissionMode.

### function GetTransmittingChannels

```cpp
virtual TArray< ChannelId > GetTransmittingChannels() const =0
```

Get the [ChannelId](./class_channel_id.md) of each channel that will broadcast non-muted microphone input and injected audio.

**See**: [SetTransmissionMode()](#function-settransmissionmode)

**Return**: An array of transmitting ChannelIds.

### function SetParticipantSpeakingUpdateRate

```cpp
virtual VivoxCoreError SetParticipantSpeakingUpdateRate(
    ParticipantSpeakingUpdateRate rate
) =0
```

Set how often the SDK raises [IChannelSession::EventAfterParticipantUpdated](./class_i_channel_session.md#variable-eventafterparticipantupdated) events that relate to speaking activity.

**Parameters**:

* **rate** An enum that specifies the frequency of participant events due to changes in speech detection or audio energy.

**Return**: 0 on success

**Remark**: By default, the Vivox SDK supports a simple speaking/not-speaking indicator for channel participants; for this use case, keeping the default value of ParticipantSpeakingUpdateRate::StateChange is sufficient. If you want to create a dynamic voice activity indicator or other real-time visual representation of audio energy levels, supply this function with a ParticipantSpeakingUpdateRate value of Update1Hz, Update5Hz, or Update10Hz for updates of up to 1, 5, or 10 times per second as audio energy and other participant properties change. For more information, see the Vivox Unreal Developer Documentation.

### function GetParticipantSpeakingUpdateRate

```cpp
virtual ParticipantSpeakingUpdateRate GetParticipantSpeakingUpdateRate() const =0
```

Get the frequency set for speech-related participant events for all participants in all connected channels.

**See**: [SetParticipantSpeakingUpdateRate()](#function-setparticipantspeakingupdaterate)

**Return**: The current ParticipantSpeakingUpdateRate.

### function TTS

```cpp
virtual ITextToSpeech & TTS() =0
```

The text-to-speech (TTS) subsystem instance associated with this login session.

### function Logout

```cpp
virtual void Logout() =0
```

Sign the account out of the Vivox system. Unlike in the case of an unexpected sign out due to loss of network connectivity, calling this method raises the EventStateChanged event with a value of LoginState::LoggingOut first, before raising a second event for LoginState::LoggedOut.

### function GetLoginToken

```cpp
virtual FString GetLoginToken(
    const FString & tokenSigningKey,
    FTimespan tokenExpirationDuration
) const =0
```

Get a login token for this account.

**Parameters**:

* **tokenSigningKey** The key that corresponds to the issuer for this account that is used to sign the token.
* **tokenExpirationDuration** The length of time the token is valid for.

**Return**: An access token that can be used to sign in this account.

**Remark**: To be used only by applications without secure communications requirements.

## Public Attributes Documentation

### variable EventSubscriptionRequestReceived

```cpp
SubscriptionRequestReceived EventSubscriptionRequestReceived;
```

An event that indicates a new subscription request has been received.

**Remark**: An example of this is when another player would like to be your buddy.

### variable EventDirectedTextMessageReceived

```cpp
DirectedTextMessageReceived EventDirectedTextMessageReceived;
```

An event that indicates another player has sent you a text message.

### variable EventStateChanged

```cpp
StateChanged EventStateChanged;
```

The event that raises when `State()` changes.

**Remark**: Loss of network connectivity raises this event with a value of LoginState::LoggedOut, without first transitioning through LoginState::LoggingOut.

### variable EventChannelJoined

```cpp
ChannelJoined EventChannelJoined;
```

The event that fires when a new ChannelSession is joined.

### variable EventChannelLeft

```cpp
ChannelLeft EventChannelLeft;
```

The event that fires when a ChannelSession is le.

### variable EventSendDirectedTextMessageFailed

```cpp
SendDirectedTextMessageFailed EventSendDirectedTextMessageFailed;
```

An event that indicates a directed message delivery failed.

**Remark**: The VivoxCoreError parameter specifies the reason for failure, and the FString parameter is a request ID that matches the ID returned in FOnBeginSendDirectedMessageCompletedDelegate when the message was sent. You can compare this request ID with the ID returned in the delegate to determine which directed message failed to be delivered.

### variable EventAudioInjectionCompleted

```cpp
AudioInjectionCompleted EventAudioInjectionCompleted;
```

An event that indicates you are no longer injecting audio.

**Remark**: This event is raised if injection is stopped early with [StopAudioInjection()](#function-stopaudioinjection) or if the file that you are injecting audio from has reached its natural end.
