Beispiel #1
0
        private async void GetProfile()
        {
            string uid = await _firebaseAuth.GetCurrentUser();

            Action <Dictionary <string, UserModel> > onValueEvent = (Dictionary <string, UserModel> users) =>
            {
                try
                {
                    System.Diagnostics.Debug.WriteLine("---> EVENT Get Profile Firebase ");

                    Action onSetValueSuccess = () =>
                    {
                    };

                    Action <string> onSetValueError = (string errorDesc) =>
                    {
                    };

                    if (users != null)
                    {
                        foreach (KeyValuePair <string, UserModel> item in users)
                        {
                            if (item.Key == uid)
                            {
                                SetProfile(item.Value);
                                user = item.Value;
                            }
                        }
                    }
                    else
                    {
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("---> error Get Profile Firebase " + ex.Message);
                    throw;
                }
            };


            _firebaseDatabase.GetCheckProfile("users", onValueEvent);
        }