Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yixiangboy committed Feb 25, 2020
1 parent cd8bab5 commit e1c4dbe
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ + (DoraemonBuriedPointManager *)shareManager{
static DoraemonBuriedPointManager *instance;
dispatch_once(&once, ^{
instance = [[DoraemonBuriedPointManager alloc] init];
instance.count = 10;//暂定的10
instance.timeOut = 60;//时隔60s
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterBackgroundNotification) name:UIApplicationDidEnterBackgroundNotification object:nil];
});
return instance;
}

- (instancetype)init{
if (self = [super init]) {
self.count = 10;//暂定的10
self.timeOut = 60;//时隔60s
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterBackgroundNotification:) name:UIApplicationDidEnterBackgroundNotification object:nil];
}
return self;
}

- (NSMutableArray *)pointArray{
if(nil == _pointArray){
_pointArray = [[NSMutableArray alloc] init];
Expand Down Expand Up @@ -64,13 +70,7 @@ - (void)addPointName:(NSString *)name{
if (name.length<1) {
return;
}
NSLog(@"yixiang name == %@",name);
[self insertPointArray:@"click" name:name];
}

- (void)insertPointArray:(NSString *)eventType name:(NSString *)name{
NSDictionary *dic = @{
@"eventType":STRING_NOT_NULL(eventType),
@"eventName":STRING_NOT_NULL(name),
@"time":[DoraemonUtil currentTimeInterval]
};
Expand All @@ -86,7 +86,7 @@ - (void)uploadData{
[self.basicInfoDic setValue:self.pointArray forKey:@"events"];
NSMutableDictionary *params = [self.basicInfoDic copy];

[DoraemonNetworkUtil postWithUrlString:@"https://www.dokit.cn...." params:params success:^(NSDictionary * _Nonnull result) {
[DoraemonNetworkUtil postWithUrlString:@"http://dokit-test.intra.xiaojukeji.com/pointData/addPointData" params:params success:^(NSDictionary * _Nonnull result) {
NSInteger code = [result[@"code"] integerValue];
if (code == 200) {
[self removePointArray];
Expand Down

0 comments on commit e1c4dbe

Please sign in to comment.