Skip to main content
A banner is a short text message Flatpeak places in your app: an offer from a supplier or a VPP operator, or a notice about the user’s tariff. You build the placeholder, and Flatpeak decides what it shows.
A banner: a bolt icon, one line of text and a chevron

Build the placeholder

  1. When your app starts, create a Connect session for the device and pass its ID to the app. Create another when it expires or after a tap.
  2. Add a placeholder to any screen. It takes no space when empty.
  3. When the screen opens, call the banner route with the session ID. Pass placement, the kind of screen: HOME, DEVICE, SCHEDULE, INSIGHTS, SETTINGS or OTHER.
  4. If banner is null, show nothing; otherwise show it.

Render

Handle the tap

A banner is tappable when actions lists CLICK.
  1. Send the CLICK action with the banner ID and the placement it was tapped in.
  2. Connect answers with a route. On session_redirect, send the user to redirect_url. On any other route, render that Connect page.
  3. Create a new session for the next banner request.

Dismiss

When the user closes a banner, send the DISMISS action. Flatpeak stops returning it for the device.