Class InvitePayload
Represents content to be shared in invitations sent by the user.
Inherited Members
Namespace: Meta.InstantGames
Assembly: Unity.Meta.InstantGames.Sdk.dll
Syntax
public class InvitePayload : JsObject
Constructors
InvitePayload()
Construct an instance of InvitePayload
Declaration
public InvitePayload()
InvitePayload(LocalizableContent, string, LocalizableContent, LocalizableContent, string, InviteFilter[], InviteSection[])
Creates a new instance of InvitePayload
Declaration
public InvitePayload(LocalizableContent text, string image, LocalizableContent cta = null, LocalizableContent dialogTitle = null, string data = null, InviteFilter[] filters = null, InviteSection[] sections = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LocalizableContent | text | An object with the default text as the value of |
| string | image | A base64-encoded image to be shared. |
| LocalizableContent | cta | Optional call-to-action button text. By default uses a localized version of Play as the button text. To provide localized versions of your own call to action, pass an object with the default call to action as the value of |
| LocalizableContent | dialogTitle | An optional title to display at the top of the invite dialog instead of the generic title. This param is not sent as part of the message, but only displays in the dialog header. The value must be an object with the default text as the value of |
| string | data | An optional blob of data to attach to the update, serialized as a JSON string. This string must represent a JSON object such as |
| InviteFilter[] | filters | The set of filters to apply to the suggestions. You can apply multiple filters. If no results return when the filters are applied, the results are generated without the filters. |
| InviteSection[] | sections | The set of sections to be included in the dialog. Each section can be assigned a maximum number of results to be returned (up to a maximum of 10). If no max is included, a default max is applied. Sections are included in the order they're listed in the array. |
Properties
Cta
Optional call-to-action button text. By default uses a localized version of Play as the button text. To provide localized versions of your own call to action, pass an object with the default call to action as the value of default and another object that maps locale keys to translations as the value of localizations.
Declaration
public LocalizableContent Cta { get; }
Property Value
| Type | Description |
|---|---|
| LocalizableContent |
Data
An optional blob of data to attach to the update, serialized as a JSON string. This string must represent a JSON object such as {"key": "value"}. All game sessions launched from the share can access this blob through GetEntryPointData().
Declaration
public string Data { get; }
Property Value
| Type | Description |
|---|---|
| string |
DialogTitle
An optional title to display at the top of the invite dialog instead of the generic title. This param is not sent as part of the message, but only displays in the dialog header. The value must be an object with the default text as the value of default and another object mapping locale keys to translations as the value of localizations.
Declaration
public LocalizableContent DialogTitle { get; }
Property Value
| Type | Description |
|---|---|
| LocalizableContent |
Filters
The set of filters to apply to the suggestions. You can apply multiple filters. If no results return when the filters are applied, the results are generated without the filters.
Declaration
public InviteFilter[] Filters { get; }
Property Value
| Type | Description |
|---|---|
| InviteFilter[] |
Image
A base64-encoded image to be shared.
Declaration
public string Image { get; }
Property Value
| Type | Description |
|---|---|
| string |
Sections
The set of sections to be included in the dialog. Each section can be assigned a maximum number of results to be returned (up to a maximum of 10). If no max is included, a default max is applied. Sections are included in the order they're listed in the array. maxResults is disregarded for the last section, which will contain as many results as possible. If this array is left empty, default sections are used.
Declaration
public InviteSection[] Sections { get; }
Property Value
| Type | Description |
|---|---|
| InviteSection[] |
Text
An object with the default text as the value of default and another object that maps locale keys to translations as the value of localizations.
Declaration
public LocalizableContent Text { get; }
Property Value
| Type | Description |
|---|---|
| LocalizableContent |