Skip to content

PlayFab/JavaSDK

Repository files navigation

Java SDK for PlayFab README

0. Install via Maven or Gradle:

Note: The PlayFab SDK Maven package is out of date. We are working to update to the latest. For now, to get the latest Java SDK for your game, you will need to clone this repo and build from source.

Check the Public Artifact Repository for latest versions of our SDKs.
When using Maven, use the following snippet as part of your dependencies set:
(Use client-sdk or server-sdk or combo-sdk as ARTIFACT)

<dependency>
    <groupId>com.playfab</groupId>
    <artifactId>ARTIFACT</artifactId>
    <version>VERSION</version>
</dependency>

When using Gradle, make sure Maven Central Repository is linked:

repositories {
    mavenCentral()
}

Use the following snippet to add client-sdk or server-sdk or combo-sdk to your dependencies set:

dependencies {
    compile('com.playfab.client-sdk:VERSION')
    compile('com.playfab.server-sdk:VERSION')
    compile('com.playfab.combo-sdk:VERSION')
}

1. Overview:

This document describes the process of configuring and building the PlayFab Java SDK.

2. Prerequisites:

To connect to the PlayFab service, your machine must be running TLS v1.2 or better.

3. Source Code & Key Repository Components:

This package contains three different versions of the PlayFab SDK.

  • PlayFabClientSDK - This version contains only client libraries and is designed for integration with your game client
  • PlayFabServerSDK - Contains server and admin APIs designed to be called from your custom logic server or build process
  • PlayFabSDK - Contains all APIs in one SDK.
  • AndroidStudioExample - Client-only integration of PlayFabSDK into an AndroidStudio example project

4. Installation & Configuration Instructions:

The playfab API source code is located within one of the following:

The playfab API relies on the Google gson library. The dependency is described in each pom.xml file, Example:

PlayFab does not submit this SDK to the Maven Central repository. For now, you must copy/paste the appropriate /src/main/java/com/playfab/ subfolder from one of the root folders (PlayFabClientSDK, PlayFabSDK, PlayFabSDK), and paste it into your project. We hope to improve this later, but there is no ETA for completion.

5. testTitleData.json file required for example test files:

This sdk includes an optional example project that is used by PlayFab to verify sdk features are fully functional.

Please read about the testTitleData.json format, and purpose here:

Building and testing with Maven:

The Example PlayFabApiTests can be run from the console. These instructions assume Windows operating system.

  • Install Apache Maven
  • Extract the JavaSDK Sdk to your computer (referenced as {JavaSDK-Location} within this document)
  • Navigate to: {JavaSDK-Location}/PlayFabSDK
  • Open a command prompt, and enter "mvn site verify"
    • This will build the project, execute tests, build documentation, and verify the package

6. Troubleshooting:

For a complete list of available APIs, check out the online documentation.

Contact Us

We love to hear from our developer community! Do you have ideas on how we can make our products and services better?

Our Developer Success Team can assist with answering any questions as well as process any feedback you have about PlayFab services.

Forums, Support and Knowledge Base

7. Acknowlegements

The PlayFab Java SDK was initially created and submitted to PlayFab by nicosio2

The PlayFab Java SDK has been restructured for Maven support by Will Iverson at Game Studio One

8. Copyright and Licensing Information:

Apache License -- Version 2.0, January 2004 http://www.apache.org/licenses/

Full details available within the LICENSE file.