Menu

Flutter SDK

1. SDK Basic Information

SolarEngine (SE) is an all-in-one mobile app growth analytics and publishing intelligent decision-making 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.

This documentation provides instructions for data reporting on the Flutter SDK side.

Privacy Policy:  https://www.solar-engine.com/privacyPolicyEN.html


Note:

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


2. Before you start

Before officially starting data access, there are some parameters and SDK packages required. Follow the directions below to get prepared.

2.1. Get AppKey

Entry: Asset Management - App Management - AppKey

2.2. Obtain SDK

      Please add the following content to the  pubspec.yaml  file of your Flutter project:

 dependencies: 
     se_flutter_sdk_us: ^1.5.5

SDK Demo Download Address

3. SDK Integration

3.1. Android dependencies

       After integrating SE Flutter SDK, if you need to upgrade the Android SDK, find the build.gradle file in the Android lib directory in the Flutter Plugins directory under the Flutter project and modify the configuration. The specific operations are as follows:

implementation 'com.reyun.solar.engine.oversea:solar-engine-core:1.3.1.1'


       If you use the Parameter Delivery SDK (for A/B Testing and Remote Config features in SE), you need to add the following configuration:

implementation 'com.reyun.solar.engine.oversea:solar-remote-config:1.3.1.1'

The path is as shown below:

   If using gradle to pull the code fails, you need to add the maven warehouse configuration to the build.gradle  file in the project root directory. The specific configuration is as follows:

maven {
       url "https://maven-android.solar-engine.com/repository/se_sdk_for_android/"
 }

      If you need to obtain OAID, you shall add the following dependency in the baseProjectTemplate.gradle file in your project.

implementation 'com.reyun.solar.engine:se-plugin-oaid:1.3.1.1'

      And please add the following Maven repository in your build.gradle file:

maven { 
    url "https://developer.huawei.com/repo/"
 } 
maven { 
    url 'https://developer.hihonor.com/repo' 
}


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.** { *; }
# If the OAID plugin is used, please add the following obfuscation strategy:

-keep class com.huawei.hms.**{*;}
-keep class com.hihonor.**{*;}

3.2. iOS Dependencies

   Using pod integration on iOS does not require manual setting of dependencies.

3.3. Initialize SDK

  The SolarEngine SDK provides two initialization methods, allowing developers to choose whether to integrate the Online Parameter SDK in their projects. In this context, "SEConfig" represents the configuration parameters for the SolarEngine SDK, while "RCConfig" represents the configuration parameters for the Online Parameter SDK.

3.3.1. Initialize SDK

Pre-Initialization

      When the application is first launched after installation, the SDK is pre-initialized. During pre-initialization, the SDK does not collect any personal information or report data to SolarEngine.

Method example:

static void preInitialize(String appkey)

Call example:

String appkey = ""; 
SolarEngine.preInitialize(appkey);

3.3.1.1. Initialization (without Online Parameter SDK)

      If you do NOT want to use A/B testing and online parameter functions in SolarEngine, you can select this initialization method (without online parameter SDK).

Method example

static void initializeWithAppkey(String appkey, SolarEngineConfig config)

Parameter Description:

Parameter Name Parameter MeaningParameter TypeMandatory
appKeyObtained from the SolarEngine background.String yes
configSolarEngine SDK configuration itemsSolarEngineConfig yes


SolarEngineConfig parameter description

Parameter name Parameter Meaning Parameter TypeMandatory
logEnabled Whether to enable log printing (default off) bool no
isGDPRArea Whether it is a GDPR area (default false) bool no
adPersonalizationEnabled Whether users allow Google to use their data for ad personalization. This field only applies to Android but not iOS. It won't be reported if not set. bool no
adUserDataEnabled Whether users allow their personal data to be shared with Google. This field only applies to Android but not iOS. It won't be reported if not set. bool no
isDebugModel Whether to enable Debug mode (default off) bool no
remoteConfigData Online parameter configuration SERemoteConfigData no
OnAttributionSuccess Attribution success callback Callback no
OnAttributionFail Attribution failure callback Callback no
isCoppaEnabledWhether your app is required to comply with Children's Online Privacy Protection Rule ("COPPA"). Default false. bool no
isKidsAppEnabledWhether your app is targeting kids under 13 years old and needs to be marked as "Kids App" category. Default false. bool no
attAuthorizationWaitingIntervalSupport ATT Authorization Waiting Interval (up to 120 seconds) the first time iOS reports event. Events will not be reported until user authorizes ATT or waiting time is out.intno
fbAppID If overseas developers need to use meta attribution, set meta appid here.stringno
enableDelayDeeplinkWhether to enable deferred deep linking, default NO.boolno


Call example

String appkey = "";
SolarEngineConfig config = SolarEngineConfig();
config.logEnabled = true;
config.onAttributionSuccess = (data) {
  print(data);
};
config.onAttributionFail = (code) {
  print(code);
};
SolarEngine.initialize(appkey, config);

3.3.1.2. Initialization (with Online Parameter SDK)

       If you need to use A/B testing and online parameter functions in SolarEngine, you should select this initialization method (with online parameter SDK).

RCConfig parameter description

Parameter Name Parameter Meaning Parameter TypeMandatory
enable Whether to enable the online parameter SDK (default disabled) bool yes
mergeType SDK configuration merge strategy. By default, the server configuration is merged with the local cache configuration. MergeType no
customIDProperties Custom ID, which matches the custom ID set by the user in the background. Map<String, dynamic> no
customIDEventProperties The custom ID event attribute value, which matches the custom ID event attribute value set by the user in the background. Map<String, dynamic> no
customIDUserProperties The custom ID user attribute value, which matches the custom ID user attribute value set by the user in the background. Map<String, dynamic> no
customIDDeviceProperties The custom ID device attribute value, which matches the custom ID device attribute value set by the user in the background. Map<String, dynamic> no


mergeType (merge strategy) introduction:

Parameter Parameter meaning
WITH_USER When the app is launched for the first time or the version is updated, use the server configuration to merge with the user's default configuration. This method can clear the local cache configuration.
WITH_CACHE Use the server configuration to merge with the user's local cache configuration. The online parameter SDK uses default merge strategy.


Call example

String appkey = "";
String userId = "";
SolarEngineConfig config = SolarEngineConfig();
config.logEnabled = true;
SERemoteConfigData rcConfig = SERemoteConfigData();
rcConfig.enable = true;
rcConfig.logEnabled = true;
rcConfig.customIDProperties = {
  "key": "customID",
  "value": "androidID"
};
rcConfig.customIDEventProperties = {
  "key": "customEventID",
  "value": "_appStart"
};
rcConfig.customIDUserProperties = {
  "key": "customUserID",
  "value": "Topic"
};
config.remoteConfigData = rcConfig;
SolarEngine.initialize(appkey, userId, config);

