question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

messaging/internal-error only IOS

See original GitHub issue

code is working fine when I try to send notification on android but it does not work for IOS notification. Getting the below error:

{
  "results": [
    {
      "error": {
        "code": "messaging/internal-error",
        "message": "An internal error has occurred. Please retry the request."
      }
    }
  ],
  "canonicalRegistrationTokenCount": 0,
  "failureCount": 1,
  "successCount": 0,
  "multicastId": 8118740071861272000
}

This is my code sample

return await admin.messaging()
          .sendToDevice(deviceToken, {
   data: {
       title: 'Test Fcm',
       body: 'tesing fmc body',
       content_available: 'true',
       priority: 'high',
       requestId: '1',
       doctorId: '1',
       name: 'waqas',
       patientId: '1',
       action_type: 'TEST'
     },
     notification: {
       title: 'Test Fcm',
       body: 'tesing fmc body',
       content_available: 'true',
       priority: 'high'
     }
   }
  , {
   priority: "high",
   timeToLive: 60 * 60 * 24,
   contentAvailable:true,
}).catch(err => {
              console.log(err);
            
          })

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
tomershohetcommented, Jan 20, 2021

Found the issue - They recently changed it on FCM so they do not allow to sent TEXT and BODY keys. From now on - we should only use the “Body”. Once I removed the “Text” key from the notification object - everything works fine again.

1reaction
isonlaxmancommented, May 13, 2022

This is still not reliably working for me. I have ‘body’ instead of ‘text’, and I don’t have ‘content-available’ in the payloads. It only randomly fails, works 80-90% time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected Internal Error in Messenger App - Apple Community
We understand that you're receiving an error message when trying to access the Messenger app. There are a few more steps that you...
Read more >
Firebase Messaging fails sporadically with internal-error
I have been having the same problem: node.js firebase admin SDK sending notifications to iOS occasionally fails with 500/ISE.
Read more >
How to Fix “WebKit encountered an internal error” on iPhone
The WebKit error message can come from many issues with your iOS software. In this article, we'll walk you through all the possible...
Read more >
Firebase Cloud Messaging HTTP protocol - Google
Add Firebase - Apple platforms (iOS+) · Add Firebase - Android ... Add Firebase - Server environments ... Overview · error · firebaseMLModelDownloadDidFail ......
Read more >
500 Internal Server Error - HTTP - MDN Web Docs - Mozilla
The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found