示例#1
0
        private async void HailTaxi(DriverModel driver)
        {
            state = "H";
            string uid = await _firebaseAuth.GetCurrentUser();

            Action <Dictionary <string, UserModel> > onValueEvent = null;

            onValueEvent = (Dictionary <string, UserModel> user) =>
            {
                try
                {
                    System.Diagnostics.Debug.WriteLine("---> EVENT GetDataFromFirebase ");

                    Action onSetValueSuccess = () =>
                    {
                    };

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

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


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