Skip to main content

iOS

This document introduces how to set up VK authentication, allowing your game to use Player Network's login authentication service to sign in via the VK channel.

Prerequisites

1. Set up your game on the VK developer website

1. Create a VK app

info

The following information was last updated on January 14, 2025. Please refer to the latest details on the VK developer website.

caution

Currently, the VK developer website no longer allows creation of VK apps. Follow the steps below to go to the VK ID developer website.
Player Network SDK does not currently support VK ID. For detailed information and version support plans, please contact Player Network Assistant.

  1. Log in to or register an account on the VK developer website.

  2. Click Standalone application

    Image: VK Create App

  3. Go to the VK ID developer website to create an app.

    Image: VK Create App

2) Configure the app

Enter application information
  1. Go to the VK developer website

  2. On the Information page of the corresponding app, enter your application details.

    Image: VK information

  3. Click Save to save the entered information.

Enable OpenAPI

Image: VK app base domain

  1. Enable OpenAPI.
  2. Add the following base domains:
    • dev-common-web.intlgame.com
    • debug-common-web.intlgame.com
    • test-common-web.intlgame.com
    • common-web.intlgame.com
Get Android fingerprint

To obtain the Android fingerprint, follow the instructions in Get the SHA1 Value for Android.

Image: VK SHA1

SDK Settings
  1. Go to the Settings page of your app.
  2. In the SDK settings section, enter App Bundle ID for iOS, Package name for Android, and Signing certificate fingerprint for Android

Image: VK SDK Setting

Get App ID, Secure key, and other information

Go to the App's Settings page to obtain the App ID and other information.

Image: Player Network Setting

  1. Obtain Player Network Console login account.
  2. Create a new project for your game, or join an existing one.
  3. Download SDK.
  4. Integrate the SDK.
  5. Add VK as a login authentication method for business in the Player Network Console.

Step 1: Configure SDK for VK Login

If VK authorization is obtained, add a URL scheme to the application.

Xcode 5:

  1. Open application settings.
  2. Select info/URLType。
  3. Set Identifier and URL Schemes to vk+APP_ID. Image: VK iOS Identifiers

Xcode 4:

  1. Open info.plist.
  2. Add a row for URL Types.
  3. Set URL identifier to vk+APP_ID. Image: VK iOS URL Identifiers

Open your project's INTLConfig.ini file:

[VK Channel Configuration] VK_APP_ID = {INTL_VK_APP_ID}

Replace {INTL_VK_APP_ID} with the registered VK App ID.

Step 2: Add VK Login

  1. Register login-related callbacks.
// Add callbacks
public void AddAuthObserver()
{
INTLAPI.AddAuthResultObserver(OnAuthResultEvent);
}

// Remove callbacks
public void RemoveAuthObserver()
{
INTLAPI.RemoveAuthResultObserver(OnAuthResultEvent);
}

// Process the INTLAuthResult callback
public void OnAuthResultEvent(INTLAuthResult ret)
{
Debug.Log($"MethodID: {ret.MethodId}");

string methodTag = "";
if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_LOGIN)
{
methodTag = "Login";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_BIND)
{
methodTag = "Bind";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_AUTOLOGIN)
{
methodTag = "AutoLogin";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_QUERY_USER_INFO)
{
methodTag = "QueryUserInfo";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_GET_AUTH_RESULT)
{
methodTag = "GetAuthResult";
}
}
  1. Call the AutoLogin interface to log in automatically.
INTLAPI.AutoLogin();
  1. If automatic login fails, call the Login interface to let the player log in manually.
INTLAPI.Login(INTLChannel.VK); 
  1. Synchronize client authentication status with the game backend and wait for the final verification result.

Step 3: Acceptance testing for login functionality

Search for the keyword "AuthResult" in the Player Network SDK logs to confirm whether the channel name and OpenID are returned correctly.If correct, it means the integration configuration is successful, and login functionality has been successfully added.

If you encounter problems during the integration process, please refer to Frequently Asked Questions.