Exemplo n.º 1
0
        public static LocationShare CreateLocationShare(UserInfo user, ShareSettings settings)
        {
            try {
                Console.WriteLine ("test");
                LocationShareData data = new LocationShareData () {
                    UserId = user.Id,
                    UserName = user.Name,
                    UserIcon = user.Icon,
                    UserRegistrationId = user.RegistrationId,
                    PublicId = GenerateRandomId (),
                    PrivateId = GenerateRandomId (),
                    Longitude = 0,
                    Latitude = 0,
                    SharedTime = DateTime.Now,
                    ExpireTime = settings.CalculateTimeout (),
                    ExpireOnArrival = settings.CancelOnArrival
                };

                var db = GetConnection ();
                db.InsertObject (data);
                LogService.Log ("Registered Share " + data.PublicId + ", with private Id " + data.PrivateId + ", registration id " + user.RegistrationId);
                return new LocationShare (data, null);
            } catch (Exception e) {
                ThrowFailure (e);
                throw;
            }
        }
Exemplo n.º 2
0
 public LocationShare CreateLocationShare(UserInfo user, ShareSettings settings)
 {
     return TrackService.CreateLocationShare (user, settings);
 }