3.3.1.3. Initialization Callback

       Here are the initialization callback codes and their meanings.

0:  Initialization success

101:  SDK is not pre-initialized

102:  Illegal appkey

103:  Null context (Android only)

104:  Failed generating distinct_id (Android only)

static void initializeWithCallbacK(String appkey, SolarEngineConfig config,    OnInitializationCallback callback)

Call Example

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);    
        }  
    }
);

3.3.2 About GDPR

     When it comes to EU user personal information processing, the SolarEngine SDK will automatically collect certain fields such as GAID, IMEI, IMEI2, and Android ID. However, according to the EU privacy policy, if EU users disagree with their personal data collection, developers need to disable the sensitive data collection in their SDK.

      Please follow the procedures below to set up GDPR during SDK initialization:

1. When users reject their sensitive information being collected, please disable related data collection function by adding isGDPRArea(true) in SDK initialization.

2. Ensure that users won't trigger any privacy-related events before obtaining their legally valid consent.

3. Clarify the EU users personal data processing policy and practice in your privacy policy.

   If your product is operated within the EU region and advertised on Google, please make sure to send this parameter, so that you will comply with Google's EU user consent policy.

Note:

      According to the GDPR, only when end users clearly reject their personal information being collected, you will need to set isGDPRArea(true) to stop SDK from collecting privacy-related fields.

3.3.2.1 Set GDPR During Initialization

    To comply with the upcoming Digital Markets Act (DMA), Google has updated their consent mode for traffic in European Economic Area (EEA). SolarEngine also took action to adapt to the new updates.

Here is a comparison:

SE ParameterGoogle ParameterValueMeaningFailure Reminder
_isGDPRAreaeeatrue/falseWhether users allow their private information being collected.
_ad_personalization_enabled ad_personalization true/falseWhether users allow Google to use their data for ad personalization.The value of "_ad_personalization_enabled" cannot be empty.
_ad_user_data_enabledad_user_datatrue/falseWhether users allow their personal data to be shared with Google.The value of "_ad_user_data_enabled" cannot be empty.


Call example:

SolarEngineConfig config = SolarEngineConfig();
config.isGDPRArea = true;
config.adPersonalizationEnabled = false;
config.adUserDataEnabled = false;
SolarEngine.initializeWithAppkey(appkey, config);

3.3.3.2 Set up GDPR via API

Method example

static void setGDPRArea(bool isGDPRArea)

Parameter Description

Parameter Parameter Meaning Parameter TypeMandatory
isGDPRArea Whether it is a GDPR region (default false) bool yes

Call example

SolarEngine.setGDPRArea(true);

3.3.3.3 Set ATT Authorization Waiting (iOS)

       If your app participates in attribution, you should set the ATT authorization waiting. During this time interval, the SDK will wait for the user to authorize ATT and obtain the IDFA before reporting the Install event, thereby increasing attribution accuracy. If the user has not authorized within the ATT authorization waiting interval, the SDK will still report the event, but the event will not include the IDFA field.

Sample Code

SolarEngineConfig config = SolarEngineConfig();
config.attAuthorizationWaitingInterval = 120; // Wait for at most 120 seconds.
SolarEngine.initializeWithAppkey(appkey, config);

3.4. Get distinct_id

Method example

static Future<String> getDistinctId()

The value returned will be the current "distinct_id". If no "distinct_id" exists, return "null".

Code example

 void getDistinctId() async{
      var distinctId = await SolarEngine.getDistinctId();
      print(distinctId);
 }

3.5. Visitor ID

     Visitor ID refers to the user's unique identifier (_visitor_id) after installing and before logging in.

     We provide an interface for developers to customize visitor IDs. If you have your own visitor management system and need to replace SolarEngine's visitor IDs, you should set it before initializing the SDK.

     During data reporting, only the latest visitor ID passed in will be used. Multiple calls should be avoided to prevent abnormal situations where multiple visitor IDs are reported consecutively.

3.5.1. Set visitor ID

Method example

static void setVisitorID(String visitorID)

Call example

SolarEngine.setVisitorID("xxxVisitorIDxxx");

Note:

1. This call only passes the visitor ID to the SDK and does not report events.

2. The length of the visitor ID set by the developer cannot exceed 128 characters, otherwise the setting will fail.

3.5.2. Obtain visitor ID

   Call getVisitorId to get the current visitor ID:

Method example

static Future<String> getVisitorID()

Return value: Returns the previously set visitor ID, default "".

Call example

void getVisitorId() async{
      var visitorID = await SolarEngine.getVisitorId();
      print(visitorID);
 }

3.6. Account ID

     Account ID refers to the unique identifier of the user's login account within the app. Prior to logging in, visitor IDs will be used as the user identifier.

     Once the account ID is set, it will be retained until the logout function is called to clear the account ID. The logout function should only be called when users actually log out, but not called when the app is closed or running in the background.

     During data reporting, only the latest account ID passed in will be used. Multiple calls should be avoided to prevent abnormal situations where multiple non-normal account IDs are reported consecutively.

3.6.1. Set account ID

Call the login method to set the user's account ID.

Note:

The length of the account ID set by the developer cannot exceed 128 characters, otherwise the setting will fail.

Method example

static void login(String accountID)

Call example

SolarEngine.login("xxxAccountIDxxx");

3.6.2. Obtain account ID

Call getAccountID to get the user's account ID.

Method example

static Future<String> getAccountID()

Return value: Returns the account ID that has been set, the default is ""

Call example

void getAccountID() async{
      var accountID = await SolarEngine.getAccountID();
      print(accountID);
 }

3.6.3. Clear account ID

Call logout to clear the account ID.

Method example

static void logout()

Call example

SolarEngine.logout();

Note: This call only notifies the SDK to clear the account ID and will not report the user logout event.

3.7. Public Event Properties

   Public event properties refer to the properties that are included in every event, such as the user's source channel and the advertising ID associated with conversions.

3.7.1. Set public event properties

   Call setSuperProperties to set public event properties.

Note:

  1. Public event properties will be saved in the cache and do not need to be called every time the app is launched.
  2. Calling the setSuperProperties method to upload previously set public event properties again will overwrite the previous properties.
  3. If a key in the public event properties overlaps with a property uploaded in an event report, the event's property will overwrite the public event property.
  4. It is recommended to set public event properties before SDK initialization using the initSeSdk method. This avoids potential issues where some reported events may not include the public event properties.
  5. Please do not use property keys that start with an underscore "_", otherwise, the property will be discarded.


Method example

static void setSuperProperties(Map<String, dynamic> superProperties)

Parameter Description

Parameter Parameter Meaning Parameter Type Mandatory
superProperties Developer-defined public event attribute dictionaryMap<String,dynamic> YES

Call example

