Search code examples
iosfirebaseapple-push-notificationscapacitor

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


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"
        }
    ]
}

Solution

  • 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.