Phaser API Documentation

  Version: 
saveData(data)

Description:

Set data to be saved to the designated cloud storage of the current player. The game can store up to 1MB of data for each unique player.

The data save is requested in an async call, so the result isn't available immediately.

Data managed via this plugins Data Manager instance is automatically synced with Facebook. However, you can call this method directly if you need to replace the data object directly.

When the APIs setDataAsync call resolves it will emit the savedata event from this plugin. If the call fails for some reason it will emit savedatafail instead.

The call resolving does not necessarily mean that the input has already been persisted. Rather, it means that the data was valid and has been scheduled to be saved. It also guarantees that all values that were set are now available in getData.

Parameters:

name type description
data object

An object containing a set of key-value pairs that should be persisted to cloud storage. The object must contain only serializable values - any non-serializable values will cause the entire modification to be rejected.

Returns:
Description:

This Facebook Instant Games Plugin instance.

Examples:
Since: 3.13.0