2. Credentials setup

To initializes the TyrAds Unity SDK you must provide the necessary credentials obtained from the TyrAds platform. These credentials allow your application to establish secure communication with the TyrAds' backend services. There are two supported approaches for setting up credentials: a Unity Editor–based approach and a code-based approach.

a. Unity Editor–based approach

Once TyrSDK is imported, follow these steps to configure it in your project:

  • Open the Configuration Window

    • Navigate to TyrSDK > TyrSDK Settings to access the TyrSDK Settings panel.

  • Enter Your Credentials

    • API Key: A 32-character hexadecimal string (Mandatory. Grabbed from TyrAds Dashboard).

    • API Secret: A 92-character hexadecimal string(Mandatory. Grabbed from TyrAds Dashboard).

    • Encryption Key: A 32-character hexadecimal string (Optional. Grabbed from TyrAds Dashboard).

b. Code-based approach

You can initialize credentials programmatically. Credentials could be initialized by a call:

Init method had to be called before calling LoginUserAsunc to ensure that your credentials are properly set before the login process begins.

Notes

If credentials are configured both in the Editor and via code, the programmatic initialization will override the Editor settings at runtime.

Using Different Credentials for Android and iOS

In some projects, you may need to initialize the SDK with different credentials per platform (e.g., separate API keys for iOS and Android).

Editor-based configuration does not support platform-specific credentials, this type of configuration cannot be handled through the Settings Editor window.

To support platform-specific credentials, you must use the code-based initialization approach.

On the developer side, the application should detect the active platform at runtime and provide the correct credentials accordingly.

Below is a simple example demonstrating how to configure this:

Last updated