iOS VoIP推送通知和Firebase

3

我想通过Firebase发送VoIP推送通知。 我在Firebase控制台中上传了一个*.p8文件,并且现在显示有一个APNs Auth Key

我的闹钟推送通知可以正常发送,没有任何问题:

'apns' => [
    'headers' => [
        'apns-push-type' => ‘alarm',
    ],
...

但是当我尝试将类型更改为voip时,出现了错误:

'apns' => [
    'headers' => [
        'apns-push-type' => 'voip',
        'apns-topic' => ‘com.mycompany.myapp.voip'
    ],
...

Firebase的响应:

#errors: array:1 [
      "error" => array:4 [
        "code" => 400
        "message" => "Request contains an invalid argument."
        "status" => "INVALID_ARGUMENT"
        "details" => array:2 [
          0 => array:2 [
            "@type" => "type.googleapis.com/google.firebase.fcm.v1.FcmError"
            "errorCode" => "INVALID_ARGUMENT"
          ]
          1 => array:2 [
            "@type" => "type.googleapis.com/google.rpc.BadRequest"
            "fieldViolations" => array:1 [
              0 => array:2 [
                "field" => "message.token"
                "description" => "Invalid registration token"
              ]
            ]
          ]
        ]
      ]
    ]

有什么想法吗?我有没有错过什么重要的东西吗?
1个回答

3
日期(2020年3月16日)的情况是:Firebase Cloud Messaging目前不支持APNS VoIP推送通知,但计划支持。
官方Firebase支持回答:

目前FCM不支持VoIP推送。然而,我们知道像您这样的许多开发人员希望拥有此功能,因此已经提出了一个功能请求。目前,我们尚未发现任何关于实施该功能的详细信息或时间表。您可以定期查看我们的发布说明以获取有关Firebase功能及其服务的更新。


这个在Mac上有没有改动?现在支持了吗?(2020年9月) - alext
我不得不直接使用APNS而不是Firebase进行工作,所以我不知道任何关于此的更新。但是快速查看Firebase发布说明并没有给出任何结果。 - chimit
有没有关于如何直接使用APNS的教程?非常感谢。 - alext
苹果文档在这里:https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns/ - chimit
有任何更新,请告知,我也遇到了同样的问题。 - Alex

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接