PlayPortalAppDataClient

This class is responsible for handling a user's private app data.
public sealed class PlayPortalAppDataClient

Each playPORTAL user has a private app data storage per third-party app. This data is only accessible by the user, and in the case of children, by their parents.

Properties

public static readonly PlayPortalAppDataClient Instance;

Singleton instance of PlayPortalAppDataClient. You will access all the available PlayPortalAppDataClient methods through this instance.

Methods

GetPrivateAppData

public void GetPrivateAppData<TResult>(Action<Exception, TResult> completion, string userId = null) where TResult : class

Request the currently authenticated user's private app data, or in the case of a parent, one of their children's app data, where the child is specified by passing their profile id as the userId argument.

Parameter

Type

Description

completion

Action<Exception, TResult>

The delegate invoked when the request finishes. Called with an Exception argument for a failed request; otherwise, called with an instance of TResult representing the private app data structure.

userId

string

Optional argument; defaults to null. Used to request a child's private app data by their parent.

UpdatePrivateAppData

public void UpdatePrivateAppData<TValue, TResult>(string key, TValue value, Action<Exception, TResult> completion, string userId = null) where TValue : class where TResult : class

Update the currently authenticated user's private app data, or in the case of a parent, one of their children's app data, where the child is specified by passing their profile id as the userId argument.

Parameter

Type

Description

key

string

Location in app data to update, using dot object notation.

value

TValue

Value to insert or update at the location specified by the key parameter. This can be any valid JSON data.

completion

Action<Exception, TResult>

The delegate invoked when the request finishes. Called with an Exception argument for a failed request; otherwise, called with an instance of TResult representing the updated private app data.

userId

string

Optional argument; defaults to null. Used to update a child's private app data by their parent.