PlayFab API

The PlayFab API Module holds the JavaScript SDK for the PlayFab Service. It is a requirement to run any plugin in the PlayFab Master Collection.

With this addon, the PlayFab SDK is integrated into your game application. You can then start calling PlayFab methods or use the collection addons to do that for you.

It is required to include this addon to your project before using other PlayFab Master Collection addons. Otherwise, the other addons won't work without the PlayFab SDK integrated into the game application.

 

Intstructions

1. The first step is to add the PlayFab API addon into the project.

2. The next step is to go to the Properties Bar while the PlayFab API object is selected. 

This will show the Title ID property where you will input the value from your PlayFab Console.

The Title ID is found on the PlayFab Console. Make sure to have already made your Studio and Title (Application).

3. Finally, set the other plugin properties. 

  • Debug Mode - allows the PlayFab Master Collection to make logs of the response JSON data from the PlayFab Servers. This is very important when it comes to debugging received server data. The logs are accessible through the Developer Console, which is launched by pressing (F12) during preview.

  • Client Profile Data - are additional data you want included in the response callback from the PlayFab Servers. This is only ran when the server allows that type of response for the command.

  • Client Sensitive Data - are additional sensitive data you want included in the response callback from the PlayFab Servers. This is only ran when the server allows that type of response for the command. Compared to the Client Profile Data, these server responses are sensitive, therefore should be taken precaution before allowing to be received by the client.

Actions, Conditions & Expressions

Actions

Actions.png
  • Logout - Forget all credentials and any previous authentications are logged out.

  • Set Title ID - Set the Unique identifier for the Application Title.

    • This is found on your PlayFab Console.

    • You can set this on the Properties Bar.

  • Call API Method - Call a Client API method from PlayFab.

    • Method - The method key from the PlayFab Client API documentation.

    • Data JSON - The request data to pass with the api method call, in JSON string.

    • Custom Data JSON - The custom data to pass with the api request, in JSON string.

Conditions

  • Is Logged In - Condition to check if the current user has authenticated to enable user-based PlayFab API features.

  • Is Initialized - Condition to check if the API is already loaded and available.

    • To be safe, check this initially when the application first starts before starting the PlayFab service.​

    • You only have to check for this once, usually when your application starts.

  • On Call API Response - Trigger fires if a Call API Method succeeded with a response from the PlayFab server.

  • On Call API Error - Trigger fires if a Call API Method received an error from the PlayFab server.

Conditions.png

Expressions

Expressions.png
  • GetTitleID- Return the TitleID declared into the plugin.

  • Response- Return the response data from the recent On Call API Response or On Call API Error, in JSON string.

Properties

Properties.png

​Configuration:

- The setup for the plugin while running. 

  • Title ID - Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected.

  • Debug Mode - If Enabled, the runtime will log errors across all plugin modules. This should be Disabled on production.

 Client Profile Data: 

- Additional Profile Data to be included for each request. Match with the PlayFab Console > Client Profile Options.

  • Avatar URL - Whether to show player's avatar URL.

  • Banned until Time - Whether to show the banned until time.

  • Campaign Attributions - Whether to show campaign attributions.

  • Creation Date - Whether to show the created date.

  • Last Login Time - Whether to show the last login time.

  • Locations - Whether to show player's locations.

  • Origination - Whether to show origination.

  • Statistics - Reserved for future development.

  • Tags - Whether to show tags.

  • Values to Date in USD - Whether to show the total value to date in usd.

  • Values to Date - Whether to show the values to date.

 Client Sensitive Data: 

- Additional Sensitive Profile Data to be included in each request. Match with the PlayFab Console > Client Sensitive Profile Options

  • Linked Accounts - Whether to show the linked accounts.

  • Push Notification - Whether to show push notification registrations.

  • Contact Email Address - Whether to show contact email addresses.

 
 

Game Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information:

Construct 3 Project