Skip to content

Interface: UpdatePayload

Payload for context.updateAsync. Defines the message to be sent to the context.

Table of contents

Properties

Properties

action

• Optional action: "CUSTOM"

Message format to be used.


cta

• Optional cta: string | LocalizableContent

Text of the call-to-action button.


data

• Optional data: Record<string, unknown>

Object passed to any session launched from this context message. Its size must be <=1000 chars when stringified. It can be accessed from Wortal.session.getEntryPointData().


image

• image: string

Data URL of base64 encoded image to be displayed. This is required for the payload to be sent.


media

• Optional media: MediaParams

Optional content for a gif or video. At least one image or media should be provided in order to render the update.

PLATFORM NOTE: Facebook only.


notifications

• Optional notifications: "NO_PUSH" | "PUSH"

Specifies notification setting for the custom update. This can be 'NO_PUSH' or 'PUSH', and defaults to 'NO_PUSH'. Use push notification only for updates that are high-signal and immediately actionable for the recipients. Also note that push notification is not always guaranteed, depending on user setting and platform policies.


strategy

• Optional strategy: "IMMEDIATE" | "LAST" | "IMMEDIATE_CLEAR"

Specifies how the update should be delivered. This can be one of the following:

  • 'IMMEDIATE' - The update should be posted immediately.
  • 'LAST' - The update should be posted when the game session ends. The most recent update sent using the 'LAST' strategy will be the one sent.
  • 'IMMEDIATE_CLEAR': will be sent immediately, and also discard any pending LAST payloads in the same session.

If no strategy is specified, we default to 'IMMEDIATE'.


template

• Optional template: string

ID of the template this custom update is using. Templates should be predefined in fbapp-config.json. See the Bundle Config documentation for documentation about fbapp-config.json.

PLATFORM NOTE: Facebook only.


text

• text: string | LocalizableContent

A text message, or an object with the default text as the value of 'default' and another object mapping locale keys to translations as the value of 'localizations'.