发送聊天消息 [英] Send chat message

查看:44
本文介绍了发送聊天消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个代码:

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:

访问被拒绝.

appxmanifest 中的功能中,我选择了:

In capabilities within appxmanifest I have selected:

聊天消息访问

(我试过全选,但没用).我找不到任何必须满足的样本和要求.

(I tried select all, but It didn't work). I cannot find any sample and requirements that must be met.

感谢您的帮助.

推荐答案

如果你看看 在 MSDN 你会看到:

If you take a look at MSDN you will see that:

并非所有 Windows/Windows Phone 应用都可以使用此 API.除非您的开发者帐户是由 Microsoft 专门提供的,否则对这些 API 的调用将在运行时失败.

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.

这篇关于发送聊天消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