Class CustomUpdatePayload
Represents a custom update for Update
Inherited Members
Namespace: Meta.InstantGames
Assembly: Unity.Meta.InstantGames.Sdk.dll
Syntax
public class CustomUpdatePayload : JsObject
Constructors
CustomUpdatePayload(UpdateAction, string, LocalizableContent, LocalizableContent, string, string, UpdateStrategy?, UpdateNotification?)
Creates a new instance of CustomUpdatePayload
Declaration
public CustomUpdatePayload(UpdateAction action, string template, LocalizableContent text, LocalizableContent cta = null, string image = null, string data = null, UpdateStrategy? strategy = null, UpdateNotification? notification = null)
Parameters
Type | Name | Description |
---|---|---|
Update |
action | For custom updates, this should be 'CUSTOM'. |
string | template | ID of the template this custom update is using. Templates should be predefined in fbapp-config.json. See the [Bundle Config documentation] https://developers.facebook.com/docs/games/instant-games/bundle-config for documentation about fbapp-config.json. |
Localizable |
text | 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'. |
Localizable |
cta | Optional call-to-action button text. By default we will use a localized 'Play' as the button text. To provide localized versions of your own call to action, pass an object with the default cta as the value of 'default' and another object mapping locale keys to translations as the value of 'localizations'. |
string | image | Optional data URL of a base64 encoded image. |
string | data | A blob of data to attach to the update. All game sessions launched from the update will be able to access this blob through FBInstant.getEntryPointData(). Must be less than or equal to 1000 characters when stringified. |
Update |
strategy | 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. If no strategy is specified, we default to 'IMMEDIATE'. |
Update |
notification | 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. |
Properties
Action
For custom updates, this should be 'CUSTOM'.
Declaration
public UpdateAction Action { get; }
Property Value
Type | Description |
---|---|
Update |
Cta
Optional call-to-action button text. By default we will use a localized 'Play' as the button text. To provide localized versions of your own call to action, pass an object with the default cta as the value of 'default' and another object mapping locale keys to translations as the value of 'localizations'.
Declaration
public LocalizableContent Cta { get; }
Property Value
Type | Description |
---|---|
Localizable |
Data
A blob of data to attach to the update. All game sessions launched from the update will be able to access this blob through FBInstant.getEntryPointData(). Must be less than or equal to 1000 characters when stringified.
Declaration
public string Data { get; }
Property Value
Type | Description |
---|---|
string |
Image
Optional data URL of a base64 encoded image.
Declaration
public string Image { get; }
Property Value
Type | Description |
---|---|
string |
Notification
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.
Declaration
public UpdateNotification? Notification { get; }
Property Value
Type | Description |
---|---|
Update |
Strategy
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. If no strategy is specified, we default to 'IMMEDIATE'.
Declaration
public UpdateStrategy? Strategy { get; }
Property Value
Type | Description |
---|---|
Update |
Template
ID of the template this custom update is using. Templates should be predefined in fbapp-config.json. See the [Bundle Config documentation] https://developers.facebook.com/docs/games/instant-games/bundle-config for documentation about fbapp-config.json.
Declaration
public string Template { get; }
Property Value
Type | Description |
---|---|
string |
Text
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'.
Declaration
public LocalizableContent Text { get; }
Property Value
Type | Description |
---|---|
Localizable |