Create push message content
Push message content specifies additional JSON content in the push notification payload that is sent to the push provider.
Antes de Iniciar
Complete the following:
You must know how to use JSON with push messages.
Role required: admin or push_admin
Nota:
This process describes configuration used in the ServiceNow mobile app. Push Notification configuration for the current
ServiceNow mobile UI can be found at Mobile push
notifications
Por Que e Quando Desempenhar Esta Tarefa
Push message content defines the style of push notification that can be sent out for
your custom app. You can add custom content, such as a picture, icons, or action
buttons for the user to respond to the notification. Use the following variables in
the script:
current: properties of the current record.message: push message sent as the body of the entire push content.attributes: object of the push message attributes that you define.
Procedimento
Exemplo
The following is an example of a content record that creates a two-button layout, one to approve something, such as a change request, and one to decline it.
var json = {
"table" : current.getTableName(),
"sys_id" : current.sys_id,
"template" : {
"type": "2 button",
"button1" : {
"title" : "Approve",
"action" : attributes.button_action,
"parameters" : {
"response" : "approve"
}
},
"button2" : {
"title" : "Decline",
"action" : attributes.button_action,
"parameters" : { "response" : "decline"
}
}
}
};
json;O que Fazer Depois
Define a push message attribute to specify a default push action script or string that you can use in the push message content.