Chat SDK Javascript
v2
Desktop Push Notifications
You can create your own desktop notification by using newMessageCallback, for example:
// Show a nofication when receiving new message from Qiscus Chat SDK
qiscus.init({
AppId: 'YOUR_APP_ID',
options: {
// For documentation about event handler in Qiscus Chat SDK
// you can read it here
// http://sdk.qiscus.com/docs/web#event-handler
// and for more information about message object\
// you can just inspect it with your prefered devtools
// or even just doing `console.log` it.
newMessageCallback: function (messages) {
// Here you can setup a notification to notify your user,
// You can use a desktop notification, or simply
// modifying browser title
const message = messages
showDesktopNotification(message)
}
}
})
Last updated on
Was this page helpful?
Qiscus Technology