Пример #1
0
        async private void sendLocation(CLLocation loc)
        {
            int taskId = -1;

            taskId = UIApplication.SharedApplication.BeginBackgroundTask(() => {
                UIApplication.SharedApplication.EndBackgroundTask(taskId);
            });
            iOSLoginManager loginManager = iOSLoginManager.Instance;

            string userId     = loginManager.GetUserId();
            int    travelerId = loginManager.GetTravelerId();

            TravelerLocation travelerLoc = new TravelerLocation();

            travelerLoc.Latitude  = loc.Coordinate.Latitude;
            travelerLoc.Longitude = loc.Coordinate.Longitude;
            travelerLoc.TimeStamp = DateTime.UtcNow;
            //DateTime.SpecifyKind(loc.Timestamp, DateTimeKind.Utc);
            travelerLoc.UserId     = userId;
            travelerLoc.TravelerId = travelerId;

            TripManager tripManager = new TripManager();
            await tripManager.PostTravelerLocation(travelerLoc);

            UIApplication.SharedApplication.EndBackgroundTask(taskId);
        }
Пример #2
0
 private async void ReportLocation(TravelerLocation travelerLocation)
 {
     Log.Info("IDTO", "### location report ###");
     TripManager tripManager = new TripManager();
     await tripManager.PostTravelerLocation(travelerLocation);
 }