Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver
messages at no cost.

Using FCM, you can notify a client app that new email or other data
is available to sync. You can send notification messages to drive user re-engagement and
retention. For use cases such as instant messaging, a message can transfer a
payload of up to 4KB to a client app.

Using deprecated Google Cloud Messaging APIs? Learn more about how to migrate to FCM.

Implementation path

Set up Firebase and FCM on your app according to the
setup instructions for your platform.

Develop your client app

Add message handling, topic subscription logic, or other optional
features to your client app. During the development, you can easily
send test messages from the
Notifications composer.

Develop your app server

Decide whether you want to use the
Firebase Admin SDK or one of the server protocols to create your sending
logic—logic to authenticate, build send requests, handle responses, and
so on. Then build out the logic in your trusted environment. Note that if
you want to use upstream messaging from your client applications, you must
use XMPP, and that Cloud Functions does not support the persistent
connection required by XMPP.

Next steps

Run the Android
or iOS
Quickstart sample. These samples let you run and review code to send a test
message to a single device using the Firebase console.

Set up your trusted environment where you'll build and send message requests.
You can write sending logic using the
Admin SDK, and
readily deploy that code on Cloud Functions for Firebase or other other cloud
environments managed by Google.
Alternatively, you can perform server development using the
FCM server protocols.

Learn more about sending data payloads, setting message priority, and other
messaging options
that are available with FCM.