messages

abstract val messages: Flow<IncomingMessage>

Stream of foreground data messages.

The SDK parses standard keys and emits IncomingMessage objects whenever a push notification arrives while the app is active.

Example usage:

lifecycleScope.launch {
AFCore.messaging().messages().collect { msg ->
showInAppNotification(msg.title, msg.body)
}
}
Task {
for await msg in AFCore.shared.messaging().messages() {
self.showInAppNotification(msg.title, msg.body)
}
}