Skip to main content

Pending messages

Get Pending Messages Count#

Once the authentication process is over, we can then request the pending messages to be read by the user using the following method:

func unreadMessageCount(completion: @escaping (Int, MeetingLawyersError?) -> Void)

Update App Badge#

Badge

So, once we get the result, we can update application badge icon:

MeetingLawyersApp.unreadMessageCount { count, error in
DispatchQueue.main.async {
if #available(iOS 16.0, *) {
UNUserNotificationCenter.current().setBadgeCount(count)
} else {
UIApplication.shared.applicationIconBadgeNumber = count
}
}
}

Next steps#