Menu

Quick Access

SDK Basic Information

SDK Name: SolarEngine uni-appx SDK v1.0.4

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

SDK Version: 1.0.4

Supported: The SolarEngine SDK supports Android 5.0(APILevel 21) and above.

Description: SolarEngine (SE) is an all-in-one mobile app growth analytics and data intelligence platform. It supports data management across global channels, assisting developers to monitor every stage of business development. With our attribution tracking and user-granular 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

Compliance Guideline: https://help.solar-engine.com/en/docs/Compliance-Guideline

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


  • Download SDK Demo via se-uni-appx-demo and run the demo following steps below:
      • The Demo comes with China Mainland version SDK (solarengine-sdk-cn). If your product data is stored in Non China Mainland, please replace it with solarengine-sdk-us.
      • Open the manifest.json file in the Demo root directory and set the appid to your own project's App ID.
      • Open the App.uvue file in the Demo root directory and set the appkey to your own project's App Key.
      • Generate a custom base, then run the Demo on the iOS or Android platform.

Step 3: Integrate SDK

For Android

If obfuscation is required during packaging, please add the following code to the obfuscation configuration file.

-keep class com.reyun.** {*; }
-keep class route.**{*;}
-keep interface com.reyun.** {*; }
-keep interface route.**{*;}
-dontwarn com.reyun.**
-dontwarn org.json.**
-keep class org.json.**{*;}
# Google lib库
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
    com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
    java.lang.String getId();
    boolean isLimitAdTrackingEnabled();
}
-keep public class com.android.installreferrer.** { *; }
# Please add the following if you used the plugin for obtaining OAID.
-keep class com.huawei.hms.**{*;}
-keep class com.hihonor.**{*;}

For iOS

       Please note that only Xcode 14.0, iOS 11.0 or above supported.


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.

import * as solarengine from '@/uni_modules/solarengine-sdk'

solarengine.preInitialize(appkey)


Step 5: Initialize SDK

Parameter NameParameter MeaningParameter TypeRequired
appKeyAppKeystringYes
configSolarEngine SDK configurationSEUniConfigYes

       

1. Core Feature Switches

       It controls the enablement or disablement of core SDK capabilities, directly determining whether core services such as attribution and analytics take effect.

       Note: Disabling relevant core feature switches will disrupt the data reporting. You will no longer be able to fully utilise all functions within SolarEngine dashboard.

MethodData TypeRequiredDescription
enableAttributionbooleanNoWhether to enable SolarEngine attribution service. Enabled by default. Disabling it will turn off all attribution relevant capabilities, including attribution results, deferred deeplinks and deeplinks, etc. If the analytics service is disabled at the same time, the SDK will stop reporting all data.
enableAnalyticsbooleanNoWhether to enable SolarEngine analytics service. Enabled by default. Disabling it can make all analytics features unavailable, such as A/B testing and online parameter. If the attribution service is disabled at the same time, the SDK will stop reporting all data.

2. Auxiliary Feature Switches

       It controls non-core features like the SDK's running mode, debug logs, network policy, authorization wait, and deferred deep linking.

ParameterTypeRequiredDescription
logEnabledbooleanNoWhether to enable local debug logs. Disabled by default.
isGDPRAreabooleanNoWhether it belongs to the GDPR region (Default false)
adPersonalizationEnabledbooleanNoWhether users allow Google Ads to use their data for ad personalization,developers can customize this value. The field is not reported by default when left unset. Valid only on Android. iOS does not support this field, no configuration needed.
adUserDataEnabledbooleanNoWhether users allow Google Ads to use their data for ad personalization,developers can customize this value. The field is not reported by default when left unset. Valid only on Android. iOS does not support this field, no configuration needed.
fbAppIDstringNoIf overseas developers need Meta attribution, set the Meta appid here. This parameter takes effect only on Android. iOS does not support this field and no configuration is required.
attAuthorizationWaitingIntervalnumberNoSupports 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)
isDebugModelbooleanNoWhether to enable debug mode. Disabled by default. Before using, please check function description
isCoppaEnabledbooleanNoWhether COPPA compliance is supported. Disabled by default.
isKidsAppEnabledbooleanNoWhether Kids App mode is supported. Disabled by default.
enableDelayDeeplinkbooleanNoWhether to enable deferred deeplink. Disabled by default.
enableSeparatedAttributionbooleanNoWhether to enable new attribution feature. After enabled, attribution results can be retrieved faster.
remoteConfigSEUniRemoteConfigNoRemote config initialization config
initComplete(code : number) => voidNoInitialization callback
attributionSuccess(data : UTSJSONObject) => voidNoAttribution success callback
attributionFail(code : number) => voidNoAttribution fail callback

