添加了百度统计的相关类
This commit is contained in:
59
xplan-ios/Base/Tool/StatisticsService/StatisticsService.m
Normal file
59
xplan-ios/Base/Tool/StatisticsService/StatisticsService.m
Normal file
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// StatisticsService.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/9/27.
|
||||
//
|
||||
|
||||
#import "StatisticsService.h"
|
||||
#import <BaiduMobStatCodeless/BaiduMobStat.h>
|
||||
|
||||
@implementation StatisticsService
|
||||
|
||||
|
||||
/// 埋点数据 不带参数的
|
||||
/// @param event key
|
||||
/// @param describe 描述
|
||||
+ (void)trackEvent:(NSString *)event eventDescribe:(NSString *)describe {
|
||||
if (event == nil || event.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
[self trackEvent:event eventDescribe:describe eventAttributes:nil];
|
||||
}
|
||||
|
||||
|
||||
/// 埋点的 代参数的
|
||||
/// @param event key
|
||||
/// @param describe 描述
|
||||
/// @param attributes 参数
|
||||
+ (void)trackEvent:(NSString *)event eventDescribe:(NSString *)describe eventAttributes:(nullable NSDictionary *)attributes {
|
||||
if (event == nil || event.length == 0) {
|
||||
return;
|
||||
}
|
||||
[[BaiduMobStat defaultStat] logEvent:event eventLabel:describe attributes:attributes];
|
||||
}
|
||||
|
||||
|
||||
/// 统计时长的 开始
|
||||
/// @param event key
|
||||
/// @param describe 描述
|
||||
+ (void)trackEvent:(NSString *)event eventStart:(NSString *)describe {
|
||||
if (event == nil || event.length == 0) {
|
||||
return;
|
||||
}
|
||||
[[BaiduMobStat defaultStat] eventStart:event eventLabel:describe];
|
||||
}
|
||||
|
||||
|
||||
/// 统计时长 结束
|
||||
/// @param event key
|
||||
/// @param describe 描述
|
||||
+ (void)trackEvent:(NSString *)event eventEnd:(NSString *)describe {
|
||||
if (event == nil || event.length == 0){
|
||||
return;
|
||||
}
|
||||
[[BaiduMobStat defaultStat] eventEnd:event eventLabel:describe];
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user