Map<String, dynamic> properties = {};
properties['key1'] = 'String';
properties['key2'] = 2;
properties['key3'] = false;
SolarEngine.setSuperProperties(properties);

3.7.2. Clear defined public event properties

   Call the unsetSuperProperty method to clear a public event property of the specified key value

Method example

static void unsetSuperProperty(String key)

Call example

SolarEngine.unsetSuperProperty("K3");

3.7.3. Clear all public event properties

   Call the clearSuperProperties method to clear all public event properties

Method example

static void clearSuperProperties()

Call example

SolarEngine.clearSuperProperties();

3.8. Obtain Attribution Results

   The SDK provides an interface for obtaining attribution result information. Developers can use the attribution information to perform operations like event tracking.

   The SDK provides two ways to obtain attribution result information:

1. Set the attribution results callback: When the SDK succeeds or fails in obtaining the attribution result, a callback will be given (this interface is an asynchronous callback).

2. Obtain the attribution results directly: Get the attribution results directly from the SDK cache. If the SDK has no attribution results yet, it will directly return null (this interface returns synchronously).

3.8.1. Set attribution result callback

    Set attribution callback in SEConfig:

Example code

String appkey = "";
String userId = "";
SolarEngineConfig config = SolarEngineConfig();
config.logEnabled = true;
config.onAttributionSuccess = (data) {
  print(data);
};
config.onAttributionFail = (code) {
  print(code);
};
SolarEngine.initialize(appkey, userId, config);

3.8.2. Directly get attribution result callbacks

static Future<String> getAttribution()

Example code

void getAttribution() async{
      var attribution = await SolarEngine.getAttribution();
      print(attribution);
 }

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

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

3.8.3. Obtain Preset Property Information

Developers can obtain preset property information by calling this plugin.

Method example

static Future<Map> getPresetProperties() async

Example code

var properties = await SolarEngine.getPresetProperties();
print(properties.toString());

Returned fields:

Field NameDescription
_appkeyThe AppKey assigned by SolarEngine (SE)
_distinct_idDevice ID generated by SE
_account_idThe account ID passed in by the developer through the login interface
_visitor_idThe visitor ID passed in by the developer through the setVisitorID interface
_session_idThe session ID generated within SE for each cool start
_uuidDevice UUID (Android only)
_imeiDevice IMEI  (Android only)
_imei2Device IMEI2 (Android only)
_gaidGAID (Android only)
_oaidOAID (Android only)
_idfaIDFA (iOS only)
_idfvIDFV (iOS only)
_android_idAndroid ID (Android only)
_uaDevice UA
_languageThe language of the device's system settings
_time_zoneDevice time zone
_manufacturerDevice manufacturer
_platformSDK platform
1: Android
2: iOS
_os_versionDevice system version
_screen_heightScreen height
_screen_widthScreen width
_densityScreen density (Android only)
_device_modelDevice model
_device_typeDevice type
1: Android phone
2: Android pad
3: iPhone
4: iPad
0: Other
_app_versionApplication version number
_app_version_codeApplication build number
_package_nameApplication package name
_app_nameApplication name
_channelChannel name (Default AppStore for iOS)
_lib1: Android
2: iOS
_lib_versionSDK version number

4. Set Preset Event Custom Properties

   The SolarEngine SDK supports developers to set custom properties for three preset events: app startup, installation, and exit:    

Method example

static void setPresetEvent(PresetEventType presetEventType, Map<String, dynamic> customProperties)

Parameters:

Parameter NameParameter MeaningParameter TypeMandatory
preseteventTypePreset events, e.g.
AppInstall
AppStart
AppEnd
All
PresetEventTypeYes
propertiesCustom preset event properties sent by the developerMap<String,dynamic>No

Call example

Map<String, dynamic> customProperties = {};
customProperties['kind'] = 'setPresetEventProperties';
customProperties['name'] = "Jim";
SolarEngine.setPresetEventProperties(PresetEventType.All, customProperties);
  
// After calling setPresetEvent API,the _appInstall、_appStart and _appEnd events will have the custom properties set.

Note:

  • Preset event properties should be set before SDK initialization. In this way, the properties will apply to all subsequent preset events reported by the SDK. If set after SDK initialization, the preset events generated before setting will not include these custom properties.
  • Custom preset event properties are not cached. Only the last setting will take effect if multiple settings are made for the same preset event.
  • If the PresetEventType enumeration is set as PresetEventType.All, it will override the custom properties set through the PresetEventType.AppInstall, SEPresetEventType.AppStart, and PresetEventType.AppEnd enumerations. If set multiple times, only the last setting will be effective.
  • Please do not customize properties with a key starting with an underscore "_". The SE SDK will abandon properties like this.

5. Event Reporting

      After the SDK initialization is complete, you can call "track" to report data.

      By default, data is reported when the device is on 3G/4G/5G/WiFi, not when it's on 2G. You can change the setting through enable2GReporting.

      Only when 30 pieces of event data is cached, event reporting will be triggered, and the reporting interval should be within 30 seconds.

      Event reporting can be triggered immediately in the following cases:

1) When user switches into app background or switches back, events "_appStart" "_appEnd" will be generated and reported immediately after checking the cached events.

2) When the developer calls the "SDK reportEventImmediately" plug-in, event reporting starts immediately after checking the cached events.

Call example

SolarEngine.reportEventImmediately();

      The reported data can be categorized into the following four types:

1. Preset Events: These events are triggered and reported automatically by the SDK according to preset rules. They have specific _event_name such as installation, launch, exit, etc.

2. Predefined Events: These events have predefined meanings and event names in the system. They require developers to report data when the corresponding events occur, such as ad impressions, in-app purchases, etc.

3. Custom Events: These events can be custom defined by developers who need to instrument the code to trigger and report these events.

4. Duration Events: These events track the duration of a specific event.

Note:

   Please do not report custom properties starting with "_", otherwise SDK will abandon its value by default.

5.1. Preset events

Event NameEvent IdentifierDescription
App Install_appInstallAutomatically reported every time the app is installed and opened for the first time.
App Launch_appStartAutomatically reported every time the app is opened, either from a closed state or transitioning from the background to the foreground after being inactive for more than 30 seconds.
App Exit_appEndAutomatically reported every time the app is closed or when it remains inactive in the background for more than 30 seconds.

5.2. Predefined Events

5.2.1. Ad Impression

   Automatically reported when displaying ads within the app, which is essential for ROI analysis and monetization-related metrics in user analysis. (Event Name:  "_appImp")

Method example

static void trackAppImpress(SEAppImpressionData appImpressionData)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
appImpressionData A class that carries the attributes that need to be uploaded for in-app ad impression events. For details, please refer to the definition of the SEAppImpressionData class in the solar_engine.dart file. SEAppImpressionData yes

SEAppImpressionData parameter description:

