### Web SDK Initialization Example Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Example demonstrating the pre-initialization and initialization of the SolarEngine SDK with specific parameters, including enabling debug logging. ```javascript SESDK.prevInit('666666'); SESDK.init({ appKey: '666666', userId: '888888', config: { logEnabled: true, }, }); ``` -------------------------------- ### Objective-C Sample Code for Setting App Start Event Properties Source: https://help.solar-engine.com/en/docs/Preset-Events-C6HD This sample demonstrates how to set custom properties for the App Start event using the `setPresetEvent` method. Custom properties are not cached and only the last setting takes effect. ```objective-c [[SolarEngineSDK sharedInstance] setPresetEvent:SEPresetEventTypeAppStart withProperties:@{ @"Key1": @"Value1", @"Key2": @"Value2" }]; ``` -------------------------------- ### Pre-initialize SDK with App Key Source: https://help.solar-engine.com/en/docs/iOS-SDK-Integration-Documentation Call this method when your app is first launched after install. The SDK does not collect personal information during this phase. ```objective-c - (void)preInitWithAppKey:(nonnull NSString *)appKey; ``` ```objective-c #import [[SolarEngineSDK sharedInstance] preInitWithAppKey:your_appKey]; ``` -------------------------------- ### userSet Reporting Format Example Source: https://help.solar-engine.com/en/docs/API-Integration-Documentation This example demonstrates the JSON structure for reporting user set data, including custom properties nested under 'properties'. Ensure custom property keys start with a letter and adhere to naming conventions. ```json [ { "_appkey": "c7d6914e9f4b423c", "_type": "userset", "_userset_type": "userInit", "_account_id": "aid25491084", "_visitor_id": "vid8709901241", "_ts": "1631790831000", "_idfa": "1e2dfa89-496a-47fd-9941-df1fc4e6484a", "_ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X)", "properties": { "regtime": "2021-03-01 12:34:56.789", //custom property "roleName": "dashen" //custom property } } ] ``` -------------------------------- ### SESDK Initialization with Full Configuration Source: https://help.solar-engine.com/en/docs/Web-SDK Example demonstrating how to initialize the SESDK with detailed configuration for both remote parameters and multi-link testing. Ensure all required parameters like appKey and userId are provided. ```javascript SESDK.init({ appKey: '666666', userId: '888888', config: { debugModel: true, remoteConfig: { pollingInterval: 30, enable: true, mergeType: 1, customIDProperties: { a: 1 }, customIDEventProperties: { e: 1 }, customIDUserProperties: { u: 1 }, }, multilinkTestConfig: { enable: true, isSetMask: true, maskTimeoutCloseTime: 500, customIDProperties: { a: 1 }, customIDEventProperties: { e: 1 }, customIDUserProperties: { u: 1 }, }, }, }); ``` -------------------------------- ### React Native: Get Initial URL and Listen for URL Changes Source: https://help.solar-engine.com/en/docs/Deep-Linking-x8I0 Use React Native's Linking module to get the initial URL when the app starts and listen for subsequent URL changes. Call SolarEngine.appDeeplinkOpenURL with the received URL. ```javascript import React, { Component } from 'react'; import { Linking, Platform, Text, View } from 'react-native'; class App extends Component { componentDidMount() { // Check whether the app was opened via the initial URL Linking.getInitialURL().then((url) => { if (url) { console.log('Initial URL:', url); // Here the initial URL can be handled, such as parsing parameters SolarEngine.appDeeplinkOpenURL(url); } }); // Listen for URL change events Linking.addEventListener('url', (event) => { console.log('Received URL:', event.url); // Process URL received SolarEngine.appDeeplinkOpenURL(url); }); } render() { return ( React Native Linking Example ); } } export default App; ``` -------------------------------- ### SDK Initialization (HTML Script Tags) Source: https://help.solar-engine.com/en/docs/Web-SDK Demonstrates how to load the SDK plugin, pre-initialize, and initialize the SDK using HTML script tags. ```APIDOC ## window.SESDK.use(plugin) ### Description Loads an SDK plugin, such as the webabtestPlugin, into the global SESDK object. ### Method `window.SESDK.use(plugin)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **plugin** (object) - Required - The SDK plugin to load. ## window.SESDK.prevInit(appKey) ### Description Performs pre-initialization of the SDK using the global SESDK object. ### Method `window.SESDK.prevInit(appKey)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **appKey** (String) - Required - The application key obtained during preparation. ## window.SESDK.init(initParams) ### Description Initializes the Parameter Delivery SDK with the provided parameters using the global SESDK object. ### Method `window.SESDK.init(initParams)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **initParams** (object) - Required - Initialization parameters for the SDK. - **userId** (String) - Required - User Code obtained in preparation. - **appKey** (String) - Required - AppKey obtained in preparation. - **config** (Config) - Optional - Initialization related configuration. ### Config parameter description: - **remoteConfig** (RemoteConfig) - Optional - Online parameters & A/B test configuration. - **multilinkTestConfig** (MultilinkTestConfig) - Optional - Multi-link test configuration. ### RemoteConfig parameter description: - **enable** (boolean) - Optional - Whether to initialize the online parameter SDK (Default false). - **mergeType** (number) - Optional - Server and SDK merge type (0: Use server config with local cache, 1: Use server config with default config). - **customIDProperties** (object) - Optional - Custom ID properties. - **customIDEventProperties** (object) - Optional - Custom ID event properties. - **customIDUserProperties** (object) - Optional - Custom ID user properties. - **pollingInterval** (number) - Optional - Polling interval in minutes (Default 30, Range: 30-720). - **requestTimeout** (number) - Optional - Timeout for requesting configuration plug-in (Default 60000 milliseconds). ### MultiLinkTestConfig parameter description: - **enable** (boolean) - Optional - Whether to initialize the multi-link test SDK (Default false). - **maskTimeoutCloseTime** (number) - Optional - Timeout for multi-link test config request (Default 500 milliseconds, Minimum 200 milliseconds). - **isSetMask** (boolean) - Optional - Whether to add a mask layer to the test page (Default true). If enabled, SDK initialization should be in the head tag to prevent flickering. - **customIDProperties** (object) - Optional - Custom ID properties. - **customIDEventProperties** (object) - Optional - Custom ID event properties. - **customIDUserProperties** (object) - Optional - Custom ID user properties. - **requestTimeout** (number) - Optional - Timeout for requesting configuration plug-in (Default 60000 milliseconds). ### Request Example ```json { "appKey": "666666", "userId": "888888", "config": { "debugModel": true, "remoteConfig": { "pollingInterval": 30, "enable": true, "mergeType": 1, "customIDProperties": { "a": 1 }, "customIDEventProperties": { "e": 1 }, "customIDUserProperties": { "u": 1 } }, "multilinkTestConfig": { "enable": true, "isSetMask": true, "maskTimeoutCloseTime": 500, "customIDProperties": { "a": 1 }, "customIDEventProperties": { "e": 1 }, "customIDUserProperties": { "u": 1 } } } } ``` ``` -------------------------------- ### Get Current Visitor ID from SolarEngine SDK Source: https://help.solar-engine.com/en/docs/Visitor-ID Call this method to retrieve the current visitor ID. This ID is assigned after installation and before the user logs in. ```objective-c NSString *visitorId = [[SolarEngineSDK sharedInstance] visitorID]; ``` -------------------------------- ### Install SolarEngine React Native Plugin Source: https://help.solar-engine.com/en/docs/RN-SDK-Quick-Integration Install the SolarEngine React Native plugin using npm or yarn. Ensure you update dependencies for the remote library in the native project after installation. ```bash // If you use npm npm install solarengine-analysis-react-native // If you use yarn yarn add solarengine-analysis-react-native ``` -------------------------------- ### SDK Plugin Usage Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Demonstrates how to load SDK plugins during the initialization process using the `use` method. ```APIDOC ## SDK Plugin Usage During SDK initialization, if you need to load SDK plugins, you may call the `use` method. ```javascript SESDK.use(sdkPlugin); ``` ``` -------------------------------- ### API Response Example Source: https://help.solar-engine.com/en/docs/API-Integration-Documentation This is an example of a successful API response indicating that the data was processed correctly. ```json Success {"status":0} ``` -------------------------------- ### SDK Initialization (JavaScript Module) Source: https://help.solar-engine.com/en/docs/Web-SDK Demonstrates how to load the SDK plugin, pre-initialize, and initialize the SDK using JavaScript import statements. ```APIDOC ## SESDK.use(plugin) ### Description Loads an SDK plugin, such as the webabtestPlugin, into the SESDK. ### Method `SESDK.use(plugin)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **plugin** (object) - Required - The SDK plugin to load. ## SESDK.prevInit(appKey) ### Description Performs pre-initialization of the SDK. ### Method `SESDK.prevInit(appKey)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **appKey** (String) - Required - The application key obtained during preparation. ## SESDK.init(initParams) ### Description Initializes the Parameter Delivery SDK with the provided parameters. ### Method `SESDK.init(initParams)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **initParams** (object) - Required - Initialization parameters for the SDK. - **userId** (String) - Required - User Code obtained in preparation. - **appKey** (String) - Required - AppKey obtained in preparation. - **config** (Config) - Optional - Initialization related configuration. ### Config parameter description: - **remoteConfig** (RemoteConfig) - Optional - Online parameters & A/B test configuration. - **multilinkTestConfig** (MultilinkTestConfig) - Optional - Multi-link test configuration. ### RemoteConfig parameter description: - **enable** (boolean) - Optional - Whether to initialize the online parameter SDK (Default false). - **mergeType** (number) - Optional - Server and SDK merge type (0: Use server config with local cache, 1: Use server config with default config). - **customIDProperties** (object) - Optional - Custom ID properties. - **customIDEventProperties** (object) - Optional - Custom ID event properties. - **customIDUserProperties** (object) - Optional - Custom ID user properties. - **pollingInterval** (number) - Optional - Polling interval in minutes (Default 30, Range: 30-720). - **requestTimeout** (number) - Optional - Timeout for requesting configuration plug-in (Default 60000 milliseconds). ### MultiLinkTestConfig parameter description: - **enable** (boolean) - Optional - Whether to initialize the multi-link test SDK (Default false). - **maskTimeoutCloseTime** (number) - Optional - Timeout for multi-link test config request (Default 500 milliseconds, Minimum 200 milliseconds). - **isSetMask** (boolean) - Optional - Whether to add a mask layer to the test page (Default true). If enabled, SDK initialization should be in the head tag to prevent flickering. - **customIDProperties** (object) - Optional - Custom ID properties. - **customIDEventProperties** (object) - Optional - Custom ID event properties. - **customIDUserProperties** (object) - Optional - Custom ID user properties. - **requestTimeout** (number) - Optional - Timeout for requesting configuration plug-in (Default 60000 milliseconds). ### Request Example ```json { "appKey": "666666", "userId": "888888", "config": { "debugModel": true, "remoteConfig": { "pollingInterval": 30, "enable": true, "mergeType": 1, "customIDProperties": { "a": 1 }, "customIDEventProperties": { "e": 1 }, "customIDUserProperties": { "u": 1 } }, "multilinkTestConfig": { "enable": true, "isSetMask": true, "maskTimeoutCloseTime": 500, "customIDProperties": { "a": 1 }, "customIDEventProperties": { "e": 1 }, "customIDUserProperties": { "u": 1 } } } } ``` ``` -------------------------------- ### Initialize SolarEngine SDK Source: https://help.solar-engine.com/en/docs/Unity-SDK-Integration-Guide Initializes the SolarEngine SDK with an AppKey and configuration object. `preInitSeSdk` should be called first. ```APIDOC ## Initialize SolarEngine SDK ### Description Initializes the SolarEngine SDK with an AppKey and configuration object. `preInitSeSdk` should be called first. ### Method Signature ```csharp public static void initSeSdk(string appKey, SEConfig seConfig) ``` ### Parameters #### Path Parameters - **appKey** (String) - Required - AppKey you obtained in Step 1 - **seConfig** (SEConfig) - Required - SolarEngine SDK configuration ### SEConfig Parameter Description #### Parameters - **logEnabled** (bool) - Optional - Whether to enable debugging logs (Default false). Platforms: iOS/Android/MiniGame - **isEnable2GReporting** (bool) - Optional - Whether to enable data reporting in 2G environment (Default false). Platforms: iOS/Android - **isDebugModel** (bool) - Optional - Whether to enable Debug mode (Default off). Platforms: iOS/Android/MiniGame - **isGDPRArea** (bool) - Optional - If your product is operated within the EU region, set to true if users reject device information collection (Default false). Platforms: iOS/Android - **adPersonalizationEnabled** (bool) - Optional - For EU region and Google advertising, indicates if users allow Google to use their data for ad personalization (Default false). Platforms: Android - **adUserDataEnabled** (bool) - Optional - For EU region and Google advertising, indicates if users allow personal data sharing with Google (Default false). Platforms: Android - **isCoppaEnabled** (bool) - Optional - Whether your app complies with Children's Online Privacy Protection Rule ("COPPA") (Default false). Platforms: iOS/Android - **isKidsAppEnabled** (bool) - Optional - Whether your app targets kids under 13 and needs to be marked as "Kids App" (Default false). Platforms: iOS/Android - **attAuthorizationWaitingInterval** (int) - Optional - Supports ATT Authorization Waiting for up to 120 seconds on iOS for the first event report (Unit: second). Platforms: iOS - **fbAppID** (string) - Optional - Meta appid for Meta attribution. Only for Android. Platforms: Android - **deferredDeeplinkenable** (bool) - Optional - Whether to enable deferred deep linking (Default False). Platforms: iOS/Android - **authorizationTimeout** (int) - Optional - Maximum waiting time for user authorization results in milliseconds. Platforms: HarmonyOS - **enableIPV6** (bool) - Optional - Set to false to disable IPv6 addresses (Default: true). Platforms: iOS/Android/HarmonyOS - **isOAIDEnabled** (bool) - Optional - Whether to allow collection of OAID (Default: true). Platforms: Android - **isImeiEnabled** (bool) - Optional - Whether to allow collection of IMEI (Default: true). Platforms: Android - **isAndroidIDEnabled** (bool) - Optional - Whether to allow collection of Android ID (Default: true). Platforms: Android - **withDisableOAIDRetry** (bool) - Optional - Whether to disable retries for OAID retrieval (Default: false). Platforms: Android - **withDisableGAIDRetry** (bool) - Optional - Whether to disable retries for GAID retrieval (Default: false). Platforms: Android ### Request Example ```csharp SEConfig seConfig = new SEConfig(); seConfig.logEnabled = true; SolarEngine.Analytics.initSeSdk("appkey", seConfig); ``` ### Response Initialization results are tracked via the `initCompletedCallback` in `SEConfig`. ``` -------------------------------- ### Install SolarEngine React Native Plugin Source: https://help.solar-engine.com/en/docs/RN-SDK-Quick-Integration Install the SolarEngine React Native plugin using npm or yarn in your project's root directory. ```APIDOC ## Install SolarEngine React Native Plugin ### Description Install the SolarEngine React Native plugin using npm or yarn in your project's root directory. ### Commands **Using npm:** ```bash npm install solarengine-analysis-react-native ``` **Using yarn:** ```bash yarn add solarengine-analysis-react-native ``` ### Note React Native version 0.60 and above supports autolinking, so the `react-native link` command is not necessary. ``` -------------------------------- ### Sample Code for Retrieving and Logging Preset Properties Source: https://help.solar-engine.com/en/docs/Preset-Event-Properties-jg2G This sample demonstrates how to call the retrievePresetProperties function and log specific properties like package name, app name, and screen height. Ensure the 'SolarEngine' object is available in your scope. ```javascript let presetProperties = SolarEngine.retrievePresetProperties(); const object = presetProperties as { _package_name: string; _app_name: string, _screen_height: number}; console.log("_package_name:" + object._package_name); console.log("_app_name:" + object._app_name); console.log("_screen_height:" + object._screen_height); ``` -------------------------------- ### Sample Code to Get Distinct ID Source: https://help.solar-engine.com/en/docs/Get-distinctid-2kji This Objective-C sample demonstrates how to import the SDK, get the distinct ID using the `getDistinctId` method, and log the result. Ensure the SolarEngineSDK framework is imported. ```objectivec #import NSString *distinctId = [[SolarEngineSDK sharedInstance] getDistinctId]; NSLog(@"distinctId = %@",distinctId); ``` -------------------------------- ### Initialize SDK Source: https://help.solar-engine.com/en/docs/Uniapp-SDK-Quick-Integration This section details how to initialize the SolarEngine SDK with various parameters and callbacks. ```APIDOC ## Initialize SDK ### Description Initializes the SolarEngine SDK with the provided AppKey, configuration object, and optional callbacks. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **appKey** (string) - Required - The unique AppKey for your application. - **config** (object) - Required - The SolarEngine SDK configuration object. - **logEnabled** (bool) - Optional - Whether to enable debugging logs (default off). - **isDebugModel** (bool) - Optional - Whether to enable Debug mode (default off). - **isGDPRArea** (bool) - Optional - Set to true if your product operates within the EU region and users reject device information collection (default false). - **adPersonalizationEnabled** (bool) - Optional - For EU region products advertised on Google, indicates if users allow Google to use data for ad personalization. - **adUserDataEnabled** (bool) - Optional - For EU region products advertised on Google, indicates if users allow personal data to be shared with Google. - **isCoppaEnabled** (bool) - Optional - Whether your app complies with the Children's Online Privacy Protection Rule (default false). - **isKidsAppEnabled** (bool) - Optional - Whether your app is targeting kids under 13 and needs to be marked as "Kids App" (default false). - **ios** (string) - Optional - iOS specific configuration. - **remoteconfig** (object) - Optional - Online Parameter initialization config. - **attAuthorizationWaitingInterval** (int) - Optional - Supports ATT Authorization Waiting for up to 120 seconds on iOS. - **logEnabled** (bool) - Optional - Whether to enable debugging logs (default false). - **enable** (bool) - Optional - Whether to enable online parameter function (default false). - **mergeType** (number) - Optional - Configuration merge type (0 or 1). - **customIDProperties** (object) - Optional - Custom ID properties. - **customIDEventProperties** (object) - Optional - Custom ID event properties. - **customIDUserProperties** (object) - Optional - Custom ID user properties. - **initCallbackCode** (callback(number)) - Optional - Callback function for initialization status. - **attrCallback** (callback(object)) - Optional - Callback function for attribution. ### Request Example ```javascript 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; ``` ### Response #### Success Response (200) No specific success response body is defined, but callbacks provide status information. #### Response Example None ``` -------------------------------- ### Objective-C Sample Code for Clearing App Start Event Properties Source: https://help.solar-engine.com/en/docs/Preset-Events-C6HD This sample shows how to clear custom properties for the App Start event by passing nil as the properties value. This action only affects the specified event type. ```objective-c [[SolarEngineSDK sharedInstance] setPresetEvent:SEPresetEventTypeAppStart withProperties:nil] ``` -------------------------------- ### Initialize SolarEngine SDK Source: https://help.solar-engine.com/en/docs/Unity-SDK-Integration-Guide Initializes the SolarEngine SDK with the provided app key and configuration. Ensure you have obtained your AppKey from Step 1. ```csharp SEConfig seConfig = new SEConfig(); seConfig.logEnabled = true; SolarEngine.Analytics.initSeSdk("appkey",seConfig); ``` -------------------------------- ### Initialize Solar Engine SDK with Debug Mode Source: https://help.solar-engine.com/en/docs/Debug-Mode-lsJe This sample code demonstrates how to initialize the Solar Engine SDK, including building the initial configuration with debug mode enabled and setting up the app key based on the platform. The `initialize` function takes the app key, initialization options, and a completion callback. ```typescript function buildInitialConfig():se_initial_config{ let config:se_initial_config = { ... enableDebug: true, ... }; return config; } async function Initiate(){ log("Initiate" ); let appKey = ""; if (Platform.OS === 'ios') { appKey = "07df077973a84ea7"; } else if (Platform.OS === 'android') { appKey = "e62fe50b80fc6e5c"; } let config:se_initial_config = buildInitialConfig(); let initiateOptions:SolarEngineInitiateOptions = { config:config, ... } SolarEngine.initialize(appKey,initiateOptions,(result:InitiateCompletionInfo) => { if (result.success) { Alert.alert('SDK Initiate Complete!') } }); ``` -------------------------------- ### Get Preset Properties Source: https://help.solar-engine.com/en/docs/Flutter-SDK-Integration-Documentation Obtain preset property information from the SDK. ```APIDOC ## Get Preset Properties ### Description Obtain preset property information from the SDK. ### Method Signature ```dart static Future getPresetProperties() async ``` ### Return Value - `Future`: A future that resolves to a map containing preset property information. ### Returned Fields - `_appkey` (string): The AppKey assigned by SolarEngine (SE). - `_distinct_id` (string): Device ID generated by SE. - `_account_id` (string): The account ID passed in by the developer through the login interface. - `_visitor_id` (string): The visitor ID passed in by the developer through the setVisitorID interface. - `_session_id` (string): The session ID generated within SE for each cool start. - `_uuid` (string): Device UUID (Android only). - `_imei` (string): Device IMEI (Android only). - `_imei2` (string): Device IMEI2 (Android only). - `_gaid` (string): GAID (Android only). - `_oaid` (string): OAID (Android only). - `_idfa` (string): IDFA (iOS only). - `_idfv` (string): IDFV (iOS only). - `_android_id` (string): Android ID (Android only). - `_ua` (string): Device UA. - `_language` (string): The language of the device's system settings. - `_time_zone` (string): Device time zone. - `_manufacturer` (string): Device manufacturer. - `_platform` (integer): SDK platform (1: Android, 2: iOS). - `_os_version` (string): Device system version. - `_screen_height` (integer): Screen height. - `_screen_width` (integer): Screen width. - `_density` (double): Screen density (Android only). - `_device_model` (string): Device model. - `_device_type` (integer): Device type (1: Android phone, 2: Android pad, 3: iPhone, 4: iPad, 0: Other). - `_app_version` (string): Application version number. - `_app_version_code` (string): Application build number. - `_package_name` (string): Application package name. - `_app_name` (string): Application name. - `_channel` (string): Channel name (Default AppStore for iOS). - `_lib` (integer): SDK library type (1: Android, 2: iOS). - `_lib_version` (string): SDK version number. ### Example Usage ```dart var properties = await SolarEngine.getPresetProperties(); print(properties.toString()); ``` ``` -------------------------------- ### Initialize SDK with GDPR Settings (Sample Code) Source: https://help.solar-engine.com/en/docs/GDPR This sample code demonstrates how to initialize the SolarEngine SDK with GDPR settings enabled. It includes necessary imports and the builder pattern for configuration. ```java import com.reyun.solar.engine.SolarEngineConfig; SolarEngineConfig config = new SolarEngineConfig.Builder() .isGDPRArea(true) .adPersonalizationEnabled(true) .builder.adUserDataEnabled(true) .build(); ``` -------------------------------- ### eventStart Source: https://help.solar-engine.com/en/docs/Duration-Event Starts timing for an event. Call this method when an event begins. ```APIDOC ## eventStart ### Description Starts timing for an event. Call this method when an event begins. ### Method Objective-C ### Endpoint N/A (SDK Method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```objectivec [[SolarEngineSDK sharedInstance] eventStart:@"Enter_Shop"]; ``` ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### Initialize SDK with Deferred Deep Linking Enabled Source: https://help.solar-engine.com/en/docs/Deferred-Deep-Linking-17ZO Enable deferred deep linking and set up a callback handler before initializing the SDK. Ensure 'deferredDeeplinkenable' is set to true in SEConfig. ```csharp SolarEngine.Analytics.preInitSeSdk("appkey"); SEConfig sE = new SEConfig(); sE.logEnabled = true; sE.deferredDeeplinkenable = true; //It must be enabled, otherwise the deeplink callback cannot be listened SolarEngine.Analytics.delayDeeplinkCompletionHandler(deferredDeeplinkCallback); //It must be enabled before initialization, otherwise the deeplink callback cannot be listened SolarEngine.Analytics.initSeSdk("appkey", sE); ``` -------------------------------- ### Initialize SolarEngine SDK with Callback Source: https://help.solar-engine.com/en/docs/Unity-SDK-Integration-Guide Pre-initializes the SDK and then initializes it with a custom callback to track initialization results. The `preInitSeSdk` function must be called first. The `onInitCallback` receives a status code indicating success or failure. ```csharp //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 } ``` -------------------------------- ### Get Distinct ID Source: https://help.solar-engine.com/en/docs/Get-distinctid-k3oS This function is used to obtain the distinct_id of the current device. ```APIDOC ## Get distinct_id ### Description This function is used to obtain the distinct_id of the current device. ### Method JavaScript SDK ### Endpoint solarengine.getDistinctId() ### Request Example ```javascript const distinctId = solarengine.getDistinctId(); ``` ### Response #### Success Response - **distinctId** (string) - The unique identifier for the current device. ``` -------------------------------- ### Load SDK Plugins Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Employ the `use` method during SDK initialization to load any necessary SDK plugins. ```javascript SESDK.use(sdkPlugin); ``` -------------------------------- ### Report Duration Event Source: https://help.solar-engine.com/en/docs/Calculate-Event-Duration Reports a duration event that was previously started with createTimerEvent. ```APIDOC ## trackTimerEvent ### Description Reports a duration event, completing the timing measurement started by `createTimerEvent`. ### Method ```java public synchronized void trackTimerEvent(TrackEvent trackEvent) ``` ### Parameters #### Path Parameters - **trackEvent** (TrackEvent) - Required - The TrackEvent object obtained from `createTimerEvent`. ### Request Example ```java // Assuming 'trackEvent' is an instance obtained from createTimerEvent SolarEngineManager.getInstance().trackTimerEvent(trackEvent); ``` ### Note When reporting the preset event `_appEnd`, the duration from the last `_appStart` is reported by default. No explicit timing configuration is needed for exit events. ``` -------------------------------- ### Configure AndroidManifest.xml for App Links Source: https://help.solar-engine.com/en/docs/Deep-Linking Example of how to configure your AndroidManifest.xml to handle App Links. ```APIDOC ## Configure AndroidManifest.xml for App Links ### Description This configuration enables your app to handle App Links, which provide a seamless transition from web to app. ### Method Not applicable (XML configuration) ### Endpoint Not applicable (XML configuration) ### Parameters Not applicable (XML configuration) ### Request Example Not applicable (XML configuration) ### Response Not applicable (XML configuration) ### Code Example ```xml ``` ``` -------------------------------- ### Initialize SDK and Set Attribution Callback Source: https://help.solar-engine.com/en/docs/Uniapp-SDK-Quick-Integration Initializes the SDK and sets up an asynchronous callback to receive attribution results. Use this when you need to be notified when attribution data is available. ```javascript 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) } }); ``` -------------------------------- ### Get Account ID with SESDK Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Retrieve the current account ID using the `getAccountId` method. ```javascript SESDK.getAccountId(); ``` -------------------------------- ### SDK Initialization Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Instructions for importing and initializing the SolarEngine Web SDK using UMD or ES formats. It includes pre-initialization with `prevInit` and main initialization with `init`, along with mounting the SDK globally. ```APIDOC ## SDK Initialization It is recommended to import and initialize the SDK **before any other methods** to ensure accurate data initialization. Before initializing the SDK, you must perform pre-initialization by calling the `prevInit` method and passing in your appKey. The SDK is provided in both UMD and ES formats. Commonly used loading methods are listed below: **Note:** The SDK should be imported only once per project. After importing the SDK, it is recommended to mount it globally (e.g., on window) for use elsewhere. For development environments using ES Modules, import the ES format file. Otherwise, import the UMD format file. ### UMD/ES Module Import ```javascript import SESDK from './web-cn-sesdk-umd.js'; // If your build environment enforces ES Modules, please import the ES format file. // import SESDK from './web-cn-sesdk-es.js' // Some platforms only support CommonJS imports, in which case please use require. // const SESDK = require('./web-cn-sesdk-umd.js') // Pre-initialization SESDK.prevInit(appKey); // Initialization SESDK.init(initParams); // Mount to global (e.g., window) for use elsewhere window.SESDK = SESDK; ``` ### Script Tag Import ```html // Pre-initialization window.SESDK.prevInit(appKey); // Initialization window.SESDK.init(initParams); ``` ### initParams Parameter Description Parameter| Type| Required| Description ---|---|---|--- userId| string| YES| UserCode obtained above appKey| string| YES| AppKey obtained above config| config| NO| Initialization related config ### Config Parameter Description Parameter| Type| Required| Description ---|---|---|--- debugModel| boolean| NO| Whether to enable the debugging mode (Default false) logEnabled| boolean| NO| Whether the console prints SDK logs (Default false) isInApp| boolean| NO| Whether to embed App scenes (Default false) ### Initialization Code Example ```javascript SESDK.prevInit('666666'); SESDK.init({ appKey: '666666', userId: '888888', config: { logEnabled: true, }, }); ``` ``` -------------------------------- ### Get Visitor ID with SESDK Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Retrieve the current visitor ID using the `getVisitorId` method. ```javascript SESDK.getVisitorId() ``` -------------------------------- ### Pre-Initialize SDK (C#) Source: https://help.solar-engine.com/en/docs/Unity-SDK-Integration-Guide Call this static method during the application's first launch after installation to pre-initialize the SolarEngine SDK. This process does not collect personal information or report data. ```csharp public static void preInitSeSdk(string appKey) ``` ```csharp SolarEngine.Analytics.preInitSeSdk("appkey"); ``` -------------------------------- ### Initialize SolarEngine SDK with Callback Source: https://help.solar-engine.com/en/docs/Flutter-SDK-Integration-Documentation Use this method to initialize the SolarEngine SDK and receive a callback indicating the initialization status. Ensure the appkey and config are correctly provided. ```dart static void initializeWithCallbacK(String appkey, SolarEngineConfig config, OnInitializationCallback callback) ``` ```dart String appkey = ""; SolarEngineConfig config = SolarEngineConfig(); config.logEnabled = true; SolarEngine.initializeWithCallbacK(appkey, config, (int? code) { // Initialization callback if (code == 0) { // Initialization success print("Initialization success"); } else { // Initialization failed print(code); } } ); ``` -------------------------------- ### Get Visitor ID Source: https://help.solar-engine.com/en/docs/Visitor-ID Call getVisitorId to retrieve the current visitor ID that has been set for the user. ```APIDOC ## Get Visitor ID ### Description Retrieves the current visitor ID set for the user. ### Method Objective-C ### Code ```objectivec NSString *visitorId = [[SolarEngineSDK sharedInstance] visitorID]; ``` ``` -------------------------------- ### Initialize Web SDK (UMD/ES/CommonJS) Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Import and initialize the SolarEngine SDK. Use the ES format for ES Modules environments, UMD for others, and CommonJS for platforms that only support it. Mount the SDK globally for wider accessibility. ```javascript import SESDK from './web-cn-sesdk-umd.js'; // If your build environment enforces ES Modules, please import the ES format file. // import SESDK from './web-cn-sesdk-es.js' // Some platforms only support CommonJS imports, in which case please use require. // const SESDK = require('./web-cn-sesdk-umd.js') // Pre-initialization SESDK.prevInit(appKey); // Initialization SESDK.init(initParams); // Mount to global (e.g., window) for use elsewhere window.SESDK = SESDK; ``` -------------------------------- ### Get Distinct ID Source: https://help.solar-engine.com/en/docs/Get-distinctid Retrieves the currently set distinct_id. Returns null if no distinct_id has been set. ```APIDOC ## Get distinct_id ### Description Retrieves the currently set distinct_id. Returns null if no distinct_id has been set. ### Function Signature ```java public String getDistinctId(); ``` ### Sample Code ```java import com.reyun.solar.engine.SolarEngineManager; String distinct_id = SolarEngineManager.getInstance().getDistinctId(); ``` ``` -------------------------------- ### Get Account ID Source: https://help.solar-engine.com/en/docs/Account-ID-BpEr Call getAccountId to retrieve the current user's account ID. ```APIDOC ## Get Account ID ### Description Call getAccountId to get the user's account ID. ### Function Signature ```csharp public static string getAccountId() ``` ### Returns * (string) - The current user's account ID. ### Sample Code ```csharp string accountId = SolarEngine.Analytics.getAccountId(); ``` ``` -------------------------------- ### Sample Code to Get Preset Properties Source: https://help.solar-engine.com/en/docs/Get-Preset-Properties This Objective-C sample code demonstrates how to call the getPresetProperties method and log the returned properties dictionary. Ensure the SolarEngine SDK is initialized before calling this method. ```objective-c NSDictionary *properties = [[SolarEngineSDK sharedInstance] getPresetProperties]; NSLog(@"properties = %@",properties); ``` -------------------------------- ### Get Account ID Source: https://help.solar-engine.com/en/docs/Account-ID-Vt4R Call `getAccountId` to retrieve the current user's account ID. ```APIDOC ## Get Account ID ### Description Retrieves the current user's account ID. ### Function Signature ```javascript const accountId = solarengine.getAccountId() ``` ### Returns - **accountId** (string) - The current user's account ID. Returns an empty string if no account ID is set. ``` -------------------------------- ### Get distinct_id Function Signature Source: https://help.solar-engine.com/en/docs/Get-distinctid This is the function signature for retrieving the distinct_id. It returns null if the distinct_id has not been set. ```java public String getDistinctId(); //Return the currently set distinct_id, return null if not set ``` -------------------------------- ### Initialize Web SDK (HTML Script Tag) Source: https://help.solar-engine.com/en/docs/Web-SDK-Integration-Documentation Load the SolarEngine SDK using a script tag in HTML and initialize it via the global `window.SESDK` object. Ensure the script is loaded before calling initialization methods. ```html // Pre-initialization window.SESDK.prevInit(appKey); // Initialization window.SESDK.init(initParams); ``` -------------------------------- ### Get Account ID Source: https://help.solar-engine.com/en/docs/Account-ID Call the `accountID` property to retrieve the current user's account ID. ```APIDOC ## Get Account ID ### Description Call the `accountID` property to get the user's account ID. ### Method Objective-C ### Code ```objectivec NSString *accountID = [[SolarEngineSDK sharedInstance] accountID]; ``` ``` -------------------------------- ### Initialize SDK Source: https://help.solar-engine.com/en/docs/iOS-SDK-Integration-Documentation Initializes the SDK with the provided app key and configuration. Ensure user privacy policy agreement and successful pre-initialization before calling this method. ```APIDOC ## Initialize SDK Before formal initialization, you should ensure that the user has agreed to the Privacy Policy and the SDK is pre-initialized successfully. ```objective-c - (void)startWithAppKey:(nonnull NSString *)appKey config:(SEConfig *)config; ``` ### Parameters | Parameter | Data Type | Required | Note | |---|---|---|---| | appKey | NSString | YES | appkey obtained from SolarEngine dashboard | | config | SEConfig | NO | initialization config, default values if not set additionally | ### Sample Code ```objective-c SEConfig *config = [[SEConfig alloc] init]; config.logEnabled = YES; //Enable local debugging logs [[SolarEngineSDK sharedInstance] startWithAppKey:your_appKey config: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 | | 110 | SDK failed to load configuration | ```objective-c [[SolarEngineSDK sharedInstance] setInitCompletedCallback:^(int code) { if (code == 0) { // Initialization success NSLog(@"InitCompletedCallback success"); } else { // Initialization failed NSLog(@"InitCompletedCallback code = %d",code); } }]; ``` ``` -------------------------------- ### Unity iOS Simulator Debugging Setup Source: https://help.solar-engine.com/en/docs/Troubleshooting Instructions for configuring the Unity environment to debug using the iOS simulator by replacing specific .xcframework files with their simulator-compatible counterparts. ```text Replace "Assets/Plugins/iOS/framework/SolarEngineSDK.xcframework/ios-arm64" in your Unity project with "SolarEngineSDK.xcframework/ios-x86_64-simulator". Similarly, replace the Unity peoject's "Assets/Plugins/iOS/framework/SESDKRemoteConfig.xcframework/ios-arm64" with "SESDKRemoteConfig.xcframework/ios-x86_64-simulator". ``` -------------------------------- ### Get Account ID Source: https://help.solar-engine.com/en/docs/Account-ID-oJHZ Call the `getAccountId` function to retrieve the current user's account ID. ```APIDOC ## Get Account ID ### Description Retrieves the currently set account ID for the user. ### Return Value * **string** - The current account ID, or null if not set. ### Call Example ```javascript const accountId = solarengine.getAccountId(); ``` ``` -------------------------------- ### Set Channel Property Source: https://help.solar-engine.com/en/docs/Set-Channel-Property This property is used to identify different channels from which your app is installed. By setting channel names by yourself, you can track the source of installations and better understand your users. It is recommended to call the setChannel interface before initializing the SDK. If you do not pass a channel name or pass a null channel name, the SDK will automatically collect the channel name, which may result in a null value. ```APIDOC ## Set Channel Property ### Description This property is used to identify different channels from which your app is installed. By setting channel names by yourself, you can track the source of installations and better understand your users. It is recommended to call the setChannel interface before initializing the SDK. If you do not pass a channel name or pass a null channel name, the SDK will automatically collect the channel name, which may result in a null value. ### Function Signature ```java public void setChannel(String channel); ``` ### Parameters #### Path Parameters - **channel** (String) - Required - The name of the channel. ### Request Example ```java import com.reyun.solar.engine.SolarEngineManager; SolarEngineManager.getInstance().setChannel("xiaomi"); ``` ``` -------------------------------- ### Initialize SolarEngine SDK (without Online Parameter SDK) Source: https://help.solar-engine.com/en/docs/Flutter-SDK-Integration-Documentation Use this method for basic initialization when A/B testing and online parameter functions are not required. Configure logging and attribution callbacks. ```dart static void initializeWithAppkey(String appkey, SolarEngineConfig config) ``` ```dart String appkey = ""; SolarEngineConfig config = SolarEngineConfig(); config.logEnabled = true; config.onAttributionSuccess = (data) { print(data); }; config.onAttributionFail = (code) { print(code); }; SolarEngine.initialize(appkey, config); ``` -------------------------------- ### Verify Multi-Process Configuration via Logcat Source: https://help.solar-engine.com/en/docs/Config-multi-process After configuration, check logcat for this log message to confirm successful multi-process setup. Look for `isSupportMultiProcess: true` and `isContentProviderAvailable: true`. ```logcat SolarEngineSDK init success by appKey: {your app key} sessionId: {current session id} package: {your package name} isMainProcess: {main process} isSupportMultiProcess: true isDebug:{debug state} isContentProviderAvailable: true ```