首页 > 解决方案 > 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();

标签: twiliotwilio-programmable-chat

解决方案


推荐阅读