Parameter NameParameter MeaningParameter TypeMandatory
adNetworkPlatformMonetization platform (Value: platform name)
csj: 穿山甲 China Mainland version
pangle: 穿山甲 international version
tencent: 腾讯优量汇
baidu: 百度百青藤
kuaishou: 快手
oppo: OPPO
vivo:vivo
mi: 小米
huawei: 华为
applovin: AppLovin
sigmob: Sigmob
mintegral:Mintegral
oneway: OneWay
vungle: Vungle
facebook: Facebook
admob: AdMob
unity: UnityAds
is: IronSource
adtiming: AdTiming
klein: 游可赢
fyber: Fyber
chartboost: Chartboost
adcolony: Adcolony
StringYes
adTypeAd types:
1:Rewarded Video
2:Splash
3:Interstitial
4:Fullscreen Video
5:Banner
6:Native
7:Native Video
8:Banner (MPU)
9:Instream Video
10:MREC
0:Other
intYes
adNetworkAppIDThe App ID on monetization platforms.String
adNetworkADIDThe Placement ID on monetization platforms.StringYes
mediationPlatformMediation platforms commonly used:
max
ironsource
admob
hyperbid
topon
cas
Tradplus
Tobid

If your mediation platform is not on the list, you can name it yourself, only that the name cannot exceed 32 characters.
Send "custom" if no mediation platform is used.
StringYes
ecpmAdvertising eCPM (revenue per thousand ad impressions, 0 or negative means no data transmitted), unit: yuandoubleYes
currencyTypeRevenue Currency Type (following ISO 4217)StringYes
isRenderSuccessWhether the ad is rendered successfully.
YES: success
NO: Failed.
If you do not need to pass in this indicator, please pass YES.
BooleanYes
customPropertiesCustom properties, string typeMap<String, dynamic>No

Call example

SEAppImpressionData appImpressionData =
SEAppImpressionData();
appImpressionData.adNetworkPlatform = "tencent";
appImpressionData.adType = 2;
appImpressionData.adNetworkAppID = "3SDFED";
appImpressionData.adNetworkADID = "22323";
appImpressionData.mediationPlatform = "toutiao";
appImpressionData.ecpm = 22.9;
appImpressionData.currencyType = "USD"; 
appImpressionData.isRenderSuccess = true;
appImpressionData.mediationPlatform = "custom";
Map<String, dynamic> customProperties = {};
customProperties['goods'] = 'shoes';
customProperties['goodsprice'] = 20;
customProperties['goodsaddress'] = "Beijing";
appImpressionData.customProperties = customProperties;
SolarEngine.trackAppImpress(appImpressionData);

// customProperties are not mandatory to be passed in.
// Note: Please do not set the key as starting with an underscore "_", otherwise errors will occur and the key will be discarded.

5.2.2. In-App Purchase

      This event is reported when an in-app purchase is made.

      This is a key event used for payment prediction model training. It is a must-report event when using the prediction services provided by the system.

      The _event_name for an in-app purchase event is _appPur.

Method example

static void trackAppPurchase(SEAppPurchaseData appPurchase)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
appPurchaseA class that carries the attributes that need to be uploaded for in-app purchase events. For details, please refer to the definition of the SEAppPurchaseData class in the solar_engine.dart file. SEAppPurchaseData yes

SEAppPurchaseData parameter description:

Parameter NameParameter MeaningParameter TypeMandatory
orderIdThe order ID generated by the system for this purchaseStringno
payAmountThe amount paid for this purchase (Unit: yuan)doubleyes
currencyTypeThe currency type of payment (following ISO 4217)Stringyes
payTypePayment methods, such as alipay, weixin, applepay, paypal, etc.Stringno
productIdPurchased item IDStringno
productNamePurchased item nameStringno
productNumQuantity of items purchasedIntno
payStatusPayment status
1: successful
2: failed
Intyes
failReasonReason for payment failureStringno
customProperties/Map<String, dynamic>no

Note:

The failReason parameter will only be passed in when the payStatus parameter is SEConstant_IAP_PayStatus_fail. For other statuses, just pass "".

Call example

SEAppPurchaseData appPurchaseData = SEAppPurchaseData();
appPurchaseData.orderId = "1123";
appPurchaseData.payAmount = 90.99;
appPurchaseData.currencyType = "CN";
appPurchaseData.payType = "weixin"; 
appPurchaseData.productId = "232dddd"; 
appPurchaseData.productName = "Game Skin"; 
appPurchaseData.productNum = 1;
appPurchaseData.payStatus = 1; 
appPurchaseData.failReason = "Payment Failure";
Map<String, dynamic> customProperties = {};
customProperties['name'] = 'wyq';
customProperties['age'] = 10;
appPurchaseData.customProperties = customProperties;
SolarEngine.trackAppPurchase(appPurchaseData);

// customProperties are not mandatory to be set or passed in. 
// Note: Please do not set the key as starting with an underscore "_", otherwise errors will occur and the key will be discarded.

5.2.3. Ad Click

      Call the trackAdClick method to report ad click events.

Method example

static void trackAdClick(SEAdClickData adClickData)

Parameter Description

Parameter Name Parameter MeaningParameter TypeMandatory
adClickData A class that carries the attributes that need to be uploaded to ad click events. For details, please refer to the definition of the SEAdClickData class in the solar_engine.dart file.SEAdClickDatayes

SEAdClickData parameter description:

Parameter NameParameter MeaningParameter TypeMandatory
adPlatformMonetization platforms, for example (value: name),
csj:穿山甲国内版
pangle:穿山甲国际版
tencent:腾讯优量汇
baidu:百度百青藤
kuaishou:快手
oppo:OPPO
vivo:vivo
mi:小米
huawei:华为
applovin:Applovin
sigmob:Sigmob
mintegral:Mintegral
oneway:OneWay
vungle:Vungle
facebook:Facebook
admob:AdMob
unity:UnityAds
is:IronSource
adtiming:AdTiming
klein:游可赢
fyber:Fyber
chartboost:Chartboost
adcolony:Adcolony
Stringyes
adTypeAd types, for example (value: explanation),
1:Rewarded Video Ads
2:Splash Ads
3:Interstitial Ads
4:Full Screen Videos
5:Banner Ads
6:In-Feed Ads
7:Native Video Ads
8:Playable Ads
9:Pre-movie Ads
0:Other
intyes
adNetworkADIDThe Placement ID on monetization platforms.Stringyes
mediationPlatformMediation platforms commonly used:
max
ironsource
admob
hyperbid
topon
cas
Tradplus
Tobid

If your mediation platform is not on the list, you can name it yourself, only that the name cannot exceed 32 characters.
Send "custom" if no mediation platform is used.
Stringyes
customProperties/Map<String, dynamic>no

Call example

