Menu

Quick Access

SDK Basic Information

SDK Name: SolarEngine uni-app SDK v1.1.5

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

SDK Version: 1.1.5

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

Entry: Asset Management - App Management - AppKey

Step 2: Obtain SDK

China Mainland version SDK:

https://solar-sdk.oss-cn-beijing.aliyuncs.com/uniapp/SolarEngine-UniPlugin-App-cn-1.1.5.zip

Non-China-Mainland version SDK:

https://solar-sdk.oss-cn-beijing.aliyuncs.com/uniapp/SolarEngine-UniPlugin-App-us-1.1.5.zip

Download SDK Demo via:

https://solar-sdk.oss-cn-beijing.aliyuncs.com/uniapp/SolarEngine-UniPlugin-App-Demo.zip

Step 3: Integrate SDK

For Android

       Please note that only Android 2.3 (API Level 9) and above supported.

1. Add dependency

       a. Unzip the SDK package obtained in Step 2 and place the AAR file from the package into the nativeplugins directory of the HBuilder project. If this directory does not exist, please create as below.


       b. If you are a Non-China-Mainland developer, please copy the AAR files from the SolarEngine-UniPlugin-App->Android directory and the package.json file from the SolarEngine-UniPlugin-App directory to the nativeplugins directory. Below are the specific purposes of each AAR file; please choose according to your needs.

  • se-plugin-meta-installReferrer-1.x.x.x.aar (For Meta attribution, essential, SDK cannot run without it)
  • solar-engine-core-us-1.x.x.x.aar (Main SDK, essential, SDK cannot run without it)
  • SolarEngine-UniPlugin-App.aar (uniapp SDK, essential, SDK cannot run without it)
  • solar-remote-config-us-1.x.x.x.aar (Remote Config/A B Testing SDK, optional)
  • aar file from se_oaid_lib (Only for non-china-mainland developers who need to obtain OAID)

       

       c. If you are a China-Mainland developer, please copy the AAR files from the SolarEngine-UniPlugin-App->Android directory and the package.json file from the SolarEngine-UniPlugin-App directory to the nativeplugins directory. Below are the specific purposes of each AAR file; please choose according to your needs.

  • solar-engine-core-cn-1.x.x.x.aar (Main SDK, essential, SDK cannot run without it)
  • SolarEngine-UniPlugin-App.aar (uniapp SDK, essential, SDK cannot run without it)
  • solar-remote-config-cn-1.x.x.x.aar (Remote Config/A B Testing SDK, optional)
  • se-plugin-oaid-1.x.x.x.aar (oaid plugin, essential, SDK cannot run without it)
  • com.hihonor.mcs-ads-identifier-1.0.2.301.aar (To obtain Honor OAID, essential)
  • com.huawei.hms-ads-identifier-3.4.62.300.aar (To obtain Huawei OAID, essential)


      Finally, the directory will look like this:

                                       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 library
-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.

1. Add Frameworks

FrameworkDescription
Security.frameworkTo store device identifiers
CoreTelephony.frameworkTo obtain carrier information
AdSupport.frameworkTo obtain Advertising Identifier information
SystemConfiguration.frameworkTo check the current network environment
libsqlite3.dylibTo store data
AdServices.frameworkTo obtain ad attribution data

Standard Setup:

       In the project navigator, select TARGETS-->Build Phases-->Link Binary With Libraries-->+ -->Select Security.framework, CoreTelephony.framework, AdSupport.framework, SystemConfiguration.framework, libsqlite3.tbd, AdServices.framework and other library files.

       Add "-Objc" parameter in UnityFramework Target, or SDK would fail to be initialized. (TARGETS -> UnityFramework -> Build Settings -> Linking -> Other Linker Flags -> -Objc)

       The new version of Xcode uses ".tbd" as the suffix for dynamic libraries. Please add corresponding dynamic library files.

Note:

◦ Please configure all the above dynamic libraries to avoid errors.

◦ Starting from Xcode 7 and above, system libraries that previously had the .dylib extension are now changed to have the .tbd extension.


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.

const solarengine = uni.requireNativePlugin('SolarEngine-UniPlugin-App');
solarengine.preInitSDK(appkey);

Step 5: Initialize SDK

Parameters:

Parameter NameParameter MeaningParameter TypeMandatory
appKeyAppKeystringYes
configSolarEngine SDK configurationobjectYes
initCallbackCodeInitialization callback codecallback(number)No
attrCallbackAttribution callbackcallback(object)No

       

       In the config, all parameters within the app are for Native iOS & Android. The explanation is as follows.

Parameter nameParameter MeaningParameter TypeMandatory
logEnabledWhether to enable debugging logs (default off)boolno
isDebugModelWhether to enable Debug mode (default off). Before using, please check function description.boolno
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)boolno
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.boolno
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.boolno
isCoppaEnabledWhether your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"). Default false.boolno
isKidsAppEnabledWhether your app is targeting kids under 13 years old and needs to be marked as "Kids App" category. Default false.boolno
iosOnly for iOSstringno
remoteconfigOnline Parameter initialization configobjectno

iOS related parameter:

Parameter nameParameter MeaningParameter TypeMandatory
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)
intno

Remote config related parameter (For Online Parameter feature, optional):

Parameter nameParameter MeaningParameter TypeMandatory
logEnabledWhether to enable debugging logs (default false)boolno
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
customIDPropertiesCustom IDobjectno
customIDEventPropertiesCustom ID event propertiesobjectno
customIDUserPropertiesCustom ID user propertiesobjectno

Initialization example:

solarengine.initSDK(
	appkey,
	{
		app:{  
			logEnabled: true,  
			isGDPRArea: false, 
			isCoppaEnabled: false,
			isKidsAppEnabled: false,
			isDebugModel: false, 	
		}  
	},
	(initCallbackCode) => {
		if (initCallbackCode == 0) {
			console.log("[SEUni-App] InitSuccess")
		} else {
			console.log("[SEUni-App] InitFailure")
		}
	},null
);



// Attach solarengine to the global scope for use in other pages.
globalThis.solarengine = solarengine;

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.

       The SDK offers two ways to obtain attribution result information:

  1. Set Attribution Result Callback: The SDK will provide a callback when it successfully retrieves the attribution result or fails (this interface is asynchronous).
  2. Directly Retrieve Attribution Result: Obtain the attribution result directly from the SDK cache. If the SDK does not have the attribution result yet, it will return nil (this interface is synchronous).

Set Attribution Result Callback example:

solarengine.initSDK(
	appkey,
	{
		app:{  
			logEnabled: true,  
			isGDPRArea: false, 
			isCoppaEnabled: false,
			isKidsAppEnabled: false,
			isDebugModel: false, 	
		}  
	},
	(initCallbackCode) => {
		if (initCallbackCode == 0) {
			console.log("[SEUni-App] InitSuccess")
		} else {
			console.log("[SEUni-App] InitFailure")
		}
	},
	(attrCallback) => {
		let code = attrCallback["code"]
		if (code == 0) {
			console.log("[SEUni-App] attribution success")	
			let result = attrCallback["result"]				
			console.log(result)					
		} else {
			console.log("[SEUni-App] attribution failure")
			console.log(code)
		}
	});

Directly Retrieve Attribution Result example:

const attribution = globalThis.solarengine.getAttribution();
console.log("[SEUni-App] attribution = ",attribution);	


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-app SDK
Next
Optional Features
Last modified: 2025-03-14Powered by