Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Configure push notification for your app in jQM as follows:

  1. Create your alert and map it to the required event in the ALERT_MASTER table. The column details of the ALERT_MASTER table are as follows:

    Column Name

    Description

    Sample Value

    ALERT_ID

    Unique alert ID.

    100045

    ALERT_DESCRIPTION

    A general description of the alert.

    ALERT FOR USER LOGIN

    EVENT_ID

    Unique event ID that is to be associated with the alert. The event ID is taken from the EVENT_MASTER table.

    4000123

    SEVERITY

    Severity of the alert.

    Medium

    DATA_SOURCE

    Any external data source that has to be associated for the alert or if encryption is required for the attachment then the encryption format can be specified in this column.

    NA

    IS_NOTIFICATION

    Y - Identified as Notification.
    N - Identified as Alert.

    N

    ENTL_TYPE

    If required, the entitlement type can be specified.

    SELF

    HAS_ATTACHMENT

    Denotes if there is any attachment to the alert.

    N

    ENCRYPT_ATTACHMENT

    If there is an attachment, this column can be used to denote if it is encrypted or not.

    N

    ENABLED_IND

    Denotes if the alert is enabled or not.

    Y

  2. Map your alert with the required alert channel through the ALERT_CHANNEL_MAP table. The column details of the ALERT_CHANNEL_MAP table are as follows:

    Column Name

    Description

    Sample Value

    ALERT_ID

    The alert ID that is to be associated with the channel. The alert ID is taken from the ALERT_MASTER, i.e., the alert ID created in Step 1.

    100045

    CHANNEL_ID

    The channel ID that is to be associated with the alert. The channel ID is taken from the ALERT_CHANNEL_MASTER table.

    Note: The channel ID in the ALERT_CHANNEL_MASTER table will be mapped to push notification's channel and delivery handlers. These handlers will pick the formatter and communicator classes from the MST_CIB_APPID_HANDLER_MAP table for processing the alert.

    2001

    MIME_TYPE

    The format of the alert content can be specified. For example, html or text.

    text

    ALERT_TEMPLATE_CODE

    The template code that is to be associated with the alert. It is taken from the ALERT_CHANNEL_TEMPLATE table.

    NA

    ADDTNL_PROPS

    Any additional properties that can be associated to the alert can be specified. For example, alert sound for notifications or action buttons in the notifications.

    The additional properties must be provided in JSON format.

    {"SOUND":"default", "CATEGORY": "buttons"}

    Note: If you want to display action buttons along with detailed message with placeholders, proceed to step 4, else continue with step 3.

  3. Configure the alert message for your alert through the ALERT_CHANNEL_MESSAGE table. The column details of the ALERT_CHANNEL_ MESSAGE table are as follows:

    Column Name

    Description

    Sample Value

    ALERT_ID

    The alert ID that is to be associated with the channel. The alert ID is taken from the ALERT_MASTER, i.e. the alert ID created in Step 1.

    100045

    CHANNEL_ID

    The channel ID that is to be associated with the alert. The channel ID is taken from the ALERT_CHANNEL_MASTER table.

    2001

    LANG_CODE

    The language code of the message content.

    en_US

    MESSAGE_SEGMENT

    Categorizes the message. For example, short or detailed.

    SHORT

    MESSAGE_CONTENT

    The message content is specified in this column. It should be as per the MIME_TYPE specified in the ALERT_CHANNEL_MAP table.

    Welcome to Canvas Technology.

  4. Perform the following steps only for displaying action buttons along with detailed message with placeholders in the push notifications as shown in the following screen shot.


    In the screen shot, Accept and Reject options are the action buttons. The message contains a placeholder for displaying the logged-on user's name. To create such a push notification, perform the following steps.
    1. Create a JS file for displaying the action buttons and writing the logic for those buttons. A sample code snippet is given for your reference:

      /* Sample JS code snippet for creating action buttons for 
      *  push notification as shown in the screen shot. */
      
      function accept(pushData)
      {
      	var config = 
      	{
      		// When user clicks Accept button, user will be taken to Payment workspace.
      		"workspaceId": "PAYMENT_WS" 
      	};
      	canvas.launch(config);
      }; 
      
      function reject(error)
      {
      	console.info(error);
      } 
      
      var config = 
      {
      	/* This value must be similar to the value provided for CATEGORY property in 
      	*  the ADDTNL_PROPS column of the ALERT_CHANNEL_MAP table. */
      	"buttons":
      	[{
      		// For displaying the Accept button in the push notification.
      		"icon": "accept",
      		"title": "Accept",
      		"callbackName": "accept",
      		"callback": accept
      	},
      	{
      		// For displaying the Reject button in the push notification.
      		"icon": "reject",
      		"title": "Reject",
      		"callbackName": "reject",
      		"callback": reject
      	}]
      } 
      
      document.addEventListener("deviceready", setAction, false); 
      
      function setAction()
      {
      	ct.registerPushActions(config);
      }
    2. To include placeholders in the push notification message as in the screen shot, perform the following steps:
      1. Define a placeholder that needs to be included in the push notification message in the ALERT_DATA_MASTER table:

        Column Name

        Description

        Sample Value

        DATA_KEY

        The placeholder that needs to be included in the push notification message.

        BENE_NAME

        DATA_DESCRIPTION

        Description for the placeholder key.

        Beneficiary Name

        DATA_TYPE

        Data type for the placeholder key.

        String

      2. Map the placeholder to the push notification alert in the ALERT_DATA table:

        Column Name

        Description

        Sample Value

        ALERT_ID

        The alert ID that is to be associated with the channel. The alert ID is taken from the ALERT_MASTER, i.e. the alert ID created in Step 1.

        100045

        DATA_KEY

        The placeholder that is defined in the ALERT_DATA_MASTER table must be included in this column.

        BENE_NAME

      3. Configure the alert message for your alert through the ALERT_CHANNEL_MESSAGE table:

        Column Name

        Description

        Sample Value

        ALERT_ID

        The alert ID that is to be associated with the channel. The alert ID is taken from the ALERT_MASTER, i.e. the alert ID created in Step 1.

        100045

        CHANNEL_ID

        The channel ID that is to be associated with the alert. The channel ID is taken from the ALERT_CHANNEL_MASTER table.

        2001

        LANG_CODE

        The language code of the message content.

        en_US

        MESSAGE_SEGMENT

        Categorizes the message. For example, short or detailed.

        DETAILED

        MESSAGE_CONTENT

        The message content is specified in this column. It should be as per the MIME_TYPE specified in the ALERT_CHANNEL_MAP table. Ensure to include the placeholder key in the message.

        Dear <<<<<BENE_NAME>>>>> Your Leave has been raised.

  • No labels