Interface: ContextPayload
Payload for various function calls in the context API.
Table of contents
Properties
- action
- caption
- cta
- data
- description
- filters
- hoursSinceInvitation
- image
- intent
- maxSize
- minShare
- minSize
- notifications
- strategy
- template
- text
- ui
Types
Properties
action
• Optional
action: "CUSTOM"
Not used
caption
• Optional
caption: string
| LocalizableContent
Text of the call-to-action button.
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.context.getEntryPointData()
.
description
• Optional
description: string
| LocalizableContent
Optional customizable text field in the share UI. This can be used to describe the incentive a user can get from sharing.
filters
• Optional
filters: [ContextFilter]
An array of filters to be applied to the friend list. Only the first filter is currently used.
hoursSinceInvitation
• Optional
hoursSinceInvitation: number
Specify how long a friend should be filtered out after the current player sends them a message.
This parameter only applies when NEW_INVITATIONS_ONLY
filter is used.
When not specified, it will filter out any friend who has been sent a message.
image
• image: string
URL of base64 encoded image to be displayed. This is required for the payload to be sent.
intent
• Optional
intent: "INVITE"
| "REQUEST"
| "CHALLENGE"
| "SHARE"
Message format to be used. There's no visible difference among the available options.
maxSize
• Optional
maxSize: number
Context maximum size.
minShare
• Optional
minShare: number
Defines the minimum number of players to be selected to start sharing.
minSize
• Optional
minSize: number
Context minimum size.
notifications
• Optional
notifications: "NO_PUSH"
| "PUSH"
Specifies if the message should trigger push notification.
strategy
• Optional
strategy: "IMMEDIATE"
| "LAST"
| "IMMEDIATE_CLEAR"
Defines how the update message should be delivered.
'IMMEDIATE': will be sent immediately.
'LAST': when the game session ends, the latest payload will be sent.
'IMMEDIATE_CLEAR': will be sent immediately, and also discard any pending LAST
payloads in the same session.
template
• Optional
template: string
Not used
text
• text: string
| LocalizableContent
Message body. This is required for the payload to be sent.
ui
• Optional
ui: "DEFAULT"
| "MULTIPLE"
Optional property to switch share UI mode. DEFAULT: Serial contact card with share and skip button. MULTIPLE: Selectable contact list.
ContextFilter
ContextFilter: "NEW_CONTEXT_ONLY"
| "INCLUDE_EXISTING_CHALLENGES"
| "NEW_PLAYERS_ONLY"
| "NEW_INVITATIONS_ONLY"
Defines the filtering behavior
NEW_CONTEXT_ONLY
only enlists contexts that the current player is in, but never participated in (e.g. a new context created by a friend).INCLUDE_EXISTING_CHALLENGES
enlists contexts that the current player has participated before.NEW_PLAYERS_ONLY
only enlists friends who haven't played this game before.NEW_INVITATIONS_ONLY
only enlists friends who haven't been sent an in-game message before. This filter can be fine-tuned withhoursSinceInvitation
parameter.