Push Notifications work from FCM console but if sent from API show “InvalidApnsCredential” error (only on iOS devices)

不想你离开。 提交于 2019-12-13 17:08:57

问题


Push notification FMC API doesn't work on iOS

I tried to verify my APNS certificates and seems okay

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

Endpoint url https://fcm.googleapis.com/fcm/send

Request headers:

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

Request payload body:

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

Response body:

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

回答1:


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.



来源:https://stackoverflow.com/questions/57310186/push-notifications-work-from-fcm-console-but-if-sent-from-api-show-invalidapnsc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!