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.
Feed vs. Chat
The following table lists the difference between Feed view and Chat view.
A list view that contains a new notification badge.
A channel view that contains a channel image and timestamp for each notification.
Order of notifications
The most recent notification is displayed at the top.
The most recent notification is displayed at the bottom.
Shown in channel list view
Yes, it's included in the channel list view along with other group channels.
The following items are key elements of
SBUFeedNotificationChannelViewController that are used to create a Feed view of the notification channel.
You can start building a new Feed view through the
SBUFeedNotificationChannelViewController class by following the code below. Once the view is created, display the channel anywhere you want in your app. The channel URL of the feed notification channel can be found on Sendbird Dashboard under Notifications > Channels.
If you already have an exisiting
FeedNotificationChannelViewController, you need to update channel information before displaying the Feed view.
SBUFeedNotificationChannelModule and its components are used to display the Feed view. The module is composed of two components:
headerComponent shows the title of the notification channel.
listComponent shows a list of all notifications sent to the user.
Configure new notification badge
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 in the 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. You can also call the
updateLastSeenAt(_:) method in
Refresh notification collections
If you've authenticated to the Sendbird server by calling
SendbirdUI.authenticateFeed(completionHandler:), there's no WebSocket connection between the UIKit and the Sendbird server. Due to the lack of connection, the UIKit can't receive real-time events to notify the user with updated information about the feed channel.
The UIKit will automatically refresh the notification collections when the client app is brought to foreground or when the device's network connection has changed. In the case that the collection information is received as a push notification from the client app, you can refresh the content of all valid notification collections.
NotificationCollectionis valid only if the
isLiveflag is set to
The following items are key elements of
SBUChatNotificationChannelViewController that are used to create a Chat view of the notification channel.
Before creating the Chat view, implement the code below if you're already using a channel view in your app with standard modal and navigation. The channel URL of the chat notification channel can be found on Sendbird Dashboard under Notifications > Channels.
If you're currently using Chat UIKit for iOS features with a specific root view controller, implement the code below.
If you're using the channel view differently in your app than the cases mentioned above, then you need to find the existing
ChatChannelViewController object and display the view in your app. You need to also update channel information before displaying the Chat view if you already have an exisiting
SBUChatNotificationChannelModule and its components are used to display the Chat view. The module is composed of two components:
headerComponent shows the channel title, channel image, and a back button that takes the user to the previous view.
listComponent shows a list of all notifications.