The Messaging feature of Kumulos allows you to send unlimited in-app messages and push notifications to installations of your app on iOS and Android devices, via the native Apple Push Notification Service (APNS) and Firebase Cloud Messaging (FCM). Please see the Messaging section of our docs for more details.

PushWoosh is another popular push notification vendor. If, for whatever reason, you wish to send a push notification via PushWoosh, then you can write a KScript method to do this.

Please note that any notifications sent via PushWoosh will not show up in Analytics or your Push Notification Dashboard. You must integrate Kumulos push notifications to get this.


This recipe assumes that you have KScripts enabled for your app, you have your own PushWoosh developer account and you have integrated the PushWoosh SDK into your client application.

You need a PushWoosh Developer account to access their Remote API.


Click the 'Create Some KScript' button and create a new KScript method called _push_ to encapsulate the PushWoosh integration. This method will define a Push object with three functions:

  • _callPushWoosh (a private method to interact with PushWoosh API)
  • _createNotification (a private method to create the payload)
  • _broadcast (a public method called to send push notification)
Push = {
   _client: K.http.createClient(''),
   _headers: {'Content-type': 'application/json'},

   _callPushWoosh: function (action, data) {

       var result = 0;

       var json = K.JSON.stringify({
           request: data

       try {
           var response =, json, this._headers);
           result = response.isSuccess();

           if (result) {
           else {
       catch (e) {

       return result;

   _createNotification: function (content, devices, data) {

       var msg = {
           send_date: 'now',
           content: content

       if (devices && devices.length) {
           msg.devices = devices;

       if (data) {
  = data;

       return {
           application: this._pwAppCode,
           auth: this._pwApiKey,
           notifications: [msg]

   // Send a push notification with message to named devices.
   // @param {[string]} devices - optional specify devices to push to, else all devices pushed to.
   // @param {object} extra  - optional extra data bundle (see pushwoosh API doc)
   broadcast: function (message, devices, extra) {

       var data = this._createNotification(message, devices, extra);
       return this._action('/json/1.3/createMessage', data);

The broadcast function takes three parameters

  • message is the content of the push notification
  • devices is an array of PushWoosh tokens to send to. If omitted, push will be sent to all devices registered on your PushWoosh account.
  • extra is an optional custom data bundle

When your mobile application or web based control panel calls KScript methods to update your application data, you can include( _push_ ) and call Push.broadcast() to send a push notification to all devices registered to receive push notifications on your PushWoosh account.

Push.broadcast('Hello World');

If you want to send a push notification to specific devices, then first you have to store PushWoosh device tokens in Kumulos. To get the PushWoosh device token, your application will need to:

  • Initialize PushWoosh SDK - this will return device token
  • Call a Kumulos API method to upload device token to Kumulos
  • Save this device token to a table in your Database


Now, when you want to send a push notification to specific devices, you can read the device tokens from the database and pass them into the broadcast function:

Push.broadcast('Hello World', [

If your data is not being updated by KScript methods and you wish to send push notifications when data is updated, a KScript method can be scheduled to run once per hour or day. This could then use the timeCreated and timeUpdated magic fields to determine if there have been any changes to your data since last run to warrant sending a push notification etc.

Further reading

A full reference guide to the PushWoosh API service can be found on the PushWoosh website