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')
}
This document describes the process of configuring and building the PlayFab Java SDK.
- Users should be very familiar with the topics covered in our getting started guide.
To connect to the PlayFab service, your machine must be running TLS v1.2 or better.
- For Windows, this means Windows 7 and above
- Official Microsoft Documentation
- Support for SSL/TLS protocols on Windows
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
The playfab API source code is located within one of the following:
- Client: https://github.com/PlayFab/JavaSDK/tree/master/PlayFabClientSDK/src/main/java/com/playfab
- Server: https://github.com/PlayFab/JavaSDK/tree/master/PlayFabServerSDK/src/main/java/com/playfab
- Combo: https://github.com/PlayFab/JavaSDK/tree/master/PlayFabSDK/src/main/java/com/playfab
The playfab API relies on the Google gson library. The dependency is described in each pom.xml file, Example:
- Client: https://github.com/PlayFab/JavaSDK/blob/master/PlayFabClientSDK/pom.xml#L48
- Server: https://github.com/PlayFab/JavaSDK/blob/master/PlayFabServerSDK/pom.xml#L48
- Combo: https://github.com/PlayFab/JavaSDK/blob/master/PlayFabSDK/pom.xml#L48
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.
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:
- https://github.com/PlayFab/SDKGenerator/blob/master/JenkinsConsoleUtility/testTitleData.md You must create a testTitleData.json file according to these instructions, and create an environment variable PF_TEST_TITLE_DATA_JSON which contains the absolute path to this file.
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
For a complete list of available APIs, check out the online documentation.
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
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
Apache License -- Version 2.0, January 2004 http://www.apache.org/licenses/
Full details available within the LICENSE file.