Receiving a Signal
Signals are received on the session. When a Signal is received, in addition to the data that was sent, it will contain a from property which will have information about who sent the Signal. This can be used to differentiate between Signals the current user and sent and ones they receive.
- Copy the following code and paste it at the bottom of the
Dependency 'androidx.activity:activity:1.10.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs.class:
This code sets up listeners for both the session and for Signals. This is how we will get updates from the SDK, for example if the session connects/disconnects and if there is an incoming Signal. The onSignalReceived listener is called when a Signal is received in the session, we will want to check that the Signal type is as expected and the Signal is not from the current user. Now that the MainActivity class is complete, make sure to import any classes needed.
Basic text chat
Follow this tutorial to build basic text chat from scratch using the Vonage Video API. It is the quickest way to build a proof of concept for this functionality on the video platform.