添加了百度统计的相关类

This commit is contained in:
fengshuo
2021-09-27 17:44:09 +08:00
parent 45a5a38a2a
commit 2b6b0e29ce
7 changed files with 208 additions and 1 deletions

View 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