-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: revamp example app, implement prelim content types #81
Conversation
eb27084
to
0169520
Compare
async send(content: any): Promise<string> { | ||
async send(content: string | MessageContent): Promise<string> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gist of the send(...)
signature change.
// This contains the contents of a message. | ||
// Each of these corresponds to a codec supported by the native libraries. | ||
// This is a one-of or union type: only one of these fields will be present. | ||
export type MessageContent = { | ||
text?: string; | ||
unknown?: UnknownContent; | ||
reply?: ReplyContent; | ||
reaction?: ReactionContent; | ||
attachment?: AttachmentContent; | ||
remoteAttachment?: RemoteAttachmentContent; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gist of the new message content.
We pass one of these to .send(...)
and we also receive one whenever we receive a DecodedMessage
.
I'm not sure if you need the group chat codecs just yet. I think @nakajima might be doing a revamp on how group chat works. Not sure if these will still be relevant. |
0169520
to
e2e05c3
Compare
b0ccc5f
to
a048214
Compare
Hey wondering if there is any timeline for group chat features in RN lib? |
@peterferguson Not yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these changes look great. Could be fine to do the rest of the codecs in a follow up PR. Thanks for all the tweaks to the example app as well.
a048214
to
79b827e
Compare
79b827e
to
ec32626
Compare
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This revamps the example app and adds support and demo of standard content types.
Instead of attempting to use the JS codecs, this takes the approach of relying on the native SDK codecs and then passing a JSON edition of the decoded content back/forth to the JS layer.
This means that adding a new content type looks something like:
This means there will always be a native codec for supported content types. This is important for native-only contexts like handling push notifications.
Here's my rough TODO list for tracking this WIP:
prettier
These will come in a later PR: