Deliver and receive messages and notifications on iOS.
- Firebase Cloud Messaging on iOS
Using FCM, you can notify an iOS client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention.
Firebase Cloud Messaging (FCM) offers a broad range of messaging options and capabilities
Capability | Explains |
---|---|
Send notification messages or data messages | Send notification messages that are displayed to your user. Or send data messages and determine completely what happens in your application code. See Message types. |
Versatile message targeting | Distribute messages to your client app in any of 3 ways—to single devices, to groups of devices, or to devices subscribed to topics. |
Send messages from client apps | Send acknowledgments, chats, and other messages from devices back to your server over FCM’s reliable and battery-efficient connection channel. |
- Notification messages, sometimes thought of as "display messages." These are handled by the FCM SDK automatically.
{
"message":{
"token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"notification":{
"title":"Portugal vs. Denmark",
"body":"great match!"
}
}
}
Notification messages have a predefined set of user-visible keys and an optional data payload of custom key-value pairs.
- Data messages, which are handled by the client app.
{
"message":{
"token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"data":{
"Nick" : "Mario",
"body" : "great match!",
"Room" : "PortugalVSDenmark"
}
}
}
Data messages have only custom key-value pairs. A message can transfer a payload of up to 4KB to a client app.
An FCM implementation includes two main components for sending and receiving:
-
A trusted environment such as Cloud Functions for Firebase or an app server on which to build, target, and send messages and an iOS client app that receives messages.
-
You can send messages via the HTTP and XMPP APIs. For testing or for sending marketing or engagement messages with powerful built-in targeting and analytics, you can also use the Notifications composer.
Everything we need
Method swizzling is the process of changing the implementation of an existing selector
Currently FCM provides these raw server protocols:
- FCM HTTP v1 API
- Legacy HTTP protocol
- Legacy XMPP Protocol
Using the FCM app server protocols, you can build message requests and send them to these types of targets:
- Topic name
- Condition
- Device registration token
- Device group name (legacy protocols only)