There are two different views when rendering notification channels: Feed and Chat. Feed view shows all notifications in a list form while Chat view shows notifications in the form of a user-to-user group channel.
Chat UIKit Android for Notifications provides both activity and fragment to create a Feed view. You can choose which one to build your app with and you may solely use activity instead of fragment if you wish to. You can build a Feed view through FeedNotificationChannelActivity, which uses UIKitFragmentFactory to create views. The channel URL of the Feed notification channel can be found on Sendbird Dashboard under Notifications > Channels.
FeedNotificationChannelActivity allows you to create a basic FeedNotificationChannelFragment through UIKitFragmentFactory and FeedNotificationChannelFragment.Builder. UIKitFragmentFactory has a set of methods that build each fragment, whereas the builder class provides APIs to customize the UI of the data and event handlers used in FeedNotificationChannelFragment.
JavaKotlin
FeedNotificationChannelFragment fragment = new FeedNotificationChannelFragment.Builder("FEED_CHANNEL_CHANNEL_URL").build();
Note: To use the UIKit's fragments as a nested fragment, refer to the Android Developer Documentation's Nested Fragments.
A green badge appears above the notification bubble when the current user receives a new notification in the Feed view. This badge is displayed based on the feed's last read time value at the time of view creation. However, this time value remains the same while the Feed view is on foreground, which prevents the badge from disappearing even if the user's already seen the notification. If you want to update the last read time value, see the code below.
JavaKotlin
// Retrieve the Feed notification channel fragment.
// This is the fragment that you used to create the Feed view.
NotificationChannelFragment fragment = getNotificationChannelFragment();
// Updates to the last read time value on the channel.
notificationFragment.updateLastReadTimeOnCurrentChannel();
Chat UIKit Android for Notifications provides both activity and fragment to create a Chat view. You can choose which one to build your app with and you may solely use activity instead of fragment if you wish to. You can build a Chat view through ChatNotificationChannelActivity, which uses UIKitFragmentFactory to create views. The channel URL of the Chat notification channel can be found on Sendbird Dashboard under Notifications > Channels.
ChatNotificationChannelActivity allows you to create a basic ChatNotificationChannelFragment through UIKitFragmentFactory and ChatNotificationChannelFragment.Builder. UIKitFragmentFactory has a set of methods that build each fragment, whereas the builder class provides APIs to customize the UI of the data and event handlers used in ChatNotificationChannelFragment.
JavaKotlin
ChatNotificationChannelFragment fragment = new ChatNotificationChannelFragment.Builder(“CHAT_NOTIFICATION_CHANNEL_URL”).build();
Note: To use the UIKit's fragments as a nested fragment, refer to the Android Developer Documentation's Nested Fragments.