Send chat message

给你一囗甜甜゛ 提交于 2019-12-23 13:14:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!