TalkSession
This is the entry point to the TalkJS Kotlin Data API.
| onError | Attaches a handler that will be called when the session encounters an error Returns a callback which detaches your handler |
| user | Get a reference to a user |
| conversation | Get a reference to a conversation |
| subscribeConversations | Subscribes to the most recently active conversations for the current user |
| _isConnected | |
| uploadFile | Upload a generic file without any additional metadata. |
| uploadImage | Upload an image with image-specific metadata. |
| uploadVideo | Upload a video with video-specific metadata. |
| uploadAudio | Upload an audio file with audio-specific metadata. |
| uploadVoice | Upload a voice recording with voice-specific metadata. |
| constructor |
talkSession.conversation(id): ConversationRef
Get a reference to a conversation
Parameters
The ID of the conversation that you want to reference
Returns
talkSession.subscribeConversations(onSnapshot): ConversationListSubscription
Subscribes to the most recently active conversations for the current user
Parameters
Returns
talkSession._isConnected(): Boolean
Returns
talkSession.uploadFile(data, metadata): String
Upload a generic file without any additional metadata.
This function does not send any message, it only uploads the file and returns a file token. To send the file in a message, pass the file token in a {@linkcode SendFileBlock} when calling {@linkcode ConversationRef.send}.
{@link https://talkjs.com/docs/Reference/Concepts/Message_Content/#sending-message-content | See the documentation} for more information about sending files in messages.
If the file is a video, image, audio file, or voice recording, use one of the other functions like {@linkcode uploadImage} instead.
Parameters
The binary file data. Usually a {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/File | File}.
Information about the file
Returns
talkSession.uploadImage(data, metadata): String
Upload an image with image-specific metadata.
This is a variant of {@linkcode TalkSession.uploadFile} used for images.
Parameters
The binary image data. Usually a {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/File | File}.
Information about the image.
Returns
talkSession.uploadVideo(data, metadata): String
Upload a video with video-specific metadata.
This is a variant of {@linkcode TalkSession.uploadFile} used for videos.
Parameters
The binary video data. Usually a {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/File | File}.
Information about the video.
Returns
talkSession.uploadAudio(data, metadata): String
Upload an audio file with audio-specific metadata.
This is a variant of {@linkcode TalkSession.uploadFile} used for audio files.
Parameters
The binary audio data. Usually a {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/File | File}.
Information about the audio file.
Returns
talkSession.uploadVoice(data, metadata): String
Upload a voice recording with voice-specific metadata.
This is a variant of {@linkcode TalkSession.uploadFile} used for voice recordings.
Parameters
The binary audio data. Usually a {@linkcode https://developer.mozilla.org/en-US/docs/Web/API/File | File}.
Information about the voice recording.