Skip to content

Commit

Permalink
move caching logic to startTrackingVerified()
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpatrick committed Jan 9, 2025
1 parent cab31a9 commit 2789fcd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions RadarSDK/RadarVerificationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,9 @@ - (void)callTrackVerified {
return;
}

if ([self isLastTokenValid]) {
[self scheduleNextIntervalWithToken:self.lastToken];
} else {
[self trackVerifiedWithBeacons:self.startedBeacons desiredAccuracy:RadarTrackingOptionsDesiredAccuracyHigh completionHandler:^(RadarStatus status, RadarVerifiedLocationToken *_Nullable token) {
[self scheduleNextIntervalWithToken:token];
}];
}
[self trackVerifiedWithBeacons:self.startedBeacons desiredAccuracy:RadarTrackingOptionsDesiredAccuracyHigh completionHandler:^(RadarStatus status, RadarVerifiedLocationToken *_Nullable token) {
[self scheduleNextIntervalWithToken:token];
}];
}

- (void)startTrackingVerifiedWithInterval:(NSTimeInterval)interval beacons:(BOOL)beacons {
Expand Down Expand Up @@ -288,7 +284,11 @@ - (void)startTrackingVerifiedWithInterval:(NSTimeInterval)interval beacons:(BOOL
nw_path_monitor_start(_monitor);
}

[self callTrackVerified];
if ([self isLastTokenValid]) {
[self scheduleNextIntervalWithToken:self.lastToken];
} else {
[self callTrackVerified];
}
}

- (void)stopTrackingVerified {
Expand Down

0 comments on commit 2789fcd

Please sign in to comment.