Skip to main content

iOS

This article guides you through setting up Ubisoft as an identity provider, enabling your iOS 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

Ubisoft SDK is only compatible with iOS SDK 12 and above.

IDE: Xcode 13.3 or later
iOS: iOS 12.0 or later

  1. Add the following configuration in the project file INTLConfig.ini.

    [Ubisoft]
    UBI_APP_ID_IOS = {INTL_UBI_APP_ID_IOS}
    UBI_GENOME_ID_IOS = {INTL_UBI_GENOME_ID_IOS}
    UBI_APP_BUILDID_IOS = {INTL_UBI_APP_BUILDID_IOS}
    UBI_GAME_VERSION_IOS = {INTL_UBI_GAME_VERSION_IOS}
    UBI_SKU = {INTL_UBI_SKU}
    UBI_WEB_AUTH_URL = {INTL_UBI_WEB_AUTH_URL}
    • Replace {INTL_UBI_APP_ID_IOS} with the iOS app ID provided by Ubisoft.
    • Replace {INTL_UBI_GENOME_ID_IOS} with the iOS GENOME ID provided by Ubisoft.
    • Replace {INTL_UBI_APP_BUILDID_IOS} with the detailed iOS version number of the game.
    • Replace {INTL_UBI_GAME_VERSION_IOS} 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.
  2. Set Keychain sharing.
    Ubisoft SDK requires users to enable the Keychain Sharing function for iOS app and set a keychain group named com.ubisoft.data. Specific configuration steps are as follows:

    • Click Target and select Signing & Capabilities. Image: Signing

    • Click Keychain Sharing. If Keychain Sharing is not enabled, enable it.

    • Click the plus sign (+) and add a keychain group named com.ubisoft.data. Image: Keychain

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.

If you have trouble logging in through Ubisoft, see Ubisoft FAQs.