config/iOSin your workspace
app.tsor any file which is executed at the start of the project, you can receive token with
~/workspace/config/Androidfolder. It contains all properties of notification. The notification handler searches for keys as title, body and so on from this file and then found keys are exposed with hierarchical path. For example,
$notification.title, here is notification is root object and title is key and was what we are searching.
$notification.title). So, the
pushnotification.jsonprepared according to the received notification json schema.
pushnotification.jsonincludes above examples and, the mapping between actual and desired key . Here, desired key is title-key which is name of your key (checkout example 2) and actual key is title that is title property of notifications.
"title" : "title of notification"
"body" : "body of notification"
"icon":" icon name of notification. It searches the name from **images** folder. No need to specify file extension."
"channelId": "any number as unique notification id for an app ",
"channelIdTitle": "title of notification(app name etc.)",
"channelIdImportance": "a number between 1-5"
"deleteChannelId": "deletes exist channel"
"showBadge" : "if sets false, badge won't appear on app icon."
Authorization: key: This is the server key, where values are available in your Firebase project console under Project Settings > Cloud Messaging. -
Content-Type: application/json for JSON; application/x-www-form-urlencoded;charset=UTF-8 for plain text.
to: Registered token -
data: should contain the body, title and icon as specified above (notification content)
registerForPushNotificationsmethod. For this purpose, you need to use the curl information below:
notification: notification content -
registration_ids: registered token