Skip to content

Commit

Permalink
Fixes #249 set timestamp on heading updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Jun 11, 2018
1 parent 1988f06 commit 32cb809
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,16 @@ public override void UpdatedHeading(CLLocationManager manager, CLHeading newHead

bestHeading = newHeading;
position.Heading = newHeading.TrueHeading;
haveHeading = true;
try
{
position.Timestamp = new DateTimeOffset(newHeading.Timestamp.ToDateTime());
}
catch (Exception ex)
{
position.Timestamp = DateTimeOffset.UtcNow;
}

haveHeading = true;

if (haveLocation && position.Accuracy <= desiredAccuracy)
{
Expand Down

0 comments on commit 32cb809

Please sign in to comment.