How to
Setting up push notifications in Pendula

Shrawani Bhattarai
Shrawani Bhattarai
  • Updated

Make a web request Data Action

What is a push notification?

A push notification is a message sent from a server to a user's mobile device, appearing in the notification area of the device. These notifications are designed to deliver timely, relevant information to users, helping to keep them engaged with the application even when it is not actively being used.

On a mobile application, a push notification is typically triggered under one of two conditions (or both):

An event occurs inside the application:

This refers to notifications generated by the app itself based on user interactions or scheduled events. For example, a calendar app may send a reminder notification to the user about an upcoming meeting or event.

An event is received from an external application:

In this scenario, an external system or application sends data to the mobile app, which then triggers a push notification. For example, a weather app might receive data from a weather service indicating a severe weather alert, prompting the app to send a push notification to the user.

Pendula supports the second use case, where an external event triggers a push notification.

Sending push notifications from Pendula

Push notifications are sent from Pendula over HTTP, using the web request node. This allows you to send push notifications at any point in a flow where you want to communicate with your customer.

Messages are sent as JSON payloads to the backend of your push notification solution, allowing you to choose the format, timing and destination for each message.

Branded-push-notifications.svg

Push notification examples

Our JSON payloads can be customised to support simple or complex use cases.

For example, you can send a simple push notification to thank a customer on an anniversary.


  {
  "message":{
    "token":"zbk3RNwTe3H0:CI2k_HHwgIp...",
    "notification":{
      "title":"Happy Annivesary!",
      "body":"Thank you for shopping with us! Check your email for a special thank you from us."
    }
  }
}

Or a complex notification that lets you adjust the notification to suit the platform your customer is using.


  {
    "message": {
        "token": "zbk3RNwTe3H0:CI2k_HHwgIp...",
        "notification": {
            "title": "Summer celebrations",
            "body": "It's time to celebrate summer with these great offers!!"
        },
        "android": {
            "ttl": "86400s",
            "notification": {
                "click_action": "OPEN_ACTIVITY_1"
            }
        },
        "apns": {
            "headers": {
                "apns-priority": "5"
            },
            "payload": {
                "aps": {
                    "category": "NEW_MESSAGE_CATEGORY"
                }
            }
        },
        "webpush": {
            "headers": {
                "TTL": "86400"
            }
        }
    }
}