Commit fe9f8bc0 authored by Matthijs van der Kroon's avatar Matthijs van der Kroon

Merge branch 'dev'

parents d0c9cd75 e4049393
......@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'PrimedIO'
s.version = "0.0.3"
s.version = "0.0.4"
s.summary = 'IOS SDK for retrieving predictions from the Primed Backend, as well as track behavior'
s.description = <<-DESC
IOS SDK for retrieving predictions from the Primed Backend, as well as track behavior.
......
......@@ -68,7 +68,7 @@
@"did":did,
@"source":@"APP",
@"sdkId":@(2),
@"sdkVersion":@"0.0.3",
@"sdkVersion":@"0.0.4",
@"type":type.uppercaseString,
@"eventObject":(eventObject ?: @{})
}];
......@@ -135,6 +135,7 @@
Primed.sharedInstance.sha512Signature = [Primed hmac:prepSignature];
Primed.sharedInstance.connectionStringPrimedIO = connectionString;
Primed.sharedInstance.primedTrackerAvailable = YES;
self->heartbeatIncrement = 0;
self.heartbeatInterval = heartbeatInterval;
self.eventQueueRetryInterval = eventQueueRetryInterval;
......@@ -147,14 +148,7 @@
[self.manager setNsps:@{@"/v1":self.socket}];
[self.socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
self->heartbeatIncrement = 0;
if (@available(iOS 10.0, *)) {
[NSTimer scheduledTimerWithTimeInterval:self.heartbeatInterval repeats:YES block:^(NSTimer * _Nonnull timer) {
[self trackHeartbeat];
}];
} else {
[NSTimer scheduledTimerWithTimeInterval:self.heartbeatInterval target:self selector:@selector(trackHeartbeat) userInfo:nil repeats:YES];
}
if(PrimedTracker.sharedInstance.debug){ PrimedLog(@"[PRIMED TRACKER SOCKET CONNECTED]"); }
}];
[self.socket onAny:^(SocketAnyEvent *data) {
......@@ -163,13 +157,16 @@
[self.socket connect];
if (@available(iOS 10.0, *)) {
[NSTimer scheduledTimerWithTimeInterval:self.eventQueueRetryInterval repeats:YES block:^(NSTimer * _Nonnull timer) {
[self emitFromDatabase];
}];
[NSTimer scheduledTimerWithTimeInterval:self.heartbeatInterval repeats:YES block:^(NSTimer * _Nonnull timer) {
[self trackHeartbeat];
}];
} else {
[NSTimer scheduledTimerWithTimeInterval:self.eventQueueRetryInterval target:self selector:@selector(emitFromDatabase) userInfo:nil repeats:YES];
[NSTimer scheduledTimerWithTimeInterval:self.heartbeatInterval target:self selector:@selector(trackHeartbeat) userInfo:nil repeats:YES];
}
[NSNotificationCenter.defaultCenter addObserverForName:UIApplicationDidBecomeActiveNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
......
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