Reputation: 63
I need some help. I have this code:
Windows.ApplicationModel.Chat.ChatMessageStore store = await Windows.ApplicationModel.Chat.ChatMessageManager.RequestStoreAsync();
var msgList = store.GetMessageReader();
IReadOnlyList<Windows.ApplicationModel.Chat.ChatMessage> a = await msgList.ReadBatchAsync()
And I read all SMS with this
foreach (var item in a)
{
System.Diagnostics.Debug.WriteLine(item.Body);
}
How can I read only unread SMS? I mean only read new SMS and afterwards change the status to 'read'.
Question is for Uwp Win 10..
Upvotes: 1
Views: 432
Reputation: 2679
Take a look at ChatMessage class
IsRead property is Read-only. That mean you can only check is message already readed. But you can't set that message is been readed or unreaded
foreach (Windows.ApplicationModel.Chat.ChatMessage item in a)
{
if (item.IsRead) System.Diagnostics.Debug.WriteLine(item.Body);
}
Upvotes: 2