HOME.en.md


RU EN
🏠 Home ❮ Back

RuStore Unity Plugin for the Cloud Application Configuration Service

RuStore Remote Config is a cloud service that allows you to change the behavior and appearance of your application without requiring users to download an application update. The SDK encapsulates requesting configuration from the server, caching, and background updates. Supported Unity versions are 2022.3.37f1+ (Gradle 7.3 or higher required), Unity 6000+.

Integration into the Project

From a network location (recommended)

RuStore packages are published in the npm registry and are added to the project via Package Manager without manually downloading archives.

  1. Open the settings: Edit → Project Settings → Package Manager.
  2. In the Scoped Registries section, click + and fill in the fields:
    • Name — RuStore Nexus.
    • URL — https://nexus-external.vkteam.ru/repository/npm-unity-rustore-exposed/.
    • Scopes — ru.rustore.
  3. Open Window → Package Manager — the RuStore Nexus registry will appear in the list of sources.
  4. Select RuStore Nexus and install the ru.rustore.remoteconfig package using the Install button. The ru.rustore.core dependency will be installed automatically.

From a local location

Installation via Package Manager

  1. To integrate, download the following packages from the releases page:
    • ru.rustore.core-version.tgz.
    • ru.rustore.remoteconfig-version.tgz.
  2. Import the packages into the project via Package Manager (Window → Package Manager → + → Add package from tarball…).

*Installation via .unitypackage

  1. Download the RuStoreUnityRemoteConfigSDK-version.unitypackage file from the releases page.
  2. Import it into the project (Assets → Import Package → Custom Package…).

Cloning the repository

To install from source code, use the cloning instructions.

For each artifact in the release, checksum (.sha256) and digital signature (.sig) files are available, which can be used to verify the integrity and authenticity of the artifact after downloading.

Tip

If you use the macOS operating system, change the archive utility settings. In the Archive Utility settings, uncheck Keep expanding if possible. Otherwise, the project archive will be downloaded incorrectly.

After installation, update the project dependencies using External Dependency Manager (Assets → External Dependency Manager → Android Resolver → Force Resolve).

Installing External Dependency Manager

External Dependency Manager for Android is included with the RuStoreCore package. To install it, follow these steps.

Open RuStoreCore in the Package Manager window (Window → Package Manager → Packages RuStore → RuStoreCore). Go to the Sample tab. Import the External Dependency Manager sample.

Project Configuration

Open the project settings: Edit → Project Settings → Player → Android Settings.

In the Publishing Settings section, enable the following settings.

  • Custom Main Manifest.
  • Custom Main Gradle Template.
  • Custom Gradle Properties Template.

In the Other Settings section, configure:

  • package name.
  • Minimum API Level = 24.
  • Target API Level = 34.

Open the External Dependency Manager settings: Assets → External Dependency Manager → Android Resolver → Settings, and enable the following settings.

  • Use Jetifier.
  • Patch mainTemplate.gradle.
  • Patch gradleTemplate.properties.

SDK Initialization

Initialization of RuStoreUnityRemoteConfigClient with the UpdateBehaviour.Default and UpdateBehaviour.Snapshot parameters must occur at the time of Application.onCreate(), because the SDK must be initialized when background synchronization starts.

To do this, extend the Application class and add the following code to the onCreate method.

package ru.rustore.unitysdk;

import android.app.Application;
import ru.rustore.unitysdk.remoteconfigclient.RuStoreUnityRemoteConfigClient;
import ru.rustore.unitysdk.remoteconfigclient.model.RemoteConfigClientParameters;
import ru.rustore.unitysdk.remoteconfigclient.model.UnityRemoteConfigClientEventListener;

public class RuStoreRemoteConfigApplication extends Application {

    public final String APP_ID = "a83c91d3-21b4-4891-841e-0ed0fc39a562";
    public final int UPDATE_TIME = 15;
    public final String UPDATE_BEHAVIOUR = "Default";
    public RemoteConfigClientParameters parameters = null;
    public UnityRemoteConfigClientEventListener listener = null;
	
    @Override
    public void onCreate() {
        super.onCreate();

        RuStoreUnityRemoteConfigClient.INSTANCE.init(APP_ID, UPDATE_TIME, UPDATE_BEHAVIOUR, parameters, listener, getApplicationContext());
    }
}

To replace the Application class with RuStoreRemoteConfigApplication, add the android:name attribute to the application tag in your project’s manifest file Assets/Plugins/Android/AndroidManifest.xml.

AndroidManifest.xml Example
<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    xmlns:tools="http://schemas.android.com/tools">
    <application android:name="ru.rustore.unitysdk.RuStoreRemoteConfigApplication">
        <activity android:name="com.unity3d.player.UnityPlayerActivity"
                  android:theme="@style/UnityThemeSelector">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
        </activity>
    </application>
</manifest>

Plugin Initialization

To access SDK methods from C#, initialize the plugin using the Init method.

Calling the Init Method
IRemoteConfigClientEventListener eventListener = /* Реализация интерфейса */;

RuStoreRemoteConfigClient.Instance.Init(eventListener);

For the UpdateBehaviour.Actual mode, initialization can be performed without creating an Application class extension. In this case, the APP_ID parameter must be passed from C#.

Calling the Init Method
IRemoteConfigClientEventListener eventListener = /* Реализация интерфейса */;

var settings = new RuStoreRemoteConfigClientSettings() {
    appId = APP_ID,
    account = ACCOUNT,
    language = LANGUAGE
};

RuStoreRemoteConfigClient.Instance.Init(settings, eventListener);

Start learning the library documentation with the methods of the RuStoreRemoteConfigClient class. Or use the online guide.

Technical Support

Additional help and instructions are available in the RuStore documentation and by email at support@rustore.ru.

Distribution Terms

This software, including source code, binary libraries, and other files, is distributed under the MIT license. Licensing information is available in the MIT-LICENSE document.