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.
Access Path: Asset Management - App Management - AppKey
Please login to the live version and get appkey for your own product.
Download via solarengine-unity-sdk-1.3.0.9.zip
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.
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.
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.
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.
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.
Only need to configure either "China Mainland" or "Non-China-Mainland", then click "Apply".
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:
@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
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.
If obfuscation configuration needs to be enabled during packaging, please add the following code to the obfuscation configuration file.
-keep
./oh_modules/@solarengine/core
Currently, only the Export Project method is supported for packaging.
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");
Function
public static void initSeSdk(string appKey, SEConfig seConfig)
Parameter | Description | Type | Required |
---|---|---|---|
appKey | AppKey you obtained in Step 1 | String | Yes |
seconfig | SolarEngine SDK configuration | SEConfig | Yes |
SEConfig parameter description:
Parameter | Description | Platforms | Type | Required |
---|---|---|---|---|
logEnabled | Whether to enable debugging logs (Default false) | iOS/Android/ MiniGame | bool | no |
isEnable2GReporting | Whether to enable data reporting in 2G environment (Default false) | iOS/Android | bool | no |
isDebugModel | Whether to enable Debug mode (Default off). Before using, please check function description. | iOS/Android/ MiniGame | bool | 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 | iOS/Android | bool | 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. | Android | bool | 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. | Android | bool | no |
isCoppaEnabled | Whether your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"). Default false. | iOS/Android | bool | no |
isKidsAppEnabled | Whether your app is targeting kids under 13 years old and needs to be marked as "Kids App" category. Default false. | iOS/Android | bool | 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) | iOS | int | no |
fbAppID | If you need to use Meta attribution, set Meta appid here. Only Android need to use this parameter. For iOS, please ignore this step. | Android | string | no |
deferredDeeplinkenable | Whether to enable deferred deep linking, default False. | iOS/Android | bool | no |
Sample Code
SEConfig seConfig = new SEConfig();
seConfig.logEnabled = true;
SolarEngine.Analytics.initSeSdk("appkey",seConfig);
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:
Parameter | Description | Type | Required |
---|---|---|---|
appKey | The appkey you can get from SolarEngine dashboard. | string | YES |
seConfig | SolarEngine SDK configurations | SEConfig | YES |
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:
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) |
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).
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
}
}
Function
public static Dictionary getAttribution()
Sample Code
Dictionary attribution = SolarEngine.Analytics.getAttribution();
Debug.Log("[unity] getAttribution = "+ attribution);
Attribution error code descriptions and detailed attribution results can be found in:
https://help.solar-engine.com/en/docs/SDK-Attribution-Result-Details