60 lines
1.5 KiB
Objective-C
60 lines
1.5 KiB
Objective-C
//
|
|
// DDStatisticsService.m
|
|
// DingDangApp
|
|
//
|
|
// Created by 触海 on 2023/12/11.
|
|
//
|
|
|
|
#import "DDStatisticsService.h"
|
|
#import <UMCommon/UMCommon.h>
|
|
|
|
@implementation DDStatisticsService
|
|
|
|
/// 埋点数据 不带参数的
|
|
/// @param event key
|
|
/// @param describe 描述
|
|
+ (void)DD_TrackEvent:(NSString *)event eventDescribe:(NSString *)describe {
|
|
if (event == nil || event.length == 0) {
|
|
return;
|
|
}
|
|
|
|
[self DD_TrackEvent:event eventDescribe:describe eventAttributes:nil];
|
|
}
|
|
|
|
/// 埋点的 代参数的
|
|
/// @param event key
|
|
/// @param describe 描述
|
|
/// @param attributes 参数
|
|
+ (void)DD_TrackEvent:(NSString *)event eventDescribe:(NSString *)describe eventAttributes:(nullable NSDictionary *)attributes {
|
|
if (event == nil || event.length == 0) {
|
|
return;
|
|
}
|
|
if (attributes.allKeys.count > 0) {
|
|
[MobClick event:event attributes:attributes];
|
|
} else {
|
|
[MobClick event:event label:describe];
|
|
}
|
|
}
|
|
|
|
/// 统计时长的 开始
|
|
/// @param event key
|
|
/// @param describe 描述
|
|
+ (void)DD_TrackEvent:(NSString *)event eventStart:(NSString *)describe {
|
|
if (event == nil || event.length == 0) {
|
|
return;
|
|
}
|
|
[MobClick beginEvent:event label:describe];
|
|
}
|
|
|
|
/// 统计时长 结束
|
|
/// @param event key
|
|
/// @param describe 描述
|
|
+ (void)DD_TrackEvent:(NSString *)event eventEnd:(NSString *)describe {
|
|
if (event == nil || event.length == 0){
|
|
return;
|
|
}
|
|
[MobClick endEvent:event label:describe];
|
|
}
|
|
|
|
@end
|