Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Opening a widget inside the Flock client
  • Opening a URL in the system browser;
  • Sending an event to the event listener URL.

Opening a Widget

Apps You can use widgets to render web applications inside an iframe or a webview within Flock. They can not only do everything that a normal webapp can, but also interact with the Flock client hosting them.

...

  • URL of the widget
  • Type of widget in desktop – it can be either modal or sidebar
  • Type of widget in mobile – this is usually optional. The only acceptable value is modal.

Opening the Browser

Apps You can also choose to open a URL in the browser too. To open the browser, provide the following:

...

Sending an event to the event listener URL

Apps can also choose to silently Or if you prefer to remain silent, you can send an event to the event listener URL.

What happens when a client action is triggered?

An event is generated every time a client action is triggered.

The events sent by various controls when a client action is triggered are listed below:

The event name along with its attribute provides sufficient context for the client action.

How do I configure a client action?

...

Use the developer dashboard to configure an action for a Slash CommandLauncher ButtonChat Tab Button or Attachment Picker. Once you have enabled the control, you can select the appropriate action and provide any additional info that's required.

Opening a Widget

Attachment Buttons

Client actions for attachment buttons are configured while creating the corresponding Attachment. Use the action property of a button to set the appropriate ActionConfig object.

Code Block
languagejs
titleConfiguring Actions in Attachment Buttons
linenumberstrue
{
    "description": "attachment description",
    "views": {
        "widget": { "src": "<widget url>", "width": 400, "height": 400 }
    },
    "buttons": [{
        "name": "<button 1>",
        "icon": "<icon 1 url>", 
        "action": { "type": "openWidget", "desktopType": "modal", "mobileType": "modal", "url": "<action url>" },
        "id": "<button id 1>"
    }, {
        "name": "<button 2>", 
        "icon": "<icon 2 url>", 
        "action": { "type": "openBrowser", "url": "<url>", "sendContext": true }
        "id": "<button id 2>"
    }]
}

...

Code Block
languagexml
titleSending event to the event listener using FlockML
<flockml>client <action type="sendToAppServicesendEvent">here</action> to send an event to the event listener URL.</action>

What happens when a client action is triggered?

An event is generated every time a client action is triggered.

The events sent by various controls when a client action is triggered are listed below:

...

The event name along with its attribute provides sufficient context for the client action.

Can client actions be triggered for users who haven't installed the app?

...