SDK Name: SolarEngine LayaAir SDK v1.0.3
Developer: Huiliang Cloud (Beijing) Technology Co., Ltd.
SDK Version: 1.0.3
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.
Access Path: Asset Management - App Management - AppKey
Please login to the live version and get appkey for your own product.

If your product data is stored in China Mainland, please download SDK via:
https://solar-sdk.oss-cn-beijing.aliyuncs.com/LayaAir/SolarEngineSDK-LayaAir-CN-1.0.3.zip
If your product data is stored in Non-China-Mainland, please download SDK via:
https://solar-sdk.oss-cn-beijing.aliyuncs.com/LayaAir/SolarEngineSDK-LayaAir-US-1.0.3.zip
Please check your product data storage region from the dashboard:

Please download via: SolarEngineSDK-LayaAir-Demo
After download, please follow the steps below to run the demo:
1. The SDK in the demo is Non-China-Mainland version. If your app is published in China Mainland only, please replace the SolarEngineSDK in the demo with the SolarEngineSDK-LayaAir-CN provided above.
2. After exporting the Android or iOS native project from LayaAir, place the SolarEngineSDK into the native project and export the Android or iOS native project again. For detailed instructions, refer to the section below: "Step 3: Integrate SDK".
Dependencies required for adding the SDK
1. Export the Android native project
In the LayaAir editor, go to the top menu Project -> Build and select the Android platform. After clicking "Build," an Android native project will be generated.
2. Add SolarEngine Android SDK dependencies
Open the exported Android project using Android Studio and compile it (ensure there are no compilation issues).
Maven repository configuration
You need to add the Maven repository configuration in the build.gradle file located in the root directory of the project. The specific configuration is as follows:
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://artifact.bytedance.com/repository/pangle'
}
maven {
url "https://developer.huawei.com/repo/"
}
maven {
url "https://dl-maven-android.mintegral.com/repository/se_sdk_for_android/"
}
maven { url 'https://developer.hihonor.com/repo' }
flatDir {
dirs 'libs' // This way we can find the .aar files in libs folder
}
maven { url 'https://jitpack.io' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
Please add the following code to the build.gradle file of the project.
If your product data is stored in China-Mainland, please use:
implementation 'com.reyun.solar.engine.china:solar-engine-core:1.3.4'If your product data is stored in Non China Mainland, please use:
implementation 'com.reyun.solar.engine.oversea:solar-engine-core:1.3.4'
3. Add SolarEngine Android SDK LayaAir Wrapper file
Place the downloaded SolarEngineSDK/Android/SELayaProxyApi.java file in the /release/android/LayaProject3/app/src/main/java/demo of the project.

If obfuscation is needed 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.** { *; }
# If you need to obtain OAID, please add the following obfuscation
-keep class com.huawei.hms.**{*;}
-keep class com.hihonor.**{*;}For Xcode versions, 14.0 and above are supported.
Accessible for iOS 11.0 and later.
1. Export the iOS native project
In the LayaAir editor, go to the top menu Project -> Build, select the iOS platform, and click "Build." This will generate an iOS native project.
2. Add SolarEngine iOS SDK dependencies
Place the downloaded SolarEngineSDK iOS-related files into release/ios/ios_project/LayaProject3/.

Add the iOS directory to LayaProject3 XCode
Click Finish

Add -ObjC to the Other Linker Flags in the Build Settings of the LayaProject3 project.

When the app 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 solarengine from './Script/SolarEngine.js'
// ./Script/SolarEngine.js (Please update it to the actual SDK directory in your project.)
solarengine.preInitSDK(appkey)SDK Initialization Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
| appKey | AppKey you obtained in Step 1 | String | Yes |
| config | SolarEngine SDK initialization config | Object | Yes |
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.
| Parameter | Description | Type | Required |
|---|---|---|---|
| enableAttribution | Whether to enable SolarEngine attribution service. Enabled by default. Disabling it will turn off all attribution relevant capabilities, including attribution results, deferred deeplink and deeplink, etc. If the analytics service is disabled at the same time, the SDK will stop reporting all data. | boolean | No |
| enableAnalytics | Whether 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. | boolean | No |
| Parameter | Description | Type | Required |
|---|---|---|---|
| logEnabled | Whether to enable debugging logs (Default false) | boolean | no |
| isGDPRArea | If 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 | boolean | no |
| adPersonalizationEnabled | If 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. | boolean | no |
| adUserDataEnabled | If 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. | boolean | no |
| fbAppID | If you need to enable Meta attribution, set Meta appid here. Only Android need to use this parameter. For iOS, please ignore this step. | string | no |
| attAuthorizationWaitingInterval | Supports 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) | number | no |
| isDebugModel | Whether to enable Debug mode (Default off). Before using, please check function description. | boolean | no |
| isCoppaEnabled | Whether your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"). Default false. | boolean | no |
| isKidsAppEnabled | Whether your app is targeting kids under 13 years old and needs to be marked as "Kids App" category. Default false. | boolean | no |
| enableDelayDeeplink | Whether to enable deferred deep linking, default False. | boolean | no |
| remoteConfig | Remote config initialization | SEUniRemoteConfig | no |
| enableSeparatedAttribution | Whether enable the new attribution feature to quickly retrieve attribution results once activated. | boolean | no |
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.
| Paramter | Description | Type | Required |
|---|---|---|---|
| enableLanguage | Whether to collect device language. Set to false to disable collection. Default true (enabled). | boolean | No |
| enableLocale | Whether to collect device locale. Set to false to disable collection. Default true (enabled). | boolean | No |
| enableTimeZone | Whether to collect device time zone. Set to false to disable collection. Default true (enabled). | boolen | No |
| enableScreenWH | Whether to collect screen width and height. Set to false to disable collection. Default true (enabled). | boolean | No |
| enableNetworkType | Whether to collect network status. Set to false to disable collection. Default true (enabled). | string | No |
| enableUA | Whether to collect User-Agent (UA). Set to false to disable collection. Default true (enabled). | number | No |
| enableIPV6 | Whether to collect IPv6 address. Set to false to disable collection. Default true (enabled).(Only China mainland) | boolean | No |
Initialization Example:
import solarengine from './Script/SolarEngine.js'
let appkey = ''
solarengine.initSDKCallback((code: number) => {
if (code == 0) {
console.log("init success ...")
} else {
console.log("init fail ...")
}
})
solarengine.preInitSDK(appkey)
let config = {
"logEnabled": true
};
solarengine.initSDK(appkey, config)Initialization callback codes:
| code | meaning |
|---|---|
| 0 | Initialization success |
| 101 | Initialization failed, as pre-initialization is not called |
| 102 | Initialization failed, due to illegal appkey |
| 103 | Initialization failed, due to null context (Android only) |
| 104 | Initialization failed, due to missing distinct_id (Android only) |
import solarengine from './Script/SolarEngine.js'
let appkey = ''
// Listen to UA attribution results
solarengine.uaAttributionCallback((result: any) => {
let code = result.code
if (code == 0) {
console.log("[LayaAir]: UA attribution success ...")
let data = result.data
console.log(JSON.stringify(data))
} else {
console.log("UA attribution fail ...")
console.log(code)
}
})
// Listen to Re-engagement attribution results
solarengine.reAttributionCallback((result: any) => {
let code = result.code
if (code == 0) {
console.log("[LayaAir]: RE attribution success ...")
let data = result.data
console.log(JSON.stringify(data))
} else {
console.log("RE attribution fail ...")
console.log(code)
}
})
solarengine.preInitSDK(appkey)
let config = {
"logEnabled": true,
"enableSeparatedAttribution": true
};
solarengine.initSDK(appkey, config)In addition to adding an attribution callback during initialization, you can also proactively call the API later in your business logic to read the attribution results.
// Get UA attribution results directly
solarengine.getUAAttributionData((attribution: string) => {
console.log("[LayaAir]: ua attribution callback");
console.log(JSON.stringify(attribution));
})
// Get Re-engagement attribution results directly
solarengine.getREAttributionData((attribution: string) => {
console.log("[LayaAir]: re attribution callback");
console.log(JSON.stringify(attribution));
})Attribution error code descriptions and detailed attribution results can be found in:
https://help.solar-engine.com/en/docs/SDK-Attribution-Result-Details