Commit 965426f8 authored by Bosko Petreski's avatar Bosko Petreski Committed by Bosko Petreski
parent b566f80e
This diff is collapsed.
......@@ -161,6 +161,11 @@
[trackSignals setObject:PrimedTracker.sharedInstance.getDID forKey:@"did"];
}
}
if(![trackSignals.allKeys containsObject:@"sid"]){
if(Primed.sharedInstance.primedTrackerAvailable){
[trackSignals setObject:PrimedTracker.sharedInstance.getSID forKey:@"sid"];
}
}
NSError *errorJSON;
NSData *signalsJSON = [NSJSONSerialization dataWithJSONObject:trackSignals options:NSJSONWritingPrettyPrinted error:&errorJSON];
......
......@@ -29,6 +29,19 @@
}
#pragma mark - CustomFunctions
-(NSString *)getUA{
return [NSString stringWithFormat:@"%@;%@",UIDevice.currentDevice.model,UIDevice.currentDevice.systemVersion];
}
-(NSString *)getDate_iso8601{
NSDateFormatter *dateFormatter = NSDateFormatter.new;
NSLocale *enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
[dateFormatter setLocale:enUSPOSIXLocale];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZZZZ"];
NSDate *now = [NSDate date];
NSString *iso8601String = [dateFormatter stringFromDate:now];
return iso8601String;
}
-(BOOL)isNetworkAvailable{
CFNetDiagnosticRef dReference;
#pragma clang diagnostic push
......@@ -216,8 +229,8 @@
heartbeatIncrement++;
}
-(void)trackStart:(NSString *)uri customProperties:(NSDictionary<NSString*,id> *)customProperties{
NSDictionary *payload = [self basicEventProperties:@"start" eventObject:@{@"ua":UIDevice.currentDevice.model,
@"now":@(NSDate.date.timeIntervalSince1970),
NSDictionary *payload = [self basicEventProperties:@"start" eventObject:@{@"ua":self.getUA,
@"now":self.getDate_iso8601,
@"uri":uri,
@"screenWidth":@(UIScreen.mainScreen.bounds.size.width),
@"screenHeight":@(UIScreen.mainScreen.bounds.size.height),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment