Simple IAP System  5.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Events | List of all members
PlayFabManager

Manager integrating PlayFab's ClientModels for handling all related web requests, such as logging in and syncing Simple IAP System storage (purchases, player data, currency) with PlayFab. More...

Inheritance diagram for PlayFabManager:

Public Member Functions

PlayFab.ClientModels.LoginResult GetLoginResult ()
 Return raw LoginResult data from PlayFab. Can be null if not logged in yet. More...
 
void LoginWithDevice (Action< bool > resultCallback=null)
 Logs in with the user device id, using the correct PlayFab method per platform. A new account will be created when no account is associated with the device id. More...
 
void LoginWithFacebook ()
 Login within an app on Facebook Canvas or Gameroom by using its current access token. More...
 
void LoginWithSteam ()
 
void AddItemInstanceID (string productID, string instanceID)
 Theoretically there should only be one ItemInstanceID per item at any time. More...
 

Static Public Member Functions

static PlayFabManager GetInstance ()
 Returns a static reference to this script. More...
 
static void RedeemCoupon (string code)
 
static IEnumerator SetPurchase (List< string > productIDs)
 Grant non-consumables to the user's inventory on PlayFab, for free. As this is a security risk you should have some server validations in place. Consumables will be granted only locally to minimize requests - please call SetFunds or SetPlayerData afterwards if needed. More...
 
static void SetPlayerData ()
 Uploads local player data to PlayFab. Call this after manipulating player data manually, e.g. via DBManager.IncreasePlayerData. Note that this method is called automatically for syncing consumable usage counts on product purchases. More...
 
static void SetFunds ()
 Uploads local currency balance to PlayFab. Call this after giving currency manually, e.g. via DBManager.IncreaseFunds. Note that the virtual currency balance is synced automatically with PlayFab on product purchases. More...
 
static void SetSelected ()
 Uploads local item selection states to PlayFab. Call this after manual selections, e.g. via DBManager.SetSelected. Note that selection states are synced automatically when selecting or deseleting items in the shop. More...
 
static void RegisterAccount (string emailAddress, string password)
 Register a new account by using the email address and password provided. More...
 
static void LoginWithEmail (string emailAddress, string password)
 Login via email by using the email address and password provided. More...
 
static void ForgotPassword (string emailAddress)
 Request an account recovery email (new password) to the email passed in. More...
 
static bool IsValidationOnly ()
 
static void Logout ()
 

Public Attributes

bool validationOnly = false
 

Static Public Attributes

static string userId
 PlayFab account id of the user logged in. More...
 

Protected Attributes

Callback< GetAuthSessionTicketResponse_t > authTicketResponse
 

Events

static Action< PlayFab.ClientModels.LoginResult > loginSucceededEvent
 Fired when the user successfully logged in to a PlayFab account. More...
 
static Action< string > loginFailedEvent
 Fired when logging in fails due to authentication or other issues. More...
 

Detailed Description

Manager integrating PlayFab's ClientModels for handling all related web requests, such as logging in and syncing Simple IAP System storage (purchases, player data, currency) with PlayFab.

Member Function Documentation

void AddItemInstanceID ( string  productID,
string  instanceID 
)

Theoretically there should only be one ItemInstanceID per item at any time.

static void ForgotPassword ( string  emailAddress)
static

Request an account recovery email (new password) to the email passed in.

static PlayFabManager GetInstance ( )
static

Returns a static reference to this script.

PlayFab.ClientModels.LoginResult GetLoginResult ( )

Return raw LoginResult data from PlayFab. Can be null if not logged in yet.

Returns
static bool IsValidationOnly ( )
static

void LoginWithDevice ( Action< bool >  resultCallback = null)

Logs in with the user device id, using the correct PlayFab method per platform. A new account will be created when no account is associated with the device id.

static void LoginWithEmail ( string  emailAddress,
string  password 
)
static

Login via email by using the email address and password provided.

void LoginWithFacebook ( )

Login within an app on Facebook Canvas or Gameroom by using its current access token.

void LoginWithSteam ( )
static void Logout ( )
static
static void RedeemCoupon ( string  code)
static
static void RegisterAccount ( string  emailAddress,
string  password 
)
static

Register a new account by using the email address and password provided.

static void SetFunds ( )
static

Uploads local currency balance to PlayFab. Call this after giving currency manually, e.g. via DBManager.IncreaseFunds. Note that the virtual currency balance is synced automatically with PlayFab on product purchases.

static void SetPlayerData ( )
static

Uploads local player data to PlayFab. Call this after manipulating player data manually, e.g. via DBManager.IncreasePlayerData. Note that this method is called automatically for syncing consumable usage counts on product purchases.

static IEnumerator SetPurchase ( List< string >  productIDs)
static

Grant non-consumables to the user's inventory on PlayFab, for free. As this is a security risk you should have some server validations in place. Consumables will be granted only locally to minimize requests - please call SetFunds or SetPlayerData afterwards if needed.

static void SetSelected ( )
static

Uploads local item selection states to PlayFab. Call this after manual selections, e.g. via DBManager.SetSelected. Note that selection states are synced automatically when selecting or deseleting items in the shop.

Member Data Documentation

Callback<GetAuthSessionTicketResponse_t> authTicketResponse
protected
string userId
static

PlayFab account id of the user logged in.

bool validationOnly = false

Event Documentation

Action<string> loginFailedEvent
static

Fired when logging in fails due to authentication or other issues.

Action<PlayFab.ClientModels.LoginResult> loginSucceededEvent
static

Fired when the user successfully logged in to a PlayFab account.


The documentation for this class was generated from the following file: