Skip to main content

Android

This article guides you through setting up Ubisoft as an identity provider, enabling your Android game to access Player Network authentication services.

Prerequisites

1. Set up the Ubisoft app

Contact Ubisoft for the following app configuration parameters.

  1. App ID
  2. GENOME ID
  3. Game SKU
  4. Login Landing Page URL
  1. Create an account for Player Network Console.
  2. Create a new project for your game, or join an existing one.
  3. Download the SDK.
  4. Integrate the SDK.
  5. Add Ubisoft as an authentication method for your project on Player Network Console.

Step 1: Configure the SDK

caution

JDK:JDK8+
AndroidSdk:Android11.0(API30)
OS:Android 5.0, API 21 or higher supported
Gradle Version:5.64+
Android Grable Plugin Version:3.6.1+

Open the project's INTLConfig.ini:

[Ubisoft]
UBI_APP_ID_ANDROID = {INTL_UBI_APP_ID_ANDROID}
UBI_GENOME_ID_ANDROID = {INTL_UBI_GENOME_ID_ANDROID}
UBI_APP_BUILDID_ANDROID = {INTL_UBI_APP_BUILDID_ANDROID}
UBI_GAME_VERSION_ANDROID = {INTL_UBI_GAME_VERSION_ANDROID}
UBI_SKU = {INTL_UBI_SKU}
UBI_WEB_AUTH_URL = {INTL_UBI_WEB_AUTH_URL}
  • Replace {INTL_UBI_APP_ID_ANDROID} with the Android app ID provided by Ubisoft.
  • Replace {INTL_UBI_GENOME_ID_ANDROID} with the Android GENOME ID provided by Ubisoft.
  • Replace {INTL_UBI_APP_BUILDID_ANDROID} with the detailed Android version number of the game.
  • Replace {INTL_UBI_GAME_VERSION_ANDROID} with the custom version type of the game, such as Alpha, Beta, Test, and Full.
  • Replace {INTL_UBI_SKU} with the Game SKU provided by Ubisoft.
  • Replace {INTL_UBI_WEB_AUTH_URL} with the login landing page URL provided by Ubisoft.

Step 2: Add Ubisoft login

The SDK will call up WebView and go to the Ubisoft login page. After logging in to the Ubisoft account in the browser, users will return to the game to continue the Ubisoft SDK login process.

  1. Add an observer to handle authentication callbacks.

    Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.

  2. Call the AutoLogin method.

    If users have previously logged in, the game backend can achieve automatic login by calling the auto-login interface. If their login token is still valid, they will log in successfully. If the token has expired, the system throws an exception and the game calls the manual login API.

    Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.

  3. Call the Login method to ask for user input if auto-login fails.

    Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.

  4. Sync client authentication state with the game's backend and wait for the final authentication result.

Returns AuthResult, data format for channel_info as follows:

"channel_info":"
{
\"expire_ts\":1651047328,
\"is_refresh\":0,
\"profile_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-f34e406412d6\",
\"sesssion_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-d82d645f5df0\",
\"ticket\":\"...\",
\"user_id\":\"xxxxxxxx-xxxx-xxxx-xxxx-F88B443D15D6\"
}",

Logout

Call the Logout API to log out of the current channel and pass relevant parameters.

Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.

Step 3: Test the login function

Search for the keyword "AuthResult" in the Player Network SDK logs to verify if the correct channel name and OpenID are returned. If they are, it indicates a successful configuration and the login function has been added successfully.

Extended APIs

Extended APIs

Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.

Get Ubisoft DNA Event Reporting Facade

Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.

Set Ubisoft DNA Not Reporting Session Events

Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.

Get the User ID of the Ubisoft Channel

Currently, the Ubisoft channel in the Player Network SDK does not support the Unity engine.