docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CustomUpdatePayload

    Represents a custom update for UpdateAsync(CustomUpdatePayload). Note that if localized content is not provided, a Facebook supplied localized string will be used for the call to action and text.The default string should always be in English.

    Inheritance
    object
    JsObject
    CustomUpdatePayload
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Meta.InstantGames.v7
    Assembly: Unity.Meta.InstantGames.Sdk.v7.dll
    Syntax
    public class CustomUpdatePayload : JsObject

    Constructors

    CustomUpdatePayload(UpdateAction, string, LocalizableContent, LocalizableContent, string, UpdateNotification?, string, UpdateStrategy?)

    Creates a new instance of CustomUpdatePayload

    Declaration
    public CustomUpdatePayload(UpdateAction action, string template, LocalizableContent text, LocalizableContent cta = null, string data = null, UpdateNotification? notification = null, string image = null, UpdateStrategy? strategy = null)
    Parameters
    Type Name Description
    UpdateAction 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.

    LocalizableContent 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'.

    LocalizableContent 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 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.

    UpdateNotification? 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.

    string image

    Optional data URL of a Base64-encoded image.

    UpdateStrategy? 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'.

    Properties

    Action

    For custom updates, this should be 'CUSTOM'.

    Declaration
    public UpdateAction Action { get; }
    Property Value
    Type Description
    UpdateAction

    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
    LocalizableContent

    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
    UpdateNotification?

    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
    UpdateStrategy?

    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
    LocalizableContent
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)