Skip to main content

Fetch Unread Notification Count

Unread Notification count helps you to show the unread notification which you can use to nudge the user to check the notification feed. You can achieve the same with LikeMinds Android SDK, by following the steps given below.

Steps to fetch unread notification count

  1. Call getUnreadNotificationCount() function using the instance of LMFeedClient.
  2. Process the response (LMResponse<GetUnreadNotificationCountResponse>) as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// get response (LMResponse<GetUnreadNotificationCountResponse>)
val response = LMFeedClient.getInstance().getUnreadNotificationCount()
if (response.success) {
// your function to process the response dataa
processGetUnreadNotificationCountResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

GetUnreadNotificationCountResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
countIntCount of unread notifications.