排查Firebase Console发送通知时“Error sending message”报错原因
Hey there, sorry to hear you're stuck with this vague, unhelpful error in Firebase Console—those silent snackbars are definitely frustrating, especially when you’ve already ruled out network issues. Let’s break down actionable steps to dig into the root cause:
Check your browser’s dev console for hidden error details
The snackbar might hide the full error, but your browser’s developer tools will log it. Here’s how to access them:- Open Firebase Console in Chrome or Firefox
- Right-click anywhere on the page → Select "Inspect" (or press
F12/Ctrl+Shift+Ion Windows,Cmd+Opt+Ion Mac) - Switch to the Console tab
- Try sending the notification again—look for red error entries tagged with Firebase or Cloud Messaging. These logs will include specific error codes, payload issues, or auth problems that the snackbar doesn’t show.
Verify your Firebase project’s notification quotas
Even with a stable network, you might have hit daily limits for Cloud Messaging. To check:- Go to Firebase Console → Project Settings → Usage and Billing → Details
- Locate Cloud Messaging in the service list
- Check if you’ve exceeded the free tier quota or your paid plan’s limits. If so, you’ll need to upgrade your plan or wait for the quota to reset the next day.
Validate your notification payload for hidden issues
Sometimes the error stems from an invalid payload that the Console doesn’t flag clearly. Double-check:- Avoid special characters or emojis in the title/body for a test—send a plain-text notification first to rule out parsing problems.
- If using custom data fields, ensure your JSON is valid (no trailing commas, correct key-value pairs). Use the Test on Device feature with a minimal payload to isolate this.
Check for Firebase service outages
Rarely, the problem might be on Firebase’s backend. You can search for "Firebase Status Dashboard" to check if Cloud Messaging or Console services are experiencing temporary disruptions—even a stable local network won’t help if Firebase’s servers are down.Clear browser cache and disable conflicting extensions
Corrupted cache or overzealous extensions can break Firebase Console functionality:- Clear your browser’s cache and cookies specifically for Firebase Console (or all sites if needed)
- Temporarily disable ad blockers, VPNs, or privacy extensions—some block the API calls Firebase uses to send notifications.
- Try sending the notification in an incognito/private window to see if the error goes away.
Double-check your Cloud Messaging configuration
If you’ve recently updated project settings (like server keys or Android certificates), a misconfiguration could be the culprit:- Go to Firebase Console → Cloud Messaging → Project Settings
- Ensure your server key is valid and hasn’t been revoked
- For Android apps, confirm your SHA-1/SHA-256 certificates are correctly added to the project.
If none of these steps work, try creating a super simple notification (just a title and body) and send it to a single test device. If that succeeds, the issue is likely tied to your original payload or target audience setup.
内容的提问来源于stack exchange,提问作者sziraqui

