Exemplo n.º 1
0
        private async void GetUserEvent()
        {
            var user = await FireBaseController.GetUser(ContentManager.sessionUserProfile.Name);

            if (user != null)
            {
            }
        }
Exemplo n.º 2
0
        private async Task LoginAsync()
        {
            var loginResult = await client.LoginAsync();

            if (!loginResult.IsError)
            {
                var name  = loginResult.User.FindFirst(c => c.Type == "name")?.Value;
                var email = loginResult.User.FindFirst(c => c.Type == "email")?.Value;
                var image = loginResult.User.FindFirst(c => c.Type == "picture")?.Value;

                userProfile = new UserProfile()
                {
                    Email     = email,
                    Name      = name,
                    IconImage = ContentManager.ProfileIcons[0]
                };


                if (!await FireBaseController.HasUser(email))
                {
                    ContentManager.isUserNew          = true;
                    ContentManager.sessionUserProfile = userProfile;
                }
                else
                {
                    ContentManager.sessionUserProfile = await FireBaseController.GetUser(email);

                    Console.WriteLine("Local Storage 85 user icon " + ContentManager.sessionUserProfile.IconImage + " user name " + ContentManager.sessionUserProfile.Name);
                }

                //  var serializedLoginResponse = JsonConvert.SerializeObject(userProfile);
                AppDelegate.ToPageControllerAction.Invoke();
            }
            else
            {
                Console.WriteLine("Failure");
            }
        }