This page provides troubleshooting help and answers to frequently asked questions about Cloud Messaging.
Firebase Cloud Messaging provides a complete set of messaging capabilities through its client SDKs and HTTP server protocol. For deployments with more complex messaging requirements, FCM is the right choice.
The Notifications composer is a lightweight, serverless messaging solution built on Firebase Cloud Messaging. With a user-friendly graphical console and reduced coding requirements, the Notifications composer lets users send messages to re-engage and retain users, foster app growth, and support marketing campaigns.
Capabilities | Notifications composer | Cloud Messaging | |
---|---|---|---|
Target | Single device | ||
Clients subscribed to topics (i. e. weather) | |||
Clients in predefined user segment (app, version, language) | |||
Clients in specified analytics audiences | |||
Clients in device groups | |||
Upstream from client to server | |||
Message Type | Notifications up to 2kb | ||
Data messages up to 4kb | |||
Delivery | Immediate | ||
Future client device local time | |||
Analytics | Built-in Notifications analytics collection and funnel analytics |
You can use Firebase Cloud Messaging as a standalone component, without using other Firebase services.
When it looks like devices haven't successfully received messages, check first for these two potential causes:
Foreground message handling for notification messages. Client apps need to add message handling logic to handle notification messages when the app is in the foreground on the device. See the details for iOS and Android.
Network firewall restrictions. If your organization has a firewall that restricts the traffic to or from the Internet, you need to configure it to allow connectivity with FCM in order for your Firebase Cloud Messaging client apps to receive messages. The ports to open are:
- 5228
- 5229
- 5230
FCM usually uses 5228, but it sometimes uses 5229 and 5230. FCM doesn't provide specific IPs, so you should allow your firewall to accept outgoing connections to all IP addresses contained in the IP blocks listed in Google's ASN of 15169.
When your app is in the background, notification
messages
are displayed in the system tray, and onMessageReceived
is not called. For
notification messages with a data payload, the notification message is displayed
in the system tray, and the data that was included with the notification message
can be retrieved from the intent launched when the user taps on the
notification.
For more information, see Receive and handle messages.
FID (Firebase Installation ID) is the identifier of an app instance. If the installation data of an app instance is restored from a backup, then FCM returns this error to indicate that the FID has already been occupied by a different app instance so the current app instance cannot use the FID to register with FCM.
We recommend developers to do the following in their app:
- Exclude
Firebase installation data in backup. The Firebase installation data is stored
in a
PersistedInstallation....json
file. The filename is a constant for an app. For example,<exclude domain="file" path="PersistedInstallation....json" />
- Delete the
PersistedInstallation....json
file on receiving errors "Invalid argument for the given fid". The next time your app registers with FCM, a new FID will be created.
No. Firebase Cloud Messaging switched to the HTTP/2-based APNs protocol in 2017. If you're using FCM to send notifications to iOS devices, there should be no action required on your part.
FCM quotas and limits
This use case cannot be supported. You must spread your traffic out over 5 minutes.
Unfortunately, we cannot grant quota increases for this reason. You must spread your traffic out over 5 minutes to avoid spiky traffic.
We recommend that you start sending the notifications at least 5 minutes prior
to the event. Alternatively, send data
messages and implement
your platform's analog of onMessageReceived
handler to schedule local
notifications ahead of time.
See Google Cloud guidance on how to chart and monitor quota metrics.
While we understand that quota limits can be challenging, quotas are vital to keeping the service reliable and we can't grant exemptions. Use retries to properly handle 429 errors.
Your quota increase request depends on your use of FCM. In any case, you can expect an answer in a few business days. In some cases, there may be some back-and-forth regarding your usage of FCM and various circumstances, which can prolong the process. If all requirements are met, most requests will be handled within 2 weeks.
You can request additional quota to support an event lasting up to 1 month. File the request at least 1 month in advance of the event and with clear details on when the event starts and ends, and FCM will make every practical effort to fulfill the request. If granted, these quota increases will be reverted after the event's end date.
While Google won't do so lightly, quotas may be changed as needed to protect the integrity of the system. When possible, Google will notify you in advance of such changes. Keep your Cloud MSA contacts updated to increase the chances of receiving service announcements.