Banner

Overview


A banner is a fullscreen creation presented when the app is active. When the app is in the background or destroyed, a simple push appears instead.
It is not always suitable for you to display every incoming banner, because the application may be in a state where you don’t want to interrupt the customer, so you can control its behavior.

The banner campaign can have different layouts:

  • color_as_background
  • image_as_background
  • image_with_text_atop
  • image_with_text_below

Configuration


Banner campaign is served by push notifications. See:

Additionally, check possible available configuration options in the Settings.

Handling actions from banners


Handling main actions from campaigns depends on the campaign type and operating system and it is described here.

Controlling behavior and actions


You may control incoming banner campaigns and decide whether to show them. By default, the SDK allows banner display.

You can also be notified (in the form of events) about the campaign actions in the following cases:

  • When the banner is successfully created and presented to the customer.
  • When the banner disappeared.

You can handle it using:

See the following code samples:

public static OnBannerListener NULL = new OnBannerListener() {
  // This method is called after a banner is loaded and Synerise SDK asks for permission to show it.
  @Override
  public boolean shouldPresent(TemplateBanner banner) {
    return true;
  }

  // This method is called after a banner appears.
  @Override
    public void onPresented() {
    //...
  }

  // This method is called after a banner disappears.
  @Override
  public void onClosed() {
    //...
  }
};

Payload



{
  "data": {
    "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.google.pl",
        "text_color": "#384350",
        "corner_radius": 5
      },
      "close_button": {
        "is_enabled": true,
        "alignment": "right"
      },
      "action": {
        "type": "OPEN_URL",
        "item": "http://www.google.pl"
      }
    }
    }
  }
}

Example


This is a banner campaign example with a background image.

Banner example
Banner campaign (Android)
Banner campaign
Banner campaign (iOS)

Triggers


Note: This feature is available only in versions: lower than 4.6.0 (iOS SDK) and lower than 4.7.0 (Android SDK).

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

Banners are fetched during the SDK initialization and while the application is running, these banners are searched for campaign triggers - it should have an identical value as the label of the tracked event.

😕

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.

Close modal icon Placeholder alt for modal to satisfy link checker