Send chat message

I have this code:

var msg = new ChatMessage();
msg.Body = "Test";
msg.Recipients.Add("number");

var cms = await ChatMessageManager.RequestStoreAsync();
await cms.SendMessageAsync(msg);

and I have a problem with the expectation part above. I get an exception:

Access is denied.

In the features in appxmanifestI chose:

Access Chat Messages

(I tried to select everything, but that didn't work). I can not find a sample and the requirements that must be met.

Thank you for your help.

+4
source share
1 answer

If you look at MSDN , you will see that:

This API is not available for all Windows / Windows Phone applications. Unless your developer account is specifically provided by Microsoft, calls to these APIs will not be made at run time.

+4

Source: https://habr.com/ru/post/1619987/


All Articles