getUnreadMessageCount

Retrieves the count of unread inbox messages for the device.

Syntax

Future<int?> getUnreadMessageCount()

Returns

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

Example

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

Related Methods