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 iOS SDK, by following the steps given below.
Steps to fetch unread notification count
- Call
getUnreadNotificationCount()
function using the instance ofLMFeedClient
. - Process the response LMResponse<GetUnreadNotificationCountResponse> as per your requirement.
LMFeedClient.shared.getUnreadNotificationCount() {[weak self] response in
// response (LMResponse<GetUnreadNotificationCountResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
GetUnreadNotificationCountResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
count | Int | Count of unread notifications. |