首次事件功能是指在同一个设备中只有首次调用时该事件才会上报,支持的事件类型有预定义事件和自定义事件。
方法示例
attribute参数使用时需要传SEEventBaseAttribute的子类实例,具体说明如下
首次事件 | 参数类型 | 说明 |
---|---|---|
自定义首次事件 | SECustomEventAttribute | 必传字段为CustomEven对象的eventName属性和firstCheckId属性。 |
注册事件首次事件 | SERegisterEventAttribute | 必传字段为firstCheckId属性,其它必传字段参考“注册事件” |
注:以上必传字段firstCheckId未传时此次调用会当成普通事件上报。
注册事件首次事件调用示例
SERegisterEventAttribute *attribute = [[SERegisterEventAttribute alloc] init];
attribute.registerType = @"WeChat";
attribute.registerStatus = @"success";
attribute.firstCheckId = @"uniqueID"; // 必传字段
attribute.customProperties = @{
@"Key1": @"Value1",
@"Key2": @"Value2"
};
[[SolarEngineSDK sharedInstance] trackFirstEvent:attribute];
自定义事件首次事件调用示例