推送通知从 FCM 控制台工作,但如果从 API 发送显示“InvalidApnsCredential"错误(仅在 iOS 设备上)

问题描述:

推送通知 FMC API 在 iOS 上不起作用

Push notification FMC API doesn't work on iOS

我尝试验证我的 APNS 证书,但似乎没问题

I tried to verify my APNS certificates and seems okay

从 FMC 控制台测试通知工作并成功到达 iOS 设备

From FMC console testing notifications work and arrive successfully to iOS devices

端点网址https://fcm.googleapis.com/fcm/send

请求标头:

Content-Type:application/json
Authorization:key=**SERVER_KEY**

请求负载正文:

{
    "to": "**FMC_DEVICE_TOKEN**",
    "priority": "high",
    "notification": {
        "title": "Title",
        "body" : "First Notification",
        "text": "Text"
    }
}

响应正文:

{
    "multicast_id": 6714208302733418144,
    "success": 0,
    "failure": 1,
    "canonical_ids": 0,
    "results": [
        {
            "error": "InvalidApnsCredential"
        }
    ]
}

这显然是当今 Firebase 的一个全球性问题.在过去的 3 小时内,许多人一直在报告此错误.希望明天能解决.

This is apparently a global issue from Firebase today. Many people have been reporting this error in the past 3 hours. I hope it's gonna be fixed tomorrow.