Beispiel #1
0
        public static async Task <string> GetTinyUrl(GeoCoordinate gc)
        {
            //https://<domain>/default.aspx?V=2&t=SKe/CBsBqQ3mMrXFT4s2UIk6ADFMpCqYljOpw00KNmkvVt8LnTxgiozDf9qIYF0MMSGsfzGnb9P8SEgPKmqo9w==&ut=635651427039540000&d=635651229039990000&l=17.4315747&g=78.3433867

            string url = Config.GuardianPortalUrl + @"default.aspx?V=2&";

            if (Globals.IsRegisteredUser && !Globals.IsDataNetworkAvailable)
            {
                string encryptedParameters   = EncryptAndDecrypt.Encrypt(string.Format("p={0}&s={1}&f={2}", Globals.User.CurrentProfileId, Globals.CurrentProfile.SessionToken, Globals.CurrentProfile.IsSOSOn));
                string encodeEncryptedParams = EncryptAndDecrypt.EncodeString(encryptedParameters);

                url += string.Format("t={0}&ut={1}&", encodeEncryptedParams, DateTime.UtcNow.Ticks.ToString());
            }

            url += string.Format("d={0}&l={1}&g={2}", DateTime.Now.Ticks.ToString(), gc.Latitude, gc.Longitude);

            if (Globals.IsRegisteredUser && Globals.IsDataNetworkAvailable)
            {
                url = string.Format("pr={0}&s={1}", Globals.User.CurrentProfileId, Globals.CurrentProfile.SessionToken);
            }

            return(await Utility.GetShortUrl(url));
        }