Campaigns

Simple Push


Simple Push Campaigns are served by Push Notifications. Before you can start using this feature, you must configure it. For more details, check the Push Notifications section.

Incoming push payload

{
  "aps": {
    "alert": {
      "title": "Your Simple Push Campaign title",
      "body": "Your Simple Push Campaign body"
    },
  "sound": "default",
  "badge": "1",
  "category": "CATEGORY"
  },
  "issuer": "Synerise",
  "message-type": "dynamic-content",
  "content-type": "simple-push",
  "content": {
    "campaign": {
      "variant_id": 1,
      "hash_id": "HASH",
      "type": "CAMPAIGN_TYPE",
      "title": "CAMPAIGN_TITLE"
    },
  "notification": {
    "action": {
      "type": "OPEN_APP"
    }
  },
  "buttons": [
    {
      "identifier": "button1",
      "text": "OPEN_URL",
      "action": {
        "type": "OPEN_URL",
        "item": "www.example.com"
      }
    },
    {
      "identifier": "button2",
      "text": "DEEP_LINKING",
      "action": {
        "type": "DEEP_LINKING",
        "item": "syne://product?sku=1"
      }
    },
    {
      "identifier": "button3",
      "text": "OPEN_APP",
      "action": {
        "type": "OPEN_APP"
      }
    }
  ]
  }
}

Silent Push


Silent Push Campaigns are served by Push Notifications. Before you can start using this feature, you must configure it. For more details, check the Push Notifications section.

Silent Push is a Silent Push Notification that you can send from app.synerise.com.


Banner Campaigns are served by Push Notifications. Before you can start using this feature, you must configure it. For more details, check the Push Notifications section.

Banners cover the entire screen and appear immediately.

It is not always suitable for you to show every incoming banner. The application may be in a state in which you don’t want to cover the customer’s screen.

You can control incoming banners by implementing optional methods in Injector Listener.

Incoming push payload

Banners can have different layouts, currently:

  • COLOR AS BACKGROUND
  • IMAGE AS BACKGROUND
  • IMAGE WITH TEXT ATOP
  • IMAGE WITH TEXT BELOW

Example payload of banner with the COLOR AS BACKGROUND layout:

{
  "aps": {
    "content-available": 1
  },
  "issuer": "Synerise",
  "message-type": "dynamic-content",
  "content-type": "template-banner",
  "content": {
    "campaign": {
      "variant_id": 1,
      "hash_id": "id1",
      "type": "CAMPAIGN_TYPE",
      "title": "CAMPAIGN_TITLE"
    },
    "page": {
      "index": 0,
      "type": "color_as_background",
      "background": {
        "color": "#ffffff",
        "alpha": 1
      },
      "header": {
        "text": "\n{ guard let }",
        "color": "#000000",
        "alpha": 1,
        "size": 65
      },
      "description": {
        "text": "\n\n#ios\n#development\n#videos\n#blog",
        "color": "#555555",
        "alpha": 1,
        "size": 30
      },
      "button": {
        "is_enabled": false,
        "color": "#f9fafb",
        "text": "URL: www.example.com",
        "text_color": "#384350",
        "corner_radius": 5
      },
      "close_button": {
        "is_enabled": true,
        "alignment": "right"
      },
      "action": {
        "type": "OPEN_URL",
        "item": "www.example.com"
      }
    }
  }
}

Triggers

In order to show a banner immediately after a certain event occurs, you can send your banners from app.synerise.com with a TRIGGER value.

Banners are fetched during SDK initialization and when the application is running, these banners are being searched for eventual campaign triggers.

Mandatory Upgrade


Mandatory Upgrade is a Banner without a “close” button. The only action available to the customer is being redirected to a website or the AppStore and installing a new version of the application.

Handling actions from campaigns


Note: The Injector Listener defines optional methods for handling actions from the whole SDK, but it can be used for handling campaign interactions. The description below is an implementation of these methods.

Synerise SDK handles two main actions that a customer may invoke:

  • OPEN_URL
  • DEEPLINKING

Important - If you don’t configure a custom action for OPEN_URL, the SDK opens the default browser with the requested URL address.

Example

Synerise.Injector.setListener({
  onOpenUrl: function(url) {
    //url implementation
    Linking.openURL(url);
  },
  onDeepLink: function(deepLink) {
    //your custom deeplinking implementation
  }
  //...
  //other listener's methods
});

Other features


Own implementation for campaigns

You can also react to Synerise push notifications by yourself and that is why we would like to share our Synerise Simple Push and Synerise Banner payload (see corresponding sections above).

You may need to know whether incoming push message comes from Synerise.

Synerise.Notifications.isSyneriseNotification(payload) - checks whether provided push data comes from Synerise. It is validated by checking if incoming push contains “issuer” key with “Synerise” value.

Synerise.Notifications.setListener({
  onNotification: function(payload) {
    if (Synerise.Notifications.isSyneriseNotification(payload)) {
      // default implementation by Synerise SDK
      // Synerise.handleNotification(userInfo)
      // or
      // your own implementation
    } else {
      //...
    }
  }
  //...
  //other listener's methods
});
😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.