Last updated
Was this helpful?
Last updated
Was this helpful?
The bird.appinbox
is the main entry point for app inbox in Bird client SDKs. Through which you can do the following:
Get messages
Listen to incoming messages
Mark message as read
App inbox messages will arrive in real-time when the client application is opened. You can listen to incoming messages as shown in this example
Each message has a readAt
field to indicate whether is read or unread and when the message was read. You can mark a message as read by calling bird.appinbox.markMessageRead(message)
.
// getAppInboxMessages() returns a flow which you can gradually consume
bird?.appInbox?.getAppInboxMessages()?.collect { message ->
println("Message: $message")
}
// or you can consume the whole flow into one list
val allMessages = bird?.appInbox?.getAppInboxMessages()?.toList()
// incoming is a Channel<AppInboxMessage> through which you can
// listen to incoming messages
bird?.appInbox?.incoming?.consumeEach { message ->
println("Message: $message")
}
// markMessageRead() marks the message as read
bird?.appInbox?.markMessageRead(message)