Building Apps with Jigx
Additional functionality

Notifications

4min

Notifications are a powerful way to grab your user's attention. With

, notifications appear on the user's device as push and in-app notifications.

Push Notification
Push Notification

In-App Notification
In-App Notification


There are three different ways to create notifications:

Send notifications using Jigx Management

Read the documentation about Notifications in the Admininstration section to learn more about managing notifications using

.

Notifications in Jigx Management
Notifications in Jigx Management


Send notifications programmatically

You can send notifications from within your solution to other users. There are two elements to include in your solution in order to send notifications:

  • Function: To communicate with the
    
    (or any other) REST API, you have to define a function in the Functions folder of your solution. The function has input parameters such as the notification title, the notification text and requires a
    
    accessToken or personal access token (PAT) .
  • When calling the function within
    
    use the
    
    accessToken, when calling the function from outside
    
    use the personal access token. Your personal access token is available in
    
    / User/ Personal Access Tokens.
  • Jig: Your
    
    s will invoke the function for sending notifications either via submitting form values to the function or by using an execute-entity action for invoking the function.

Function

You can use the

 REST API to send notifications to other users within your organization.

Add a function definition (send-notification.jigx) to the functions folder of your solution Replace the {organizationId} in the url with your organization's Id.

See the code sample in GitHub.

send-notification.jigx


Calling the Function from a Jig

In your

, you can either invoke the above function using an execute-entity action or by submitting a form using submit-form. Sending notifications using an execute-entity action gives you more control over what's being sent to the function.

Target a Jig with Input Parameters

You can also target a specific

 with input parameters from your push notification. An example of this would be a notification about a new product promotion with the promotion detail

as the target. When the user taps on the notification (either on the native push notification or the in-app notification), the app will navigate to the specific promotion:

For this, you need a REST function definition, a Jig that invokes the REST function, and a target

 that will be displayed when the user taps on the notification. See Notifications for the code example.

Send notifications using a Webhook

For external systems that should send

 notifications you can use Web-hooks provided by the

platform.

Reach out to the Jigx Support team to receive the technical details and security credentials for your organization to get started with Web-hooks.

You can find the above examples in the jigx-samples app on Github.

Examples and code snippets

The following examples with code snippets are provided:



Updated 08 Aug 2024
Doc contributor
Did this page help you?