You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Twilio VoIP通知报错求助:证书与BundleID需以.voip结尾的配置问题

Twilio VoIP推送报错:证书与Bundle ID匹配问题解决方案

Apple开发者平台操作步骤

  1. 登录开发者后台,进入「Certificates, Identifiers & Profiles」板块
  2. 左侧菜单选择「Identifiers」,点击右上角「+」新建标识
  3. 在注册页面选「App IDs」,点「Continue」;再选「Explicit App ID」,继续下一步
  4. 填写关键信息:
    • Description:自定义名称(比如「XX App VoIP 服务」)
    • Bundle ID:必须是主App的Bundle ID + .voip格式,例:主App ID为com.xxx.yourapp,这里填com.xxx.yourapp.voip
    • 拉到「Capabilities」区域,勾选「Push Notifications」和「Voice over IP」
  5. 确认信息后点击「Continue」→「Register」完成创建(若创建失败,检查是否有重复的Bundle ID,或主App ID格式是否合规)
  6. 创建VoIP推送证书:
    • 在「Identifiers」列表找到刚创建的.voip后缀App ID,进入详情页
    • 在「Push Notifications」栏点击「Configure」,选择开发/生产环境后点「Create Certificate」
    • 按提示上传本地生成的CSR文件,完成后下载证书,双击导入Keychain
    • 从Keychain导出该证书为.p12格式,记住导出时设置的密码

Twilio控制台配置

  1. 进入Twilio控制台「Programmable Voice」→「Settings」→「VoIP Push Credentials」
  2. 点击「New Credential」:
    • Friendly Name:自定义名称(比如「XX App VoIP 推送凭证」)
    • Certificate:上传刚才导出的.p12文件
    • Password:填写.p12的导出密码
    • Bundle ID:填入刚创建的.voip后缀Bundle ID
  3. 点击「Save」完成配置

iOS客户端适配

  1. 确保项目已开启「Voice over IP」和「Push Notifications」权限(在Xcode的「Signing & Capabilities」中添加)
  2. 获取VoIP设备Token时,使用PushKit框架,示例代码:
    import PushKit
    
    let voipPushRegistry = PKPushRegistry(queue: DispatchQueue.main)
    voipPushRegistry.delegate = self
    voipPushRegistry.desiredPushTypes = [.voIP]
    
    // 实现代理方法获取Token
    func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {
        let tokenString = pushCredentials.token.map { String(format: "%02x", $0) }.joined()
        // 将该Token上传至你的后端,再同步给Twilio
    }
    
  3. 客户端使用主App的Bundle ID运行,Twilio凭证绑定的是.voip后缀的ID,两者对应即可解决报错

内容的提问来源于stack exchange,提问作者Welgamage Prasad Perera

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 21:15:36