
Build the placeholder
- 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.
- Add a placeholder to any screen. It takes no space when empty.
- When the screen opens, call the banner route with the session ID. Pass
placement, the kind of screen:HOME,DEVICE,SCHEDULE,INSIGHTS,SETTINGSorOTHER. - If
bannerisnull, show nothing; otherwise show it.
Render
Handle the tap
A banner is tappable whenactions lists CLICK.
- Send the
CLICKaction with the banner ID and theplacementit was tapped in. - Connect answers with a route. On
session_redirect, send the user toredirect_url. On any other route, render that Connect page. - Create a new session for the next banner request.
Dismiss
When the user closes a banner, send theDISMISS action. Flatpeak stops returning it for the device.
