问题
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 await part of code above. I get exception:
Access is denied.
In capabilities within appxmanifest
I have selected:
Chat Message Access
(I tried select all, but It didn't work). I cannot find any sample and requirements that must be met.
Thanks for your help.
回答1:
If you take a look at MSDN you will see that:
This API is not available to all Windows/Windows Phone apps. Unless your developer account is specially provisioned by Microsoft, calls to these APIs will fail at runtime.
来源:https://stackoverflow.com/questions/34276040/send-chat-message