Ejemplo n.º 1
0
        public async void Init()
        {
            //Add key to map

            if (!ImageController.Images.ContainsKey("key"))
            {
                await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-cdn/mobile-assets/key.png", "key");
            }

            //Add envelope image to map
            if (!ImageController.Images.ContainsKey("envelope"))
            {
                await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-mobile-assets/RequestAccountViewController/envelope.png", "envelope");
            }

            //Add porpoise image to map}
            if (!ImageController.Images.ContainsKey("porpoiseHeader"))
            {
                await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-mobile-assets/Image+1.png", "porpoiseHeader");
            }
            //Load Avatar Image
            if (!ImageController.Images.ContainsKey("avatar"))
            {
                await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-mobile-assets/RequestAccountViewController/avatar+(1).png", "avatar");
            }

            //Load company icon
            if (!ImageController.Images.ContainsKey("company"))
            {
                await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-mobile-assets/RequestAccountViewController/building+(1).png", "company");
            }
            if (!ImageController.Images.ContainsKey("check"))
            {
                //Load checkmark
                await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-cdn/mobile-assets/checked.png", "check");
            }

            if (ImageController.Images.ContainsKey("porpoiseHeader"))
            {
                PorpoiseLogo = ImageController.Images["porpoiseHeader"];
            }

            if (ImageController.Images.ContainsKey("envelope"))
            {
                EnvelopeIcon = ImageController.Images["envelope"];
            }

            if (ImageController.Images.ContainsKey("key"))
            {
                KeyIcon = ImageController.Images["key"];
            }
        }
Ejemplo n.º 2
0
        private async void PerformAuthentication()
        {
            InFlight = false;
            try
            {
                //if (settings.Contains(AccountInfo.TOKENKEY))
                //{
                //    var token = settings.Get<string>(AccountInfo.TOKENKEY);
                //    AccountInfo.Token = token;
                //    authenticated = string.IsNullOrEmpty(AccountInfo.Token);
                //}
                var a = settings.Contains(AccountInfo.TOKENKEY);
                var b = settings.Get <string>(AccountInfo.TOKENKEY);

                if (settings.Contains(AccountInfo.user_email))
                {
                    AccountInfo.Profile_email = settings.Get <string>(AccountInfo.user_email);
                }

                authenticated = settings.Contains(AccountInfo.TOKENKEY) && settings.Get <string>(AccountInfo.TOKENKEY).Length > 0;


                if (!ImageController.Images.ContainsKey("key"))
                {
                    await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-cdn/mobile-assets/key.png", "key");
                }

                //Add envelope image to map
                if (!ImageController.Images.ContainsKey("envelope"))
                {
                    await ImageController.AddImageFromUrl("https://s3.amazonaws.com/porpoise-mobile-assets/RequestAccountViewController/envelope.png", "envelope");
                }

                if (!authenticated)
                {
                    Debug.WriteLine(AccountInfo.token_id);

                    InFlight = true;
                    ShowViewModel <IntroductionViewModel>();
                }
                else
                {
                    //AccountInfo.language = "EN";

                    AccountInfo.token_id = settings.Get <string>(AccountInfo.TOKENKEY);

                    PerformAuthenticateEvent(true);

                    /*
                     *  var param = new System.Collections.Generic.Dictionary<string, string>();
                     *
                     *  param.Add("initial", "1");
                     *
                     * ShowViewModel<HomeViewModel>(param);*/

                    ShowViewModel <AllProfilesViewModel>();



                    InFlight = true;
                }
            }
            catch (Exception ex)
            //TODO: ensure to log error
            {
            }
        }