Events
Learn how to use Vivox event callbacks.
Read time 1 minuteLast updated 2 days ago
The Vivox Core Unreal 4 plug-in uses the native UE4 event mechanism for notifying the application about state changes, incoming text messages, incoming subscription requests, and audio device availability changes. To receive a notification, the application must bind to these events. The following code displays an example of this behavior:
In this example, UMyClass derives from UObject or another derived class of UObject. If this is not applicable for your game class, then refer to the Unreal Engine 4 online documentation for binding events and multi-cast delegates. There are also a variety of similar methods to use AddUObject with other types of function delegates.// Example method that binds or unbinds event handlers to an ILoginSessionvoid UMyClass::BindHandlers(bool DoBind, ILoginSession &LoginSession){ if (DoBind) { LoginSession.EventStateChanged.AddUObject(this, &UMyClass::OnLoginSessionStateChanged); } else { LoginSession.EventStateChanged.RemoveAll(this); }}void UMyClass::OnLoginSessionStateChanged(LoginState State) { . . . }