Phaser API Documentation

update(cta, text, key, frame, template, updateData)


Informs Facebook of a custom update that occurred in the game. This will temporarily yield control to Facebook and Facebook will decide what to do based on what the update is. Once Facebook returns control to the game the plugin will emit an update or updatefail event.

It makes an async call to the API, so the result isn't available immediately.

The text parameter is an update payload with the following structure:

text: {
    default: 'X just invaded Y\'s village!',
    localizations: {
        ar_AR: 'X \u0641\u0642\u0637 \u063A\u0632\u062A ' +
        '\u0642\u0631\u064A\u0629 Y!',
        en_US: 'X just invaded Y\'s village!',
        es_LA: '\u00A1X acaba de invadir el pueblo de Y!',


name type description
cta string

The call to action text.

text object

The text object.

key string

The key of the texture to use as the share image.

frame string | integer

The frame of the texture to use as the share image. Set to null if you don't require a frame, but do need to set session data.

template string

The update template key.

updateData object

The update data object payload.


This Facebook Instant Games Plugin instance.

Since: 3.13.0