Preset events include _appInstall, _appStart, and _appEnd.
Event Name | Event Identifier | Description |
---|---|---|
App Install | _appInstall | Automatically reported every time the app is installed and opened for the first time. |
App Launch | _appStart | Automatically 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 | _appEnd | Automatically reported every time the app is closed or when it remains inactive in the background for more than 30 seconds. |
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);
Parameter | Description | Type | Required |
---|---|---|---|
presetEventType | Preset events, e.g. AppInstall AppStart AppEnd All | PresetEventType | Yes |
customProperties | Custom properties sent by the developer | JSONObject | No |
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:
[[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.[[SolarEngineSDK sharedInstance] setPresetEvent:SEPresetEventTypeAll withProperties:nil] .