Update . The last function was added for FCM, which makes it possible to provide certain parameters for specific platforms, called Platform Overrides :
Configuring messages across platforms
Messages sent by the FCM v1 HTTP protocol can contain two types of JSON key pairs:
- A common set of keys that will be interpreted by all application instances that receive the message.
- platform-specific blocks that are only interpreted by application instances running on the specified platform.
, , , . , .
, , message.notification.title, message.notification.body message.data.
, , ; . , iOS , Android, : iOS .
, , . , ; , . , - - , Android , iOS .
:
v1 , . , :
- Android -, APNs (iOS)
- Android iOS -
click_action category .
{
"message":{
"token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"notification":{
"title":"Match update",
"body":"Arsenal goal in added time, score is now 3-0"
},
"android":{
"ttl":"86400s",
"notification"{
"click_action":"OPEN_ACTIVITY_1"
}
},
"apns": {
"headers": {
"apns-priority": "5",
},
"payload": {
"aps": {
"category": "NEW_MESSAGE_CATEGORY"
}
}
},
"webpush":{
"headers":{
"TTL":"86400"
}
}
}
}
. HTTP v1 , , , . , , . Build Send Requests.
, , , , . , . - "".
, , (, topics/(Android/iOS)_<Your App Name>), .
, Firebase DB, node:
/pushTokens
/android
/{userId} : string
/ios
/{userid}: string
.