This category also includes data for players that spans multiple games. PlayFab stores data as Key/Value Pairs (KVPs).
- Use the server APIs SetPublisherData to update, and GetPublisherData to retrieve, Publisher-specific custom KVPs.
- Use UpdateUserPublisherData to create or update, and GetUserPublisherData to retrieve, Publisher-specific custom KVPs for the player.
- Use the server API UpdateUserPublisherReadOnlyData to update, and the client API GetUserPublisherReadOnlyData to retrieve, the read-only Publisher-specific custom KVPs for the user.
- Use the server APIs UpdateUserPublisherInternalData to update, and GetUserPublisherInternalData to retrieve, the internal Publisher-specific custom KVPs for the user.
Publisher data is best suited for global constant/static data and isn’t suitable or reliable as global variables.
Publisher data
Publisher data is used to store static data for the titles in a namespace. Each entry isn’t bound to a player entity (as opposed to user publisher data).Setting Publisher data
The following snippet demonstrates how to set Publisher data using the Server API.There is an admin API counterpart for this operation.
Getting Publisher data
The following snippet demonstrates getting Publisher data using the Client API.There are server and admin API counterparts for this operation.
User Publisher data
User Publisher data can be used to introduce Publisher data that is bound to a PlayFab user (player). Unlike regular Publisher data, it is possible for a Client application to alter user Publisher data. PlayFab exposes 3 protection levels for user Publisher data from the Client API point of view:-
Regular user Publisher data exposes read and write access for client applications.
- Set via Client, Server, and Admin API.
- Get via Client, Server, and Admin API.
- The Client API may only set Publisher data for a player who is currently logged in.
-
Read-only user Publisher data exposes read access for client applications.
- Set via Server and Admin API.
- Get via Client, Server, and Admin API.
-
Internal user Publisher data exposes no access for client applications, and is used to store the secret portion of user data.
- Set via Server and Admin API.
- Get via Server and Admin API.
