Skip to main content

Get Unread Notification Count

The getUnreadNotificationCount() function is used to fetch the count of unread notifications. It takes no parameters and returns a GetUnreadNotificationCountResponse as a Future.

Steps to Get Unread Notification Count

  1. Call the getUnreadNotificationCount() function using the instance of the LMFeedClient class.

  2. Use the response as per your requirement.

     // Get the response from calling the function
    final GetUnreadNotificationCountResponse unreadNotificationCountResponse = await lmFeedClient.getUnreadNotificationCount();

    // Process the response, as per requirement
    if(unreadNotificationCountResponse.success){
    // your function to handle successful retrieval of unread notification count
    handleUnreadNotificationCountSuccess(unreadNotificationCountResponse.count);
    }else{
    // your function to handle error message
    handleUnreadNotificationCountError(unreadNotificationCountResponse.errorMessage);
    }

Models

GetUnreadNotificationCountResponse

List of parameters for the GetUnreadNotificationCountResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure
countintCount of unread notifications