SEAdClickData adClickData = SEAdClickData();
adClickData.adPlatform = "mtg";
adClickData.adType = 1;
adClickData.adNetworkADID = "11222ffff";
adClickData.mediationPlatform = "solar-engine";
Map<String, dynamic> customProperties = {};
customProperties['app'] = 'taobao';
customProperties['sex'] = "man";
adClickData.customProperties = customProperties;
SolarEngine.trackAdClick(adClickData);

// customProperties are not mandatory to be set or passed in.  
// Note: Please do not set the key as starting with an underscore "_", otherwise errors will occur and the key will be discarded. 

5.2.4. Registration

      Call the trackRegister method to report registration events.

Method example

static void trackAppRegister(SEAppRegisterData appRegisterData)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
appRegisterDataA class that carries the attributes that need to be uploaded to registration events. For details, please refer to the definition of the SEAppRegisterData class in the solar_engine.dart file.SEAppRegisterDatayes

SEAppRegisterData parameters:

Parameter NameParameter MeaningParameter TypeMandatory
regTypeRegistration types such as "WeChat", "QQ" and other custom valuesStringYes
statusRegistration status such as "success"StringNo
customPropertiesCustom PropertiesMap<String, dynamic>No

Call example

SEAppRegisterData appRegisterData = SEAppRegisterData();
appRegisterData.regType = "QQ";
appRegisterData.status = "success";
Map<String, dynamic> customProperties = {};
customProperties['type'] = 'wifi';
customProperties['like'] = "foods";
customProperties['re'] = "QQ";
appRegisterData.customProperties = customProperties;
SolarEngine.trackAppRegister(appRegisterData);

// customProperties are not mandatory to be set or passed in.  
// Note: Please do not set the key as starting with an underscore "_", otherwise errors will occur and the key will be discarded. 

5.2.5. Login

      Call the trackLogin method to report login events

Method example

static void trackAppLogin(SEAppLoginData appLoginData)

Parameter Description

Parameter Name Parameter MeaningParameter TypeMandatory
appLoginDataA class that carries the attributes that need to be uploaded to login events. For details, please refer to the definition of the SEAppLoginData class in the solar_engine.dart file.SEAppLoginData yes

SEAppLoginData parameter introduction:

Parameter NameParameter MeaningParameter TypeMandatory
loginTypeLogin type such as "WeChat", "QQ" and other custom valuesStringYes
statusLogin status such as "success"StringNo
customPropertiesCustom PropertiesMap<String, dynamic>No

Call example

SEAppLoginData appLoginData = SEAppLoginData();
appLoginData.loginType = "weixin";
appLoginData.status = "failed";
Map<String, dynamic> customProperties = {};
customProperties['type'] = 'wifi';
customProperties['like'] = "foods";
customProperties['re'] = "QQ";

appLoginData.customProperties = customProperties;
SolarEngine.trackAppLogin(appLoginData);

// customProperties are not mandatory to be set or passed in. 
// Note: Please do not set the key as starting with an underscore "_", otherwise errors will occur and the key will be discarded. 

5.2.6. In-App Order

Call the trackOrder method to report order events

Method example

static void trackAppOrder(SEAppOrderData appOrderData)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
appOrderDataA class that carries the attributes that need to be uploaded to in-app order events. For details, please refer to the definition of the SEAppOrderData class in the solar_engine.dart file.SEAppOrderData yes

Introduction to SEAppOrderData class parameters:

Parameter NameParameter MeaningParameter TypeMandatory
orderIdOrder IDStringNo (limit 128 characters)
payAmountThe payment amount of the order (Unit: yuan)doubleYes
currencyTypeThe currency type of the order (following ISO 4217)StringYes
payTypePayment methods, such as alipay, weixin, applepay, paypal, etc.StringNo (limit 32 characters)
statusOrder StatusStringYes
customPropertiesCustom PropertiesMap<String, dynamic>No

Call example


SEAppOrderData appOrderData = SEAppOrderData();
appOrderData.orderId = "111222333";
appOrderData.payAmount = 20.33;
appOrderData.currencyType = "USD";
appOrderData.payType = "weixin";
appOrderData.status = "failed"; 
Map<String, dynamic> customProperties = {};
customProperties['app'] = 'taobao';
customProperties['sex'] = "man";

appOrderData.customProperties = customProperties;
SolarEngine.trackAppOrder(appOrderData);

// customProperties are not mandatory to be set or passed in.  
// Note: Please do not set the key as starting with an underscore "_", otherwise errors will occur and the key will be discarded.  

5.2.7. Self-Reported Attribution Results

      Enables the reporting of attribution results data from a third-party or self-attribution platform to SolarEngine. The timing of reporting can be customized by developers. (Event Name: "_appAttr")

Method example

static void trackAppAttr(SEAppAttrData trackAppAttr)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
trackAppAttrA class that carries the attributes that need to be uploaded to self-reported attribution events. For details, please refer to the definition of the SEAppAttrData class in the solar_engine.dart file.SEAppAttrData yes

Introduction to SEAppAttrData class parameters:

Parameter NameParameter MeaningParameter TypeMandatory
adNetworkChannel ID (should match the channel ID in ROI analysis)Stringyes
subChannelSub-channels for advertisingStringno
adAccountIdAd account ID for advertisingStringno
adAccountNameAd account name for advertisingStringno
adCampaignIdAd campaign ID for advertisingStringno
adCampaignNameAd campaign name for advertisingStringno
adOfferIdAd offer ID for advertisingStringno
adOfferNameAd offer name for advertisingStringno
adCreativeIdAd creative ID for advertisingStringno
adCreativeNameAd creative name for advertisingStringno
attributionPlatformMonitoring PlatformStringyes
customPropertiesCustom PropertiesMap<String, dynamic>no

Call example

SEAppAttrData appAttrData = SEAppAttrData();
appAttrData.adNetwork = "ks"; 
appAttrData.subChannel = "bytedance"; 
appAttrData.adAccountId = "2222ddd";
appAttrData.adAccountName = "mtg";
appAttrData.adCampaignId = "12323";
appAttrData.adCampaignName = "animal";
appAttrData.adOfferId = "100oo"; 
appAttrData.adOfferName = "wanmeishijie"; 
appAttrData.adCreativeId = "dkdkd11";
appAttrData.adCreativeName = "dog";
appAttrData.attributionPlatform = "tencent";
Map<String, dynamic> customProperties = {};
customProperties['channel'] = 'xiaomi';
customProperties['date'] = "10.20";

appAttrData.customProperties = customProperties;
SolarEngine.trackAppAttr(appAttrData);

5.3. Custom events

      In addition to the clearly predefined events listed above, developers can report custom events according to their own analysis needs.

      The custom event names should be customized by the developer.

Here are the naming conventions for event names:

  • String type
  • Start with letters only.
  • No more than 40 characters.
  • Contain numbers, lowercase letters and underscores only.

      Call trackCustom to report custom events:

Method example

static void trackCustomEvent(SECustomEventData customEventData)

customEventData object parameter description

Parameter NameParameter MeaningParameter TypeMandatory
customEventNameDeveloper custom event nameStringYES
customPropertiesDeveloper custom event propertiesMap<String, dynamic>YES

Call example

SECustomEventData customEventData = SECustomEventData();
customEventData.customEventName = "OpenAPP";
Map<String, dynamic> customProperties = {};
customProperties['time'] = '2020-10-10';
customProperties['data'] = "hello word!";
customEventData.customProperties = customProperties;
SolarEngine.trackCustomEvent(customEventData);

5.4. Custom Property

      A custom property is a Dictionary object where each element represents a property.

Key: Property Name

  • String type
  • Start with letters only.
  • No more than 40 characters.
  • Contain numbers, lowercase letters and underscores only.

Value: Property Value

  • Support basic data types like String, int, long, float, double, boolean, and date
  • For elements of an array, only string type is supported.
  • For other types, they will be forcibly converted to strings and stored.

Custom Property Types

      The data type of custom event properties is determined by their data types reported for the first time and cannot be changed once confirmed. For subsequent reporting of the same properties, only properties with the same data types as the first occurrence will be stored in the database.

Data TypeDescriptionExample
numberRange from -9E15 to 9E15, without quotation marks.1234, 12.34
stringLimit 2KB. Numbers with quotation marks will also be identified as strings."dashen", "北京", "1234", "true"
date"yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss", or "yyyy-MM-dd 00:00:00""2023-03-01 12:34:56","2023-03-01 12:34:56.789","2023-03-01 00:00:00"
booleanTrue or false without quotation marks.true, false
arrayAll elements in an array will be converted into strings.["a","1","true"]

Note:

      The data type of the property determines their analysis logic available in analysis models. For example, the numerical type can perform calculations such as maximum value, minimum value, and summation, while the Boolean type can perform calculations of true and false values. Therefore, when determining the format of data reporting, you need to consider the analysis scenarios and business needs and formulate a complete event tracking plan as directions.

5.5. Duration events

5.5.1. Create Duration Event

      Call the createTimerEvent to start timing for an event. Configure the name of the event, and event properties to report. When the event comes to an end, a "_duration" property will automatically be added for this event (unit: millisecond). It should be noted that there can only be one timing task for the same event.

Method example

static Future<String> createTimerEvent(SETimerEventData timerEventData)

timerEventData object parameter description

Parameter NameParameter MeaningParameter TypeMandatory
customEventNameDeveloper custom event nameStringYes
customPropertiesDeveloper custom event propertiesMap<String, dynamic> Yes

Return value: Returns the JSON string used for reporting duration events.

Call example

SETimerEventData event = SETimerEventData();
event.customEventName = "timer_event_my";
Map<String, dynamic> customProperties = {};
customProperties['kind'] = 'timer';
customProperties['send'] = "ture";
event.customProperties = customProperties;
event.ts = DateTime.now().millisecondsSinceEpoch;
timerEventStr = await SolarEngine.createTimerEvent(event);

5.5.2. Report Duration Event

      Call the trackTimerEvent method to report developer-defined duration events.

Method Example

static void trackTimerEvent(String timeEventData)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
timeEventDataJSON string obtained through createTimerEvent methodstringYes

Call example

SolarEngine.trackTimerEvent(timerEventStr);

Note:

      When reporting the preset event _appEnd, the duration starting from the last _appStart will be reported by default. That is, the duration of an exit event does not need to be configured to start timing, and will be assigned a value by default.

5.6. First-Time Event

      A first-time event refers to an event that is recorded only once for a specific dimension. For example, registration can be recorded using a first-time event. The server will deduplicate based on the ID set by setCheckId(). Only the first event reported with the same ID will be recorded.

      Predefined events (_appInstall, _appStart, _appEnd) cannot be set as first-time events.

Method example

static void trackFirstEvent(SEBaseEventData baseEventData)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
baseEventDataFirst-time event attributesSEBaseAttributesYes

      When using the baseEventData parameter, you need to pass a subclass instance of it. The specific instructions are as follows.

First-time EventParameter TypeDescription
SECustomEventDataCustomAttributesCustom first-time event (model type)
SEAppImpressionDataAppImpressionAttributesFirst in-app ad impression event (model type)
SEAdClickDataAdClickAttributesFirst in-app ad click event (model type)
SEAppPurchaseDataProductsAttributesFirst in-app purchase event (model type)
SEAppAttrDataAppAttributesFirst self-reported attribution event (model type)
SEAppOrderDataOrderAttributesFirst order event (model type)
SEAppRegisterDataRegisterAttributesFirst registration event (model type)
SEAppLoginDataLoginAttributesFirst login event (model type)


1. Call example (First custom event) :

SECustomEventData class parameter description:

Parameter NameParameter MeaningParameter TypeMandatory
firstCheckIdFirst-time event verification IDstringyes (If checkId is not passed in, it is a normal event.)
customEventNameCustom event namestringyes
customPropertiesCustom event propertiesmapno


SECustomEventData customEventData = SECustomEventData();
customEventData.customEventName = "OpenAPP";  // Mandatory
Map<String, dynamic> customProperties = {};
customProperties['time'] = '2020-10-10';
customProperties['data'] = "hello word!";
customEventData.firstCheckId =  "checkId";  // Mandatory
customEventData.customProperties = customProperties;
SolarEngine.trackFirstEvent(customEventData);


2. Call example (First in-app purchase event) :

      For the description of SEAppPurchaseData class parameters, see: 5.2.2. In-app purchase events

SEAppPurchaseData appPurchaseData = SEAppPurchaseData();
appPurchaseData.currencyType = "CN";
appPurchaseData.failReason = "Payment Failure";
appPurchaseData.orderId = "1123";
appPurchaseData.payAmount = 90.99;
appPurchaseData.payStatus = 1;
appPurchaseData.payType = "weixin";
appPurchaseData.productId = "232dddd";
appPurchaseData.productName = "Game Skin";
appPurchaseData.productNum = 1;
Map<String, dynamic> customProperties = {};
customProperties['name'] = 'wyq';
customProperties['age'] = 10;
customProperties['like'] = "Beer";
appPurchaseData.customProperties = customProperties;
SolarEngine.trackAppPurchase(appPurchaseData);

appPurchaseData.firstCheckId = "checkId"; // Required
SolarEngine.trackFirstEvent(appPurchaseData);


3. Call example (First in-app ad impression event) :

       For the description of SEAppImpressionData class parameters, see: 5.2.1, Ad Impression, firstCheckId is a required field.


4. Call example (First in-app ad click event) :

       For the description of SEAdClickData class parameters, see: 5.2.3. Ad Click, firstCheckId is a required field.