5.3. Data Collection Switches

       It controls whether data such as IPv6, OAID and UA is collected.

       Note: Disabling corresponding data collection parameters will impair attribution and analytics services, and you will not be able to use relevant functions normally on SolarEngine dashboard.

MethodTypeRequiredDescription
enableLanguagebooleanNoWhether to collect device language. Set to false to disable collection. Default true (enabled).
enableLocalebooleanNoWhether to collect device locale. Set to false to disable collection. Default true (enabled).
enableTimeZonebooleanNoWhether to collect device time zone. Set to false to disable collection. Default true (enabled).
enableScreenWHbooleanNoWhether to collect screen width and height. Set to false to disable collection. Default true (enabled).
enableNetworkTypebooleanNoWhether to collect network status. Set to false to disable collection. Default true (enabled).
enableUAbooleanNoWhether to collect User-Agent (UA). Set to false to disable collection. Default true (enabled).
enableIPV6AddressbooleanNoWhether to collect IPv6 address. Default true (enabled). Supported in China Mainland only.


remoteConfig parameter description: (For Online Parameter feature)

Parameter nameParameter MeaningTypeRequired
enableWhether to enable online parameter function (default false)boolno
mergeTypeBy default, the server configuration is merged with the local cached configuration.

0: On the first launch of the app or during a version update, merge the server configuration with the user's default configuration; this method can clear the local cached configuration.

1: Merge the server configuration with the user's existing local cached configuration (default this option)
numberno
customIDEventPropertiesCustom ID event propertiesobjectno
customIDUserPropertiesCustom ID user propertiesobjectno

Initialization example:

import * as solarengine from '@/uni_modules/solarengine-sdk'

let appkey = ''

solarengine.preInitialize(appkey)

const config = {
		logEnabled : true,		
		initComplete: (code : number) => {
			if (code == 0) {
				console.log("sdk init success")
			} else {
				console.log("sdk init fail")
				console.log(code)	
			}
		}					
	} as solarengine.SEUniConfig

solarengine.initialize(appkey, config)

Initialization Callback Codes

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

Step 6: Get Attribution Results

      SolarEngine SDK provides two methods to retrieve attribution result information, allowing developers to use the attribution data for event tracking and other data processing.

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

2. Get attribution results 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 Results Callback (New)

Sample Code

import * as solarengine from '@/uni_modules/solarengine-sdk'

let appkey = ''

solarengine.preInitialize(appkey)

const config = {
		logEnabled : true,		
		enableSeparatedAttribution: true, // enable new attribution
		initComplete: (code : number) => {
			if (code == 0) {
				console.log("sdk init success")
			} else {
				console.log("sdk init fail")
				console.log(code)	
			}
		},			
		uaAttributionFail:(errorCode:number) => {
			console.log("[uni-appx CN] uaAttributionFail", errorCode)
		},
		uaAttributionSuccess:(data: UTSJSONObject | null) => {
			console.log("[uni-appx CN] uaAttributionSuccess", data)
		},
		reAttributionFail:(errorCode:number) => {
			console.log("[uni-appx CN] reAttributionFail", errorCode)
		},
		reAttributionSuccess:(data: UTSJSONObject | null) => {
			console.log("[uni-appx CN] reAttributionSuccess", data)
		}
						
	} as solarengine.SEUniConfig

solarengine.initialize(appkey, config)
Important: For callback‑based attribution result retrieval, configure attribution listeners prior to initialize. Defining listeners post‑initialization may cause imprecise attribution data. See the sample code above.

7.2. Get Attribution Results Directly (New)

Important: This API retrieves device local cached data and returns "nil" when cache generation is incomplete.

Sample Code

const data = solarengine.getUAAttributionData()
console.log('UA attribution read complete', JSON.stringify(data))

const data = solarengine.getREAttributionData()
console.log('RE attribution read complete', JSON.stringify(data))


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

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


Previous
Uni-appx SDK
Next
Optional Features
Last modified: 2026-09-20Powered by