SolarEngine SDK supports three preset events as follows.
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. |
SolarEngine SDK supports developers to set custom properties for three preset events: app start, app install, and app exit.
- (void)setPresetEvent:(SEPresetEventType)eventType withProperties:(NSDictionary*)properties;
Parameter | Description | Type | Required |
---|---|---|---|
eventType | e.g. SEPresetEventTypeAppInstall SEPresetEventTypeAppStart SEPresetEventTypeAppEnd SEPresetEventTypeAll (all preset events) | SEPresetEventType | YES |
properties | Custom properties | NSDictionary | NO |
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] .
Sample Code
[[SolarEngineSDK sharedInstance] setPresetEvent:SEPresetEventTypeAppStart withProperties:@{
@"Key1": @"Value1",
@"Key2": @"Value2"
}];