5. Call example (First self-reported attribution event) :

       For the description of SEAppAttrData class parameters, see: 5.2.7. Self-Reported Attribution Results, firstCheckId is a required field.


6. Call example (First order event) :

       For the description of SEAppOrderData class parameters, see: 5.2.6. In-App Order, firstCheckId is a required field.


7. Call example (First registration event) :

       For the description of SEAppRegisterData class parameters, see: 5.2.4. Registration, firstCheckId is a required field.


8. Call example (First login event) :

       For the description of SEAppLoginData class parameters, see: 5.2.5. Login, firstCheckId is a required field.


6. Set User Property

SolarEngine provides multiple methods for reporting user properties. You can use these methods to add or modify user properties.

It is recommended for you to select properties that change infrequently or hold significant value, for example, age, game level, location, first payment time and total payment amount. Other properties with higher change frequency can be reported and recorded through events.

User property settings can be set by calling userUpdate, userInit, userAdd, userUnset, userAppend, or userDelete.

Note:

  1. The format requirements of user properties are consistent with those of event properties.
  2. Please do not report properties whose keys start with an underscore "_". The SDK will discard properties like this by default.

6.1. userInit

     If you want to upload a batch of user attributes, among which the existing user attributes will not update their values, and the non-existing attributes will be created and saved, you can call userInit to set them.

Method example

static void userInit(Map<String, dynamic> properties)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
propertiesDeveloper self-defined user propertiesMap<String, dynamic>Yes

Call example

Map<String, dynamic> properties = {};
properties['kind'] = 'timer';
properties['send'] = "ture";
SolarEngine.userInit(properties);

6.2. userUpdate

     For general user attributes, you can call userUpdate to set them. The attributes uploaded in this way will overwrite the original attribute values. If the user attribute does not exist before, it will be created, and the data type will follow the value passed in.

Method example

static void userUpdate(Map<String, dynamic> properties)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
propertiesDeveloper self-defined user propertiesMap<String, dynamic>Yes

Call example

Map<String, dynamic> properties = {};
properties['kind'] = 'timer1111';
properties['send'] = "false";
properties['count'] = 1;
SolarEngine.userUpdate(properties);

6.3. userAdd

     If you want to report a numeric attribute and accumulate its values, you can call userAdd. If the attribute has not been set, it will be assigned a value of 0 and then calculated. You can pass in a negative value, which is equivalent to a subtraction operation.

Method example

static void userAdd(Map<String, dynamic> properties)

Call example


Map<String, dynamic> properties = {};
properties['count'] = 2;
SolarEngine.userAdd(properties);

Note:

      The value called by userAdd only allows Number type.

6.4. userUnset

      When you want to clear the user attribute values of a user, you can call userUnset to clear the specified attributes (string array). If the attribute has not been created in the array, the attribute will not be created.

Method example

static void userUnset(List<String> keys)

Parameter Description

Parameter NameParameter MeaningParameter TypeMandatory
keysKey value that needs to be cleared.StringYes

Call example

SolarEngine.userUnset(["kind"]);

6.5. userAppend

     You can call userAppend to append user attributes of array type. If the attribute does not exist, it will be created.

Method example

static void userAppend(Map<String, dynamic> properties)

Call example

Map<String, dynamic> properties = {};
properties['kind3'] = 'timer3';
SolarEngine.userAppend(properties);

6.6. userDelete

     You can call userDelete to delete users. After a user is deleted, you will no longer be able to query the user's user attributes, but the events generated by the user can still be queried.

Method example

static void userDelete(SEUserDeleteType deleteType)

Call example

SolarEngine.userDelete(SEUserDeleteType.DELETE_BY_ACCOUNTID);

6.7 IOS ATT Request for Tracking Authorization

This interface is suitable for iOS applications that have used attribution services.

The SolarEngine SDK encapsulates the system's requestTrackingAuthorizationWithCompletionHandler. By using the SDK's encapsulated ATT (App Tracking Transparency) authorization interface, the SDK can know the user's authorization status immediately, can prioritize reporting Install events with IDFA, and can optimize attribution efficiency.

The callback value 'status' corresponds to the ATTrackingManagerAuthorizationStatus of the iOS system.

0: Not Determined;1: Restricted;2: Denied;3: Authorized ;999: system error

SolarEngine.requestTrackingAuthorizationWithCompletionHandler((code) {    
    if (code == 0) {     
        print('att-Not Determined');    
    } else if (code == 1) {      
        print('att-Restricted');    
    } else if (code == 2) {     
        print('att-Denied');    
    } else if (code == 3) {    
        print('att-Authorized');    
    } else if (code == 999) {   
        print('att-systom error');    
    } 
});

6.8 Set SKAdNetwork and Conversion Values

Note:

  • This feature is available for iOS 14 or later.
  • To use this feature, you need to add the StoreKit.framework to your project.

Update Conversion Values

Conversion values are used to track user actions within the SKAdNetwork. You can map 64 conditions to conversion values ranging from 0 to 63 and send this integer value to the SKAdNetwork during user installation. This information helps you understand how users interact with your app in the initial days after installation.

You can update the conversion value using the "updateConversionValue" method. This method includes Apple's updateConversionValue method to receive the updated conversion values.

Call example 1:

static Future<String?> updateConversionValueWithErrorCallback(int conversionValue)

Parameters:

Parameter NameParameter MeaningParameter TypeMandatory
conversionValueA conversion value ≥0 and ≤63.
You can assign it to a specific install. It will help you understand the value of the user without identifying the user's personal information.
intYes

Example:

var error = await SolarEngine.updateConversionValueWithErrorCallback(0);
print("sss-updateConversionValueWithErrorCallback =${error}");

Call example 2:

static Future<String?> updateConversionValueWithErrorCallbackSkad4( int conversionValue, String coarseValue, bool lockWindow)

Parameters:

Parameter NameParameter MeaningParameter TypeMandatory
fineValueA conversion value ≥0 and ≤63. You can assign it to a specific install. It will help you understand the value of the user without identifying the user's personal information.intYes
coarseValueSKAdNetworkCoarseConversionValue. If the app's install volume is insufficient and does not meet the privacy threshold, the function is enabled. The following options are supported:
SKAdNetworkCoarseConversionValueHigh
SKAdNetworkCoarseConversionValueLow
SKAdNetworkCoarseConversionValueMedium
stringYes
completionUsed to catch and handle the callbacks. Set this value to nil if you don't provide a handler.boolNo

Set Installation Postback

   Please set SolarEngine SDK as the postback receiver of SKAdNetwork following the guide below:

  1. Select the Info.plist file in the project navigator of Xcode.
  2. Click the "+" icon in the "Property" list editor, then press the Enter key.
  3. Enter "NSAdvertisingAttributionReportEndpoint".
  4. Select "String" from the popup menu in the "Type" column.
  5. Enter https://detailroi.com.

6.9 Deep Linking

       Deep linking is used to send users directly to specific in-app locations, producing a seamless user journey and improving conversion rates. This chapter will introduce necessary steps to generate deep links in SolarEngine.

1) Login to SolarEngine

URL Scheme example:test1.link.solar-engine.com

Android Deep Linking

Configure Scheme

Developers can configure the AndroidManifest.xml file in the opened native Android project (replace Scheme with the value obtained from the SolarEngine in the previous step):

<activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
           
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="your scheme" />
            </intent-filter>
 </activity>

Deep Linking callback settings

Method Example

static void onDeepLinkCallback(OnDeeplinkCallback callback);

Parameter Description

Parameter Name Parameter Meaning TypeMandatory
callbackdeep link callback SESDKDeeplinkCallback Yes

call example

SolarEngine.onDeepLinkCallback((code, data) {
      if (code == 0) {
           print("deeplink callback success----");
           print(data);
       } else {
            print("deeplink callback failed----$code");
       }
});

Pass the URL to SE SDK

How to obtain URL:  

https://help.solar-engine.com/en/docs/Deep-Linking-FWYi#c606658906fe12d6b433c8bd43a9340f

Method example:

static void handleDeepLinkUrl(String url);

Parameter Description

Parameter Parameter Meaning Parameter TypeMandatory
urlusrScheme String yes

Call example

SolarEngine.initializeWithCallbacK(appkey, config, (code) {
      // Initialization success
      if(code == 0){
          print("Initialization success-----"); 
          print(code);
          //Note: the handleDeepLinkUrl method must be called after successful initialization and after setting the Deeplink callback, otherwise it will not take effect
          SolarEngine.handleDeepLinkUrl("your url");
      }
  });

6.10 Deferred Deep Linking

       After you enable deferred deep linking, the SE SDK will request the related parameters during initialization.

If callback success, the parameters will be:

- sedpLink: The parameter for redirection.

- turlId: A 7-digit short link.

- sedpUrlscheme: The URL scheme filled in by the user when creating the deep link.

If callback failed, errorCode will be:

- 1101: Error in SDK;

- 1102: Failed to establish a connection with the server;

- 1103: Timeout in establishing a connection with the server;

- 1104: Server-side error;

- 1105: Server returns data to the SDK;

- 1106: Deep link matching failed, server callback is empty.

Call Example

// Set deferred deep linking callback
SolarEngine.onDelayDeepLinkCallback((code, data) {
              print("onDelayDeepLinkCallback----");
              if (code == 0) {
                     print("deferred deeplink successfully parsed----");
                     print(data);
               } else {
                    print("deferred deeplink failed----$code");
           }
});


// Enable deferred deep linking
SolarEngineConfig config = SolarEngineConfig();
config.enableDelayDeeplink = true;
SolarEngine.initializeWithCallbacK(appkey, config, (code) {
          print("initializeWithCallbacK----");
          print(code);

})


IOS

iOS URL Scheme Configuration

       In your iOS project, select TARGETS > Info > URL Types, and click on the "+". Then input the URL Scheme you created on SolarEngine.

Parse the URL Scheme

After you set up the URL Scheme in the SDK, your app can be opened successfully through them.

Export the iOS project and find the AppDelegate.m file to achieve the following method.

call example:

#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"
#import <SolarEngineSDK/SolarEngineSDK.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [GeneratedPluginRegistrant registerWithRegistry:self];
    // Override point for customization after application launch.
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    
    NSString *urlString = url.absoluteString;
    [[SolarEngineSDK sharedInstance] track:@"url_scheme_openURL" withProperties:@{@"url":urlString}];
    
    [[SolarEngineSDK sharedInstance] appDeeplinkOpenURL:url];
    return YES;
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
    
    [[SolarEngineSDK sharedInstance] track:@"univisal_link_openURL" withProperties:@{@"url":userActivity.webpageURL.absoluteString}];
    
    [[SolarEngineSDK sharedInstance] appDeeplinkOpenURL:userActivity.webpageURL];
    
    return YES;
}

@end

Listen for Deeplink Callback Parameters in Flutter

Method example:

static void onDeepLinkCallback(OnDeeplinkCallback callback)

Call example:

// This method needs to be called before initialization; otherwise, the callback will not be received.


SolarEngine.onDeepLinkCallback((code, data) {
  if (code == 0) {
    print("onDeepLinkCallback success");
    
    String sedpLink = data?['sedpLink'];
    String turlId = data?['turlId'];
    String from = data?['from'];
    Map customParams = data?['customParams'];

  } else {
    print("onDeepLinkCallback  failed:$code");
  }

});



————————————

Changelog

2025-9-24 1.5.5

Based on Android 1.3.1.1 iOS 1.3.0.3

•Android:SDK performance optimization


2025-9-18 1.5.4

Based on Android 1.3.1.1 iOS 1.3.0.3

•Android:SDK performance optimization


2025-8-07 1.5.3

Based on Android 1.3.0.6 iOS 1.3.0.3

•Android:SDK performance optimization


2025-07-04 1.5.2

Based on Android 1.3.0.3 iOS 1.3.0.3

• iOS&Android:Optimize obtaining attribution results

• iOS&Android: SDK performance optimization


2025-01-17 1.5.1

Based on Android 1.2.9.3 iOS 1.2.9.4

• iOS: optimized predefined events


2024-12-31 1.5.0

Based on Android 1.2.9.3 iOS 1.2.9.3

•iOS&Android:Optimize obtaining attribution results

  • Android:  Optimize appEnd event calculating logic
  • Android: SDK performance optimization


2024-11-21 1.4.2

China Mainland version: Based on Android 1.2.9.1 iOS 1.2.9.2

•iOS: optimizes network requests


2024-11-07 1.4.1

China Mainland version: Based on Android 1.2.9.1 iOS 1.2.9.1

•iOS&Android:debug mode optimized

•iOS: Reporting logic optimized


2024-10-24 1.4.0

China Mainland version: Based on Android 1.2.9.0 iOS 1.2.9.0

•iOS&Android:China Mainland version: optimizes network requests


2024-9-20 1.2.8.3

China Mainland version: Based on Android 1.2.8.3 iOS 1.2.8.2

International version: Based on Android 1.2.8.3 iOS 1.2.8.2

•iOS&Android:Optimize network requests

•Android:Optimize online parameter logic


2024-9-11 1.3.2

China Mainland version: Based on Android 1.2.8.2 iOS 1.2.8.1

International version: Based on Android 1.2.8.2 iOS 1.2.8.1

• iOS: Optimize event tracking and reporting

• iOS&Android: Support deferred deep linking



Previous
Web SDK
Next
API Integration
Last modified: 2025-09-24Powered by