twilio - Twilio,聊天客户端初始化失败:对 EMS 服务的请求失败,无法设置 FPA 令牌}
问题描述
如果我生成带有语音和聊天授权的访问令牌,我无法构建聊天客户端,它会返回“对 EMS 服务的请求失败,无法设置 FPA 令牌”。只有聊天授权的访问令牌按预期工作。我检查了所有 Twilio 服务 SID、API 密钥等。
这是我的令牌生成方法的示例:
var grants = new HashSet<IGrant>
{
new VoiceGrant()
{
OutgoingApplicationSid = voiceSid,
PushCredentialSid = pushCreds
},
new ChatGrant()
{
ServiceSid = chatSid,
PushCredentialSid = pushCreds,
EndpointId = $"chatSample_{identity}"
},
};
var token = new Token(
accSid,
apiKey,
apiSecret,
identity,
grants: grants);
return token.ToJwt();
解决方案
推荐阅读
- smtp - 在 Apache/Debian/Linode 上为多个客户网站设置多个联系表格的最佳方式
- python - 努力理解如何在 qtdesigner 设计的选项卡布局中嵌入 matplotlib 小部件图形
- node.js - 无法将应用程序/八位字节流解析为节点 js 中的图像
- .net - 如何验证 devextreme 文本框中的输入格式?
- javascript - 在 `useEffect()` 中手动调用 api
- dropdown - 想要在页面加载时将下拉值放入文本框中,下拉值从 asp.net C# 中的数据库中获取
- python - 使用命令后如何检查消息;不和谐.py
- vue.js - Vue 应用部署到 Github 失败:index.html 为空,altought dist 已正确构建。为什么?
- php - 在多行中插入同名 PDO PHP 选择的值
- r - R - 卡方独立性检验 - 如何?