Client v5: BLE, BLE Hosting, HTTP, Jobs - Linux, MacOS, & Blazor Support! Full AOT, RX on BLE only & MANY other features! Power up!
ChatView | API Reference
Namespaces are mirrored: Shiny.Maui.Controls.Chat and Shiny.Blazor.Controls.Chat. Models are identical across platforms except ChatSessionUserInfo (MAUI uses ImageSource/Color; Blazor uses string URL / CSS color).
IChatSessionProvider
Section titled “IChatSessionProvider”| Member | Returns | Description |
|---|---|---|
CreateSessionAsync(string[] userIds, CancellationToken) | Task<IChatSession> | Create a new session for the given users |
GetSessionAsync(string sessionId, CancellationToken) | Task<IChatSession> | Resolve an existing session; throws ChatSessionException if missing/forbidden |
IChatSession : IAsyncDisposable
Section titled “IChatSession : IAsyncDisposable”Properties
Section titled “Properties”| Member | Type | Description |
|---|---|---|
Info | ChatSessionInfo | Always current; refreshed before SessionUpdated fires |
CurrentUserId | string | Who “me” is — drives bubble alignment + ownership |
Methods
Section titled “Methods”| Member | Returns | Description |
|---|---|---|
GetMessagesAsync(string? cursorMessageId, MessagePageDirection direction, int count, CancellationToken) | Task<MessagePage> | Cursor paging; null + Older = newest page |
SendMessageAsync(OutgoingMessage, CancellationToken) | Task<ChatMessage> | Send; echo carries the same ClientMessageId |
ResendMessageAsync(string clientMessageId, CancellationToken) | Task<ChatMessage> | Retry a Failed message |
EditMessageAsync(string messageId, string body, CancellationToken) | Task | Edit own message |
DeleteMessageAsync(string messageId, CancellationToken) | Task | Delete own message |
ReactToMessageAsync(string messageId, string emoji, bool add, CancellationToken) | Task | Toggle a reaction on/off |
MarkReadAsync(string[] messageIds, CancellationToken) | Task | Mark messages read (control passes only visible, not-mine, unread ids) |
ToggleTypingAsync(bool isTyping, CancellationToken) | Task | Report the current user’s typing state |
InviteUserAsync(string userId, CancellationToken) | Task | Invite a user |
LeaveAsync(CancellationToken) | Task | Leave the session |
RenameAsync(string sessionName, CancellationToken) | Task | Rename the session |
Events
Section titled “Events”| Event | Args | Description |
|---|---|---|
MessageReceived | ChatMessage | New inbound message or own-send echo (multi-device) |
MessageUpdated | MessageChanged | Edit / reaction / receipt / status change |
MessageDeleted | string | Deleted message id |
UserTyping | UserTypingEvent | Remote user typing state |
UserJoined | ChatSessionUserInfo | A user joined |
UserLeft | ChatSessionUserInfo | A user left |
SessionUpdated | ChatSessionInfo | Name / users / permitted emojis / permissions changed |
ConnectionStateChanged | ChatConnectionState | Connectivity changed |
Events may fire off the UI thread — the control marshals them.
Records
Section titled “Records”ChatMessage
Section titled “ChatMessage”public record ChatMessage( string MessageId, string? ClientMessageId, string SenderId, string? Body, string? ImageUrl, MessageStatus Status, string? StatusReason, DateTimeOffset Timestamp, DateTimeOffset? EditedTimestamp, IReadOnlyList<Reaction> Reactions, IReadOnlyList<ReadReceipt> ReadReceipts, string? Identifier = null, IReadOnlyDictionary<string, string>? Metadata = null);Other records
Section titled “Other records”public record Reaction(string UserId, string Emoji, DateTimeOffset Timestamp);public record ReadReceipt(string UserId, DateTimeOffset Timestamp);
public record MessageChanged(ChatMessage Message, MessageChangeKind Change);
public record MessagePage(IReadOnlyList<ChatMessage> Messages, bool HasMore); // Messages always chronological asc
public record OutgoingMessage(string? Body, OutgoingAttachment? Attachment = null, string ClientMessageId = "");public record OutgoingAttachment(ChatAttachmentKind Kind, Stream Content, string FileName, string ContentType);
public record ChatSessionInfo( string SessionId, string SessionName, ChatSessionUserInfo[] Users, string[]? PermittedEmojis, MessageBodyPermissions BodyPermissions, ChatSessionPermissions Permissions, DateTimeOffset CreatedAt, DateTimeOffset? LastReadDate, int UnreadMessageCount);
// MAUIpublic record ChatSessionUserInfo(string UserId, string DisplayName, ImageSource? Avatar, Color? BubbleColor, DateTimeOffset JoinedDate);// Blazorpublic record ChatSessionUserInfo(string UserId, string DisplayName, string? AvatarUrl, string? BubbleColor, DateTimeOffset JoinedDate);
public record UserTypingEvent(string UserId, bool IsTyping, DateTimeOffset Timestamp);public enum MessageStatus { Sending, Sent, Delivered, Read, Failed, Rejected }public enum MessageChangeKind { Edited, ReactionChanged, ReadReceiptChanged, StatusChanged }public enum MessagePageDirection { Older, Newer }public enum ChatAttachmentKind { Image } // Video/Audio/File reservedpublic enum ChatConnectionState { Connected, Reconnecting, Offline }public enum SendRejectionKind { MessageTooLarge, TooManyAttachments, AttachmentTooLarge, UnsupportedContent, NotPermitted, Other }
[Flags]public enum ChatSessionPermissions{ None = 0, CanSendMessages = 1, CanEditMessages = 2, CanDeleteMessages = 4, CanReactToMessages = 8, CanInviteUsers = 16, CanLeaveSession = 32, CanChangeSessionName = 64, CanSendImages = 128, Default = CanSendMessages | CanSendImages | CanReactToMessages | CanInviteUsers | CanLeaveSession, All = CanSendMessages | CanEditMessages | CanDeleteMessages | CanReactToMessages | CanInviteUsers | CanLeaveSession | CanChangeSessionName | CanSendImages}
[Flags]public enum MessageBodyPermissions{ None = 0, Links = 1, Bold = 2, Italics = 4, Underline = 8, Strikethrough = 16, Codeblocks = 32, All = Links | Bold | Italics | Underline | Strikethrough | Codeblocks}Exceptions
Section titled “Exceptions”public class ChatSessionException : Exception { } // GetSessionAsync: missing/forbidden sessionpublic class ChatSendRejectedException : Exception // send refused — bubble => Rejected, no retry{ public SendRejectionKind Kind { get; }}ChatView Properties
Section titled “ChatView Properties”| Property | Type | Default | Notes |
|---|---|---|---|
Provider | IChatSessionProvider? | null | The integration provider |
SessionId | string? | null | Session resolved via GetSessionAsync |
PageSize | int | 30 | Messages fetched per page |
OpenImagesInViewer | bool | true | Tap an image bubble → built-in ImageViewer |
MyBubbleColor | Color/string | #DCF8C6 | Local user bubble color |
MyTextColor | Color/string | Black | Local user text color |
OtherBubbleColor | Color/string | White | Default other-user bubble (overridden by ChatSessionUserInfo.BubbleColor) |
OtherTextColor | Color/string | Black | Other-user text color |
ChatBackgroundColor | Color?/string? | null | Messages area background |
BubbleFontSize | double | 15 | MAUI |
BubbleFontFamily | string? | null | MAUI |
TimestampFontSize | double | 11 | MAUI |
BubbleCornerRadius | double | 18 | Tail corner stays 4 (MAUI) |
PlaceholderText | string | "Type a message..." | Input placeholder |
SendButtonText | string | "Send" | Send button label |
SendButtonBackgroundColor | Color/string | #007AFF | MAUI |
SendButtonTextColor | Color/string | White | MAUI |
InputBarBackgroundColor | Color/string | #F5F5F5 | MAUI |
InputBarBorderColor | Color/string | #E0E0E0 | MAUI |
IsInputBarVisible | bool | true | false for read-only chats |
ShowTypingIndicator | bool | true | Enable typing indicators |
ScrollToFirstUnread | bool | false | Anchor initial scroll at first unread (via Info.LastReadDate) |
InputActions | IList<ChatInputAction> | [] | Custom input-bar actions (MAUI) |
CustomBubbleActions | IList<ChatBubbleAction> | [] | Custom bubble actions appended to built-ins (MAUI) |
MessageTemplate | DataTemplate? | null | Single content template (MAUI) |
MessageTemplateSelector | DataTemplateSelector? | null | Per-message template (MAUI) |
UseFeedback | bool | true | Haptic feedback (MAUI) |
AdjustForKeyboard | bool | true | iOS keyboard padding; set false inside a FloatingPanel (MAUI) |
ChatView Methods & Events (MAUI)
Section titled “ChatView Methods & Events (MAUI)”| Member | Description |
|---|---|
ScrollToEnd(bool animate) | Scroll to the latest message |
ScrollToMessage(string messageId, bool animate) | Scroll to a message by id |
SubmitEntry() | Programmatically submit the input text |
EntryText (property) | Get/set the input field text |
MessageTapped (event) | Fires for non-image bubble taps |
Custom Action Hooks (MAUI)
Section titled “Custom Action Hooks (MAUI)”public class ChatInputAction : BindableObject{ public string? Text { get; set; } public ImageSource? Icon { get; set; } public Func<ChatView, Task>? Handler { get; set; } public event EventHandler<ChatView>? Clicked; public virtual Task InvokeAsync(ChatView chatView);}
public class ChatBubbleAction : BindableObject{ public string? Text { get; set; } public ImageSource? Icon { get; set; } public Func<ChatMessage, Task>? Handler { get; set; } public event EventHandler<ChatMessage>? Clicked; public virtual Task InvokeAsync(ChatMessage message);}Shiny.Maui.Controls.SpeechAddins ships SpeechToTextTool : ChatInputAction and TextToSpeechBubbleTool : ChatBubbleAction — see Custom Actions.