getUnreadMessageCount

Retrieves the count of unread inbox messages for the device.

Syntax 

1Future<int?> getUnreadMessageCount()

Returns 

  • Future<int?> - Returns the number of unread messages, or null if the count cannot be determined.

Example 

1int? unreadCount = await SfmcSdk.getUnreadMessageCount();
2if (unreadCount != null) {
3  print('Unread messages: $unreadCount');
4} else {
5  print('Unable to get unread message count');
6}

Related Methods