Menu

Preset Events

       Preset events include _appInstall, _appStart, and _appEnd.

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.

Set Preset Event Custom Properties

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

Function

public synchronized void setPresetEventProperties(PresetEventType presetEventType,JSONObject customProperties);
ParameterDescriptionTypeRequired
presetEventTypePreset events, e.g.
AppInstall
AppStart
AppEnd
All
PresetEventTypeYes
customPropertiesCustom properties sent by the developerJSONObjectNo

Sample Code

import com.reyun.solar.engine.infos.PresetEventType;
import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;

JSONObject customProperties = new JSONObject();
try {
    //Developer custom event properties in Json format
    customProperties.put("key1","value1");
    customProperties.put("key2","value2");
    ......
} catch (JSONException e) {
    ///
}
SolarEngineManager.getInstance().setPresetEventProperties(PresetEventType.AppInstall, customProperties);

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 SEPresetEventType enumeration is set to SEPresetEventTypeAppInstall, it will override the custom properties set through the SEPresetEventTypeAppInstall, SEPresetEventTypeAppStart, and SEPresetEventTypeAppEnd enumerations. If set multiple times, only the last setting will be effective.
  • Preset event properties can be cleared by calling the corresponding enumeration with nil as the property value. For example: [[SolarEngineSDK sharedInstance] setPresetEvent:SEPresetEventTypeAppStart withProperties:nil] can be used to clear the custom properties for the startup event. Clearing the installation and exit events only requires changing the corresponding enumeration value.
  • SolarEngine SDK also supports clearing the custom properties for all preset events, including properties set through the SEPresetEventTypeAppInstall, SEPresetEventTypeAppStart, and SEPresetEventTypeAppEnd enumerations. This can be done by calling [[SolarEngineSDK sharedInstance] setPresetEvent:SEPresetEventTypeAll withProperties:nil] .
  • Please do not customize properties with a key starting with an underscore "_". The SE SDK will abandon properties like this.


Previous
Get Preset Properties
Next
Predefined Events
Last modified: 2024-12-03Powered by