Menu

Quick Access

SDK Basic Information

SDK Name: SolarEngine Unity SDK  v1.3.0.9

Developer: Mobvista Cloud (Beijing) Technology Co., Ltd.

SDK Version:  1.3.0.9

Features: SolarEngine (SE) is an all-in-one mobile app growth analytics and publishing intelligence platform. It supports data management across global channels, assisting developers to monitor every stage of business development. With our attribution and user-level ROI analysis, you'll be able to measure the true value every channel creates and optimize future growth strategies. SE also offers various analysis models and A/B testing feature to help fully visualize the user journey, identify potential pain points, implement targeted product enhancements and ultimately drive large-scale app growth.

Privacy Policy: https://www.solar-engine.com/privacyPolicyEN.html

Note:

The SolarEngine SDK supports Android 5.0 (API Level 21) and above.

Step 1: Get AppKey

Access Path:  Asset Management - App Management - AppKey

Please login to the live version and get appkey for your own product.

Step 2: Obtain SDK

2.1 Unity Plugin

       Download via  solarengine-unity-sdk-1.3.0.9.zip

2.2 Import SDK

       1) Download the SDK zip package, and extract it to a local directory.

       2) Import  solarengine-unity-sdk.unitypackage into Unity.

Note: When you upgrade SDK version to 1.3.0.0 and above, you might encounter some issues. We have listed a few in Common Questions for your reference.

2.3 SDK Demo

       Please refer to the GitHub open-source project for demo, in which you can find examples of how each method is called in the SolarEngineDemo.cs script.

Step 3: Integrate SDK

3.1 SDK Edit Settings

Clicking on "SolarEngineSDK-->SDK Edit Settings" will open the SolarEngineSettings panel.

SDK Edit Settings Introduction

Example

Click "Apply" and you'll receive a "success" notifcation as below. It means SDK settings are finished.


3.1.1 iOS

       1. For Xcode versions, 14.0 and above are supported.

       2. Accessible for iOS 11.0 and later.

       3. CocoaPods is required for the plugin. Please install following the guide here.

          (CocoaPods integration requires opening a file with the .xcworkspace extension.)

       4. If you want to integrate manually, please refer to the guide here.

3.1.2 Android

       1. Please make sure you can see this page after SDK version is upgraded.

           (First make sure the current Unity is on Android platform.)

       

       If successfully pulled, the SDK version under Plugins-->Android directory will be same as that you input into                         the panel before.

       If failed, please refer to the solution in Common Questions.

       2. Add the following permission into the AndroidManifest.xml file in your project.

       Entry:  Assets/Plugins/Android/AndroidManifest.xml

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Note: The android.permission.READ_PHONE_STATE is a non-essential permission. If you are using the China Mainland version SDK, the SolarEngine SDK does not force developers to obtain this permission. If you have obtained this permission and the Android system is version 6.0 or higher, you will need to dynamically request this permission.

3.1.3 Windows

       Only need to configure either "China Mainland" or "Non-China-Mainland", then click "Apply".

3.1.3.1 Windows Software Uninstall Config

Because some data from the SDK is stored in AppData\LocalLow\Company Name (replace with your project name)\Product Name (replace with your project name)\com.solarengine, it is necessary to ensure that this file is deleted when the software is uninstalled.

Here's a .bat script:

  1. Replace Company Name and Product Name with your own project name, then save this file with a .bat extension.
  2. Run this script during uninstall.
@echo off
rem Define the path of the cache directory to be cleaned
set "cacheDir=%LOCALAPPDATA%\..\LocalLow\Company Name (to be replaced)\Product Name (to be replaced)\com.solarengine"

echo The value of cacheDir is: %cacheDir%

rem Clean the cache directory
if exist "%cacheDir%" (
    echo Cleaning the game cache directory...
    rd /s /q "%cacheDir%"
    echo The game cache directory has been cleaned.
) else (
    echo The game cache directory does not exist, no need to clean.
)

echo All cleaning operations are completed.
pause

3.1.4 OpenHarmony

3.1.4.1 Configure Permissions

Player Settings---> Other Settings--->Predefined Permissions

Add the following permissions, as shown in the figure.

ohos.permission.INTERNET//Required permission, allowing the app to send network requests.
ohos.permission.GET_NETWORK_INFO//Required permission, allowing the application to detect network status.
ohos.permission.APP_TRACKING_CONSENT//Required permission, allowing the application to obtain OAID. Note: The SDK must be initialized after this permission is obtained; if this permission is missing, it will affect device attribution.
ohos.permission.STORE_PERSISTENT_DATA//Required permission, allowing the application to retain the distinctID when uninstalled, which is used for device attribution.
3.1.4.2 Configure Obfuscation

If obfuscation configuration needs to be enabled during packaging, please add the following code to the obfuscation configuration file.

-keep
./oh_modules/@solarengine/core
3.1.4.3 Packaging

Currently, only the Export Project method is supported for packaging.

3.1.5 Mac OS

3.1.5.1  For packaging, you need to check "Create Xcode Project"

Step 4: Pre-Initialize SDK

       When the application is first launched after install, the SDK is pre-initialized. During pre-initialization, the SDK does not collect any personal information or report data to SolarEngine.

Function

public static void preInitSeSdk(string appKey)

Sample Code

SolarEngine.Analytics.preInitSeSdk("appkey");

Step 5: Initialize SDK

Function

public static void initSeSdk(string appKey, SEConfig seConfig)
ParameterDescriptionTypeRequired
appKeyAppKey you obtained in Step 1StringYes
seconfigSolarEngine SDK configurationSEConfigYes

SEConfig parameter description:

ParameterDescriptionPlatformsTypeRequired
logEnabledWhether to enable debugging logs (Default false)iOS/Android/
MiniGame
boolno
isEnable2GReportingWhether to enable data reporting in 2G environment (Default false)iOS/Androidboolno
isDebugModelWhether to enable Debug mode (Default off). Before using, please check function description.iOS/Android/ MiniGameboolno
isGDPRAreaIf your product is operated within the EU region, there will be GDPR restrictions to follow. Please make sure to set isGDPRArea(true) if users reject the device information collection. (Default false)

GDPR regions:
- send 0 if user agrees
- send 1 if user disagrees
Non-GDPR regions:
- Always send 0
iOS/Androidboolno
adPersonalizationEnabledIf your product is operated within the EU region and advertised on Google, please send the results about whether users allow Google to use their data for ad personalization into this parameter, so that you will comply with Google's EU user consent policy.Androidboolno
adUserDataEnabledIf your product is operated within the EU region and advertised on Google, please send the results about whether users allow their personal data to be shared with Google into this parameter, so that you will comply with Google's EU user consent policy.Androidboolno
isCoppaEnabledWhether your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"). Default false.iOS/Androidboolno
isKidsAppEnabledWhether your app is targeting kids under 13 years old and needs to be marked as "Kids App" category. Default false.iOS/Androidboolno
attAuthorizationWaitingIntervalSupports ATT Authorization Waiting for up to 120 seconds when iOS devices report events for the first time. Then SDK will report the install event only after users authorize ATT or when waiting time is up. (Unit: second)iOSintno
fbAppIDIf you need to use Meta attribution, set Meta appid here. Only Android need to use this parameter. For iOS, please ignore this step.Androidstringno
deferredDeeplinkenableWhether to enable deferred deep linking, default False. iOS/Androidboolno

Sample Code

SEConfig seConfig = new SEConfig();
seConfig.logEnabled = true;
SolarEngine.Analytics.initSeSdk("appkey",seConfig);

Track initialization results

       This function is used to track the initialization results, to make sure the SolarEngine SDK is successfully initialized before you proceed with the following steps.

Parameter Description:

ParameterDescriptionTypeRequired
appKeyThe appkey you can get from SolarEngine dashboard.stringYES
seConfigSolarEngine SDK configurationsSEConfigYES

Sample Code

//Initialization
SolarEngine.Analytics.preInitSeSdk("appkey");    //PreInit should be called first.
SEConfig seConfig = new SEConfig();
seConfig.logEnabled = true;
seConfig.initCompletedCallback = onInitCallback;     //Here put initCallback into SEConfig.
SolarEngine.Analytics.initSeSdk("appkey", seConfig);

//InitCallback
private void onInitCallback(int code) {
        ///please refer to the codes below
}

Initialization callback codes:

codemeaning
0Initialization success
101Initialization failed, as pre-initialization is not called
102Initialization failed, due to illegal appkey
103Initialization failed, due to null context (Android only)
104Initialization failed, due to missing distinct_id (Android only)

Step 6: Get Attribution Results

The SDK provides an interface to obtain attribution result information, allowing developers to use the attribution data for event tracking and other logical processing.        

SolarEngine SDK provides two methods for obtaining attribution result information.

1. Set attribution result callback: When the SDK successfully or fails to obtain the attribution result, a callback will be given (asynchronous).

2. Get attribution result directly: Get the attribution results directly from the SDK cache. If the SDK has no attribution results yet, it will directly return nil (synchronous).

6.1 Set Attribution Result Callback

Function

public struct SEConfig
{
    ...
    public Analytics.SEAttributionCallback attributionCallback { get; set; }
}

Sample Code

private void initSDK(){
     SEConfig seConfig = new SEConfig();
    
      // Set attribution results callback
      SolarEngine.Analytics.SEAttributionCallback callback = new SolarEngine.Analytics.SEAttributionCallback(attributionCallback);
      seConfig.attributionCallback = callback;
    
      SolarEngine.Analytics.initSeSdk(AppKey, AppUserId, seConfig, rcConfig);
  }

  private void attributionCallback(int code , Dictionary attribution)
  {
      Debug.Log("SEUnity: errorCode : " + errorCode);
      Debug.Log("SEUnity: attribution : " + attribution);


      if (code == 0)
      {
          // Attribution success
      }
      else
      {
          // Attribution failed
      }
  }

6.2 Get Attribution Result Directly

Function

public static Dictionary getAttribution()

Sample Code

Dictionary attribution = SolarEngine.Analytics.getAttribution();
Debug.Log("[unity] getAttribution = "+ attribution);

6.3 Attribution Result Example

Attribution error code descriptions and detailed attribution results can be found in:

https://help.solar-engine.com/en/docs/SDK-Attribution-Result-Details

Previous
Unity SDK
Next
Optional Features
Last modified: 2025-08-21Powered by