Class ChatClient

  • All Implemented Interfaces:

    
    public final class ChatClient
    
                        

    The ChatClient is the main entry point for all low-level operations on chat

    • Constructor Detail

    • Method Detail

      • inheritScope

         final CoroutineScope inheritScope(Function1<Job, CoroutineContext> block)

        Inherits the UserScope and provides its Job as an anchor for children.

      • resolveDependency

         final <P extends Plugin, T extends Any> T resolveDependency()

        Resolves dependency T within the provided plugin P. This method can't be called before user is connected because plugins are added only after user connection is completed.

      • appSettings

        @CheckResult() final Call<AppSettings> appSettings()

        Get the current settings of the app. Check AppSettings.

      • connectUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> connectUser(User user, TokenProvider tokenProvider, Long timeoutMilliseconds)

        Initializes ChatClient for a specific user. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method performs required operations before connecting with the Stream API. Moreover, it warms up the connection, sets up notifications, and connects to the socket.

        Check out docs for more info about tokens. Also visit this site to find more about Json Web Token standard. You can generate the JWT token on using one of the available libraries or use our manual tool for token generation.

        Parameters:
        user - The user to set.
        tokenProvider - A TokenProvider implementation.
        timeoutMilliseconds - The timeout in milliseconds to be waiting until the connection is established.
      • connectUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> connectUser(User user, TokenProvider tokenProvider)

        Initializes ChatClient for a specific user. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method performs required operations before connecting with the Stream API. Moreover, it warms up the connection, sets up notifications, and connects to the socket.

        Check out docs for more info about tokens. Also visit this site to find more about Json Web Token standard. You can generate the JWT token on using one of the available libraries or use our manual tool for token generation.

        Parameters:
        user - The user to set.
        tokenProvider - A TokenProvider implementation.
      • switchUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> switchUser(User user, TokenProvider tokenProvider, Long timeoutMilliseconds, Function0<Unit> onDisconnectionComplete)

        Changes the user. Disconnects the current user and connects to a new one. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method disconnects from the SDK and right after connects to it with the new User.

        Parameters:
        user - The user to set.
        tokenProvider - A TokenProvider implementation.
        timeoutMilliseconds - The timeout in milliseconds to be waiting until the connection is established.
      • switchUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> switchUser(User user, TokenProvider tokenProvider, Long timeoutMilliseconds)

        Changes the user. Disconnects the current user and connects to a new one. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method disconnects from the SDK and right after connects to it with the new User.

        Parameters:
        user - The user to set.
        tokenProvider - A TokenProvider implementation.
        timeoutMilliseconds - The timeout in milliseconds to be waiting until the connection is established.
      • switchUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> switchUser(User user, TokenProvider tokenProvider)

        Changes the user. Disconnects the current user and connects to a new one. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method disconnects from the SDK and right after connects to it with the new User.

        Parameters:
        user - The user to set.
        tokenProvider - A TokenProvider implementation.
      • switchUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> switchUser(User user, String token, Long timeoutMilliseconds, Function0<Unit> onDisconnectionComplete)

        Changes the user. Disconnects the current user and connects to a new one. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method disconnects from the SDK and right after connects to it with the new User.

        Parameters:
        user - The user to set.
        token - Instance of JWT token.
        timeoutMilliseconds - The timeout in milliseconds to be waiting until the connection is established.
      • switchUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> switchUser(User user, String token, Long timeoutMilliseconds)

        Changes the user. Disconnects the current user and connects to a new one. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method disconnects from the SDK and right after connects to it with the new User.

        Parameters:
        user - The user to set.
        token - Instance of JWT token.
        timeoutMilliseconds - The timeout in milliseconds to be waiting until the connection is established.
      • switchUser

        @CheckResult()@JvmOverloads() final Call<ConnectionData> switchUser(User user, String token)

        Changes the user. Disconnects the current user and connects to a new one. The tokenProvider implementation is used for the initial token, and it's also invoked whenever the user's token has expired, to fetch a new token.

        This method disconnects from the SDK and right after connects to it with the new User.

        Parameters:
        user - The user to set.
        token - Instance of JWT token.
      • queryMembers

        @CheckResult() final Call<List<Member>> queryMembers(String channelType, String channelId, Integer offset, Integer limit, FilterObject filter, QuerySorter<Member> sort, List<Member> members)

        Query members and apply side effects if there are any.

        Parameters:
        channelType - The type of channel.
        channelId - The id of the channel.
        offset - Offset limit.
        limit - Number of members to fetch.
        filter - FilterObject to filter members of certain type.
        sort - Sort the list of members.
        members - List of members to search in distinct channels.
      • sendFile

        @CheckResult()@JvmOverloads() final Call<UploadedFile> sendFile(String channelType, String channelId, File file, ProgressCallback callback)

        Uploads a file for the given channel. Progress can be accessed via callback.

        The Stream CDN imposes the following restrictions on file uploads:

        • The maximum file size is 100 MB

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        file - The file that needs to be uploaded.
        callback - The callback to track progress.
      • sendFile

        @CheckResult()@JvmOverloads() final Call<UploadedFile> sendFile(String channelType, String channelId, File file)

        Uploads a file for the given channel. Progress can be accessed via callback.

        The Stream CDN imposes the following restrictions on file uploads:

        • The maximum file size is 100 MB

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        file - The file that needs to be uploaded.
      • sendImage

        @CheckResult()@JvmOverloads() final Call<UploadedImage> sendImage(String channelType, String channelId, File file, ProgressCallback callback)

        Uploads an image for the given channel. Progress can be accessed via callback.

        The Stream CDN imposes the following restrictions on image uploads:

        • The maximum image size is 100 MB

        • Supported MIME types are listed in StreamCdnImageMimeTypes.SUPPORTED_IMAGE_MIME_TYPES

        Parameters:
        channelType - The channel type.
        channelId - Еhe channel id.
        file - The image file that needs to be uploaded.
        callback - The callback to track progress.
      • sendImage

        @CheckResult()@JvmOverloads() final Call<UploadedImage> sendImage(String channelType, String channelId, File file)

        Uploads an image for the given channel. Progress can be accessed via callback.

        The Stream CDN imposes the following restrictions on image uploads:

        • The maximum image size is 100 MB

        • Supported MIME types are listed in StreamCdnImageMimeTypes.SUPPORTED_IMAGE_MIME_TYPES

        Parameters:
        channelType - The channel type.
        channelId - Еhe channel id.
        file - The image file that needs to be uploaded.
      • deleteFile

        @CheckResult() final Call<Unit> deleteFile(String channelType, String channelId, String url)

        Deletes the file represented by url from the given channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        url - The URL of the file to be deleted.
      • deleteImage

        @CheckResult() final Call<Unit> deleteImage(String channelType, String channelId, String url)

        Deletes the image represented by url from the given channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        url - The URL of the image to be deleted.
      • deleteReaction

        @CheckResult() final Call<Message> deleteReaction(String messageId, String reactionType, String cid)

        Deletes the reaction associated with the message with the given message id. cid parameter is being used in side effect functions executed by plugins. You can skip it if plugins are not being used.

        The call will be retried accordingly to retryPolicy.

        Parameters:
        messageId - The id of the message to which reaction belongs.
        reactionType - The type of reaction.
        cid - The full channel id, i.e.
      • sendReaction

        @CheckResult()@JvmOverloads() final Call<Reaction> sendReaction(Reaction reaction, Boolean enforceUnique, String cid)

        Sends the reaction. Use enforceUnique parameter to specify whether the reaction should replace other reactions added by the current user. cid parameter is being used in side effect functions executed by plugins. You can skip it if plugins are not being used.

        The call will be retried accordingly to retryPolicy.

        Parameters:
        reaction - The Reaction to send.
        enforceUnique - Flag to determine whether the reaction should replace other ones added by the current user.
        cid - The full channel id, i.e.
      • sendReaction

        @CheckResult()@JvmOverloads() final Call<Reaction> sendReaction(Reaction reaction, Boolean enforceUnique)

        Sends the reaction. Use enforceUnique parameter to specify whether the reaction should replace other reactions added by the current user. cid parameter is being used in side effect functions executed by plugins. You can skip it if plugins are not being used.

        The call will be retried accordingly to retryPolicy.

        Parameters:
        reaction - The Reaction to send.
        enforceUnique - Flag to determine whether the reaction should replace other ones added by the current user.
      • fetchCurrentUser

         final Call<User> fetchCurrentUser()

        Fetches the current user. Works only if the user was previously set and the WS connections is closed.

      • reconnectSocket

        @CheckResult() final Call<Unit> reconnectSocket()

        Reconnects the socket. Works only if the user was previously set and the WS connections is closed.

      • clearPersistence

        @CheckResult() final Call<Unit> clearPersistence()

        Clear local data stored on the device from the current user.

        This method can be called even if the user is not connected, on that case the stored credentials will be used.

        If there is already a connection alive for the current user, it will be disconnected.

      • disconnect

        @CheckResult() final Call<Unit> disconnect(Boolean flushPersistence)

        Disconnect the current user, stop all observers and clear user data. This method should only be used whenever the user logouts from the main app. You shouldn't call this method, if the user will continue using the Chat in the future.

        Parameters:
        flushPersistence - if true will clear user data.
      • dismissChannelNotifications

         final Unit dismissChannelNotifications(String channelType, String channelId)

        Dismiss notifications from a given channelType and channelId. Be sure to initialize ChatClient before calling this method!

        Parameters:
        channelType - String that represent the channel type of the channel you want to dismiss notifications.
        channelId - String that represent the channel id of the channel you want to dismiss notifications.
      • searchMessages

        @CheckResult() final Call<SearchMessagesResult> searchMessages(FilterObject channelFilter, FilterObject messageFilter, Integer offset, Integer limit, String next, QuerySorter<Message> sort)

        Search messages across channels. There are two ways to paginate through search results:

        Limit and offset will allow you to access up to 1000 results matching your query. You will not be able to sort using limit and offset. The results will instead be sorted by relevance and message ID.

        Next pagination will allow you to access all search results that match your query, and you will be able to sort using any filter-able fields and custom fields. Pages of sort results will be returned with next and previous strings which can be supplied as a next parameter when making a query to get a new page of results.

        Parameters:
        channelFilter - Channel filter conditions.
        messageFilter - Message filter conditions.
        offset - Pagination offset, cannot be used with sort or next.
        limit - The number of messages to return.
        next - Pagination parameter, cannot be used with non-zero offset.
        sort - The sort criteria applied to the result, cannot be used with non-zero offset.
      • getPinnedMessages

        @CheckResult() final Call<List<Message>> getPinnedMessages(String channelType, String channelId, Integer limit, QuerySorter<Message> sort, PinnedMessagesPagination pagination)

        Returns a list of messages pinned in the channel. You can sort the list by specifying sort parameter. Keep in mind that for now we only support sorting by Message.pinnedAt. The list can be paginated in a few different ways using limit and pagination.

        Parameters:
        channelType - The channel type.
        channelId - The id of the channel we're querying.
        limit - Max limit of messages to be fetched.
        sort - Parameter by which we sort the messages.
        pagination - Provides different options for pagination.
      • getMessagesWithAttachments

        @CheckResult() final Call<List<Message>> getMessagesWithAttachments(String channelType, String channelId, Integer offset, Integer limit, List<String> types)

        Returns a Call with messages that contain at least one desired type attachment but not necessarily all of them will have a specified type.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        offset - The messages offset.
        limit - Max limit messages to be fetched.
        types - Desired attachment's types list.
      • sendGiphy

        @CheckResult() final Call<Message> sendGiphy(Message message)

        Sends selected giphy message to the channel specified by Message.cid. The call will be retried accordingly to retryPolicy.

        Parameters:
        message - The message to send.
      • shuffleGiphy

        @CheckResult() final Call<Message> shuffleGiphy(Message message)

        Performs Giphy shuffle operation in the channel specified by Message.cid. Returns new "ephemeral" message with new giphy url. The call will be retried accordingly to retryPolicy.

        Parameters:
        message - The message to send.
      • getMessage

        @CheckResult() final Call<Message> getMessage(String messageId)

        Fetches a single message from the backend.

        Parameters:
        messageId - The ID of the message we are fetching from the backend.
      • sendMessage

        @CheckResult() final Call<Message> sendMessage(String channelType, String channelId, Message message, Boolean isRetrying)

        Sends the message to the given channel. If isRetrying is set to true, the message may not be prepared again.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        message - Message object
        isRetrying - True if this message is being retried.
      • updateMessage

        @CheckResult() final Call<Message> updateMessage(Message message)

        Updates the message in the API and calls the plugins that handle this request. OfflinePlugin can be used here to store the updated message locally.

        Parameters:
        message - Message The message to be updated.
      • partialUpdateMessage

        @CheckResult() final Call<Message> partialUpdateMessage(String messageId, Map<String, Object> set, List<String> unset)

        Partially updates specific Message fields retaining the fields which were set previously.

        Parameters:
        messageId - The message ID.
        set - The key-value data which will be added to the existing message object.
        unset - The list of fields which will be removed from the existing message object.
      • pinMessage

        @CheckResult() final Call<Message> pinMessage(Message message, Date expirationDate)

        Pins the message.

        Parameters:
        message - The message object containing the ID of the message to be pinned.
        expirationDate - The exact expiration date.
      • pinMessage

        @CheckResult() final Call<Message> pinMessage(Message message, Integer timeout)

        Pins the message.

        Parameters:
        message - The message object containing the ID of the message to be pinned.
        timeout - The expiration timeout in seconds.
      • unpinMessage

        @CheckResult() final Call<Message> unpinMessage(Message message)

        Unpins the message that was previously pinned

        Parameters:
        message - The message object containing the ID of the message to be unpinned.
      • hideChannel

        @CheckResult() final Call<Unit> hideChannel(String channelType, String channelId, Boolean clearHistory)

        Hides the specified channel with side effects.

        Parameters:
        channelType - The type of the channel.
        channelId - Id of the channel.
        clearHistory - Boolean, if you want to clear the history of this channel or not.
      • truncateChannel

        @CheckResult() final Call<Channel> truncateChannel(String channelType, String channelId, Message systemMessage)

        Removes all of the messages of the channel but doesn't affect the channel data or members.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        systemMessage - The system message that will be shown in the channel.
      • stopWatching

        @CheckResult() final Call<Unit> stopWatching(String channelType, String channelId)

        Stops watching the channel which means you won't receive more events for the channel. The call requires active socket connection and will be automatically postponed and retried until the connection is established.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
      • updateChannel

        @CheckResult() final Call<Channel> updateChannel(String channelType, String channelId, Message updateMessage, Map<String, Object> channelExtraData)

        Updates all of the channel data. Any data that is present on the channel and not included in a full update will be deleted.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        updateMessage - The message object allowing you to show a system message in the channel.
        channelExtraData - The updated channel extra data.
      • updateChannelPartial

        @CheckResult() final Call<Channel> updateChannelPartial(String channelType, String channelId, Map<String, Object> set, List<String> unset)

        Updates specific fields of channel data retaining the custom data fields which were set previously.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        set - The key-value data which will be added to the existing channel data object.
        unset - The list of fields which will be removed from the existing channel data object.
      • enableSlowMode

        @CheckResult() final Call<Channel> enableSlowMode(String channelType, String channelId, Integer cooldownTimeInSeconds)

        Enables slow mode for the channel. When slow mode is enabled, users can only send a message every cooldownTimeInSeconds time interval. The cooldownTimeInSeconds is specified in seconds, and should be between 1-MAX_COOLDOWN_TIME_SECONDS.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        cooldownTimeInSeconds - The duration of the time interval users have to wait between messages.
      • disableSlowMode

        @CheckResult() final Call<Channel> disableSlowMode(String channelType, String channelId)

        Disables slow mode for the channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
      • sendEvent

        @CheckResult() final Call<ChatEvent> sendEvent(String eventType, String channelType, String channelId, Map<Object, Object> extraData)

        Sends an event to all users watching the channel.

        Parameters:
        eventType - The event name.
        channelType - The channel type.
        channelId - The channel id.
        extraData - The event payload.
      • markRead

        @CheckResult() final Call<Unit> markRead(String channelType, String channelId)

        Marks the specified channel as read.

        Parameters:
        channelType - Type of the channel.
        channelId - Id of the channel.
      • partialUpdateUser

        @CheckResult() final Call<User> partialUpdateUser(String id, Map<String, Object> set, List<String> unset)

        Updates specific user fields retaining the custom data fields which were set previously.

        Parameters:
        id - User ids.
        set - The key-value data which will be added to the existing user object.
        unset - The list of fields which will be removed from the existing user object.
      • addMembers

        @CheckResult() final Call<Channel> addMembers(String channelType, String channelId, List<String> memberIds, Message systemMessage, Boolean hideHistory)

        Adds members to a given channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        memberIds - The list of the member ids to be added.
        systemMessage - The system message that will be shown in the channel.
        hideHistory - Hides the history of the channel to the added member.
      • removeMembers

        @CheckResult() final Call<Channel> removeMembers(String channelType, String channelId, List<String> memberIds, Message systemMessage)

        Removes members from a given channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        memberIds - The list of the member ids to be removed.
        systemMessage - The system message that will be shown in the channel.
      • inviteMembers

        @CheckResult() final Call<Channel> inviteMembers(String channelType, String channelId, List<String> memberIds, Message systemMessage)

        Invites members to a given channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        memberIds - The list of the member ids to be invited.
        systemMessage - The system message that will be shown in the channel.
      • muteChannel

        @JvmOverloads()@CheckResult() final Call<Unit> muteChannel(String channelType, String channelId, Integer expiration)

        Mutes a channel for the current user. Messages added to the channel will not trigger push notifications, and will not change the unread count for the users that muted it. By default, mutes stay in place indefinitely until the user removes it. However, you can optionally set an expiration time. Triggers notification.channel_mutes_updated event.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        expiration - The duration of mute in millis.
      • muteChannel

        @JvmOverloads()@CheckResult() final Call<Unit> muteChannel(String channelType, String channelId)

        Mutes a channel for the current user. Messages added to the channel will not trigger push notifications, and will not change the unread count for the users that muted it. By default, mutes stay in place indefinitely until the user removes it. However, you can optionally set an expiration time. Triggers notification.channel_mutes_updated event.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
      • unmuteChannel

        @CheckResult() final Call<Unit> unmuteChannel(String channelType, String channelId)

        Unmutes a channel for the current user. Triggers notification.channel_mutes_updated event.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
      • muteUser

        @JvmOverloads()@CheckResult() final Call<Mute> muteUser(String userId, Integer timeout)

        Mutes a user. Messages from muted users will not trigger push notifications. By default, mutes stay in place indefinitely until the user removes it. However, you can optionally set a mute timeout. Triggers notification.mutes_updated event.

        Parameters:
        userId - The user id to mute.
        timeout - The timeout in minutes until the mute is expired.
      • muteUser

        @JvmOverloads()@CheckResult() final Call<Mute> muteUser(String userId)

        Mutes a user. Messages from muted users will not trigger push notifications. By default, mutes stay in place indefinitely until the user removes it. However, you can optionally set a mute timeout. Triggers notification.mutes_updated event.

        Parameters:
        userId - The user id to mute.
      • unmuteUser

        @CheckResult() final Call<Unit> unmuteUser(String userId)

        Unmutes a previously muted user. Triggers notification.mutes_updated event.

        Parameters:
        userId - The user id to unmute.
      • getAppSettings

         final AppSettings getAppSettings()

        Returns application settings from the server or the default ones as a fallback.

      • createChannel

        @CheckResult() final Call<Channel> createChannel(String channelType, String channelId, List<String> memberIds, Map<String, Object> extraData)

        Creates the channel. You can either create an id-based channel by passing not blank channelId or member-based (distinct) channel by leaving channelId empty. Use memberIds list to create a channel together with members. Make sure the list is not empty in case of creating member-based channel! Extra channel's information, for example name, can be passed in the extraData map.

        The call will be retried accordingly to retryPolicy.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
        memberIds - The list of members' ids.
        extraData - Map of key-value pairs that let you store extra data.
      • getSyncHistory

        @CheckResult() final Call<List<ChatEvent>> getSyncHistory(List<String> channelsIds, Date lastSyncAt)

        Returns all events that happened for a list of channels since last sync (while the user was not connected to the web-socket).

        Parameters:
        channelsIds - The list of channel CIDs.
        lastSyncAt - The last time the user was online and in sync.
      • getSyncHistory

        @CheckResult() final Call<List<ChatEvent>> getSyncHistory(List<String> channelsIds, String lastSyncAt)

        Returns all events that happened for a list of channels since last sync (while the user was not connected to the web socket). lastSyncAt is in yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z' format. Use this version of getSyncHistory when high precision is necessary.

        Parameters:
        channelsIds - The list of channel CIDs.
        lastSyncAt - The last time the user was online and in sync.
      • keystroke

        @CheckResult() final Call<ChatEvent> keystroke(String channelType, String channelId, String parentId)

        Sends a EventType.TYPING_START event to the backend.

        Parameters:
        channelType - The type of this channel i.e.
        channelId - The id of this channel.
        parentId - Set this field to message.id to indicate that typing event is happening in a thread.
      • stopTyping

        @CheckResult() final Call<ChatEvent> stopTyping(String channelType, String channelId, String parentId)

        Sends a EventType.TYPING_STOP event to the backend.

        Parameters:
        channelType - The type of this channel i.e.
        channelId - The id of this channel.
        parentId - Set this field to message.id to indicate that typing event is happening in a thread.
      • createVideoCall

        @CheckResult() final Call<VideoCallInfo> createVideoCall(String channelType, String channelId, String callType, String callId)

        Creates a newly available video call, which belongs to a channel. The video call will be created based on the third-party video integration (Agora and 100ms) on your Stream Dashboard.

        You can set the call type by passing callType like video or audio.

        Parameters:
        channelType - The channel type.
        channelId - The id of the channel.
        callType - Represents call type such as video or audio.
        callId - A unique identifier to assign to the call.
      • getVideoCallToken

        @CheckResult() final Call<VideoCallToken> getVideoCallToken(String callId)

        Returns the currently available video call token.

        Parameters:
        callId - The call id, which indicates a dedicated video call id on the channel.
      • downloadFile

        @CheckResult() final Call<ResponseBody> downloadFile(String fileUrl)

        Downloads the given file which can be fetched through the response body.

        Parameters:
        fileUrl - The URL of the file that we are downloading.
      • devToken

         final String devToken(String userId)

        Generate a developer token that can be used to connect users while the app is using a development environment.

        Parameters:
        userId - the desired id of the user to be connected.
      • handlePushMessage

         final static Unit handlePushMessage(PushMessage pushMessage)

        Handles push message. If user is not connected - automatically restores last user credentials and sets user without connecting to the socket. Push message will be handled internally unless user overrides NotificationHandler.onPushMessage Be sure to initialize ChatClient before calling this method!