コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.MainDashboard);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);


            //Init Firebase
            auth = FirebaseAuth.GetInstance(AppDataHelper.GetAuth().App);

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();


            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            View           headerView     = navigationView.GetHeaderView(0);

            nameNav  = (TextView)headerView.FindViewById(Resource.Id.NameNav);
            emailNav = (TextView)headerView.FindViewById(Resource.Id.emailNav);
            RetrievedUser();


            navigationView.SetNavigationItemSelectedListener(this);
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "ForgotPassword" layout resource
            SetContentView(Resource.Layout.ForgotPassword);

            //Init Firebase
            auth = FirebaseAuth.GetInstance(MainActivity.app);

            //connectors
            //connecting input email in axml
            input_email = FindViewById <EditText>(Resource.Id.forgot_email);
            //connecting button reset in axml
            btnResetPass = FindViewById <Button>(Resource.Id.forgot_btn_reset);
            //connecting button back in axml
            btnBack = FindViewById <TextView>(Resource.Id.forgot_btn_back);
            //connecting layout in axml
            activity_forgot = FindViewById <RelativeLayout>(Resource.Id.activity_forgot);

            //onclick action
            //create a action to click the reset password button
            btnResetPass.SetOnClickListener(this);
            //create a action to click the back button
            btnBack.SetOnClickListener(this);
        }
コード例 #3
0
ファイル: addCar.cs プロジェクト: adelinger/carServiceApp
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view = inflater.Inflate(Resource.Layout.carDetails, container, false);

            markaVozila       = view.FindViewById <EditText>(Resource.Id.CDmarkaVozila);
            tipVozila         = view.FindViewById <EditText>(Resource.Id.CDTipVozila);
            godinaProizvodnje = view.FindViewById <EditText>(Resource.Id.CDgodiste);
            modelVozila       = view.FindViewById <EditText>(Resource.Id.CDmodelVozila);
            tipMotora         = view.FindViewById <EditText>(Resource.Id.CDvrstaGoriva);
            snagaMotora       = view.FindViewById <EditText>(Resource.Id.CDsnagaMotora);
            zapremninaMotora  = view.FindViewById <EditText>(Resource.Id.CDzapremninaMotora);
            carName           = view.FindViewById <EditText>(Resource.Id.CDimeVozila);
            saveCar           = view.FindViewById <Button>(Resource.Id.saveCar);

            FirebaseUser users = FirebaseAuth.GetInstance(loginActivity.app).CurrentUser;

            id = users.Uid;
            connectionStatus = Tag;

            if (connectionStatus == "Online")
            {
                createAppointment.updateUser();
            }

            saveCar.Click       += SaveCar_Click;
            carName.FocusChange += CarName_FocusChange;
            return(view);
        }
コード例 #4
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.ManageTracker);

            //View
            auth = FirebaseAuth.GetInstance(MainActivity.app);

            circular_progress = FindViewById <ProgressBar>(Resource.Id.circularProgress);
            input_name        = FindViewById <EditText>(Resource.Id.name);
            input_email       = FindViewById <EditText>(Resource.Id.email);
            list_data         = FindViewById <ListView>(Resource.Id.list_data);
            btnback           = FindViewById <Button>(Resource.Id.manageTracker_back);
            btndelete         = FindViewById <Button>(Resource.Id.manageTracker_delete);

            list_data.ItemClick += (s, e) =>
            {
                Account account = list_users[e.Position];
                selectedAccount  = account;
                input_name.Text  = account.name;
                input_email.Text = account.map;
            };

            await LoadData();

            btnback.Click   += BackToMap;
            btndelete.Click += deleteDb;
        }
コード例 #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Display Splash Screen for 4 Sec
            // Set our view from the "DeviceList" StartActivity
            //StartActivity(typeof(DeviceList));
            SetContentView(Resource.Layout.DeviceList);
            //calling the api to the main activity
            auth = FirebaseAuth.GetInstance(MainActivity.app);
            //calling the list to the axml
            list_device = FindViewById <ListView>(Resource.Id.list_device);
            //calling the back button in the axml
            btn_back = FindViewById <Button>(Resource.Id.devicelist_btnback);

            mItems = new List <string>();
            mItems.Add("356940032033323");


            //DatabaseReference peopleReference = FirebaseDatabase.GetInstance(FirebaseURL).GetReference(auth.CurrentUser.Uid);

            ArrayAdapter <string> adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, mItems);

            list_device.Adapter = adapter;

            list_device.ItemClick += listitemClick;

            btn_back.Click += BckClick;
        }
コード例 #6
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your fragment here
            auth = FirebaseAuth.GetInstance(Login.app);
        }
コード例 #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            // To use this you have to set up a project in the Firebase console and add the google-services.json file
            var baseOptions = FirebaseOptions.FromResource(Application.Context);
            var options     = new FirebaseOptions.Builder(baseOptions)
                              .SetProjectId(baseOptions.StorageBucket.Split('.')[0])
                              .Build();

            var fa = FirebaseApp.InitializeApp(Application.Context, options, "Xamarin");

            //FirebaseApp fa = FirebaseApp.InitializeApp(Application.Context);

            mAuth = FirebaseAuth.GetInstance(fa);

            if (mAuth == null)
            {
                Console.WriteLine("mAuth is null");
            }

            AuthCredential credential = EmailAuthProvider.GetCredential("*****@*****.**", "password");

            var creds = mAuth.SignInWithEmailAndPassword("*****@*****.**", "password"); // Here the program crashes due to a null mAuth
        }
コード例 #8
0
        private async void LoadData()
        {
            FirebaseUser users = FirebaseAuth.GetInstance(loginActivity.app).CurrentUser;

            id = users.Uid;

            List <services> getServices = con.db.Query <services>("SELECT * FROM services");

            foreach (var item in getServices)
            {
                vrstaUslugeList.Add(item.name);
            }

            List <User> data = con.db.Query <User>("SELECT * FROM User WHERE uid = '" + id + "'");

            foreach (var item in data)
            {
                userInput_ime.Text     = item.name;
                userInput_prezime.Text = item.lastName;
                userInput_broj.Text    = item.phone;
                userInput_email.Text   = item.email;
                userInput_mjesto.Text  = item.city;
                userInpu_ulicaibr.Text = item.adress;
            }
        }
コード例 #9
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            SetContentView(Resource.Layout.createAppointment);

            vrstaUsluge       = FindViewById <Spinner>(Resource.Id.vrstaUsluge);
            vrstaPosla        = FindViewById <Spinner>(Resource.Id.vrstaPosla);
            userInput_ime     = FindViewById <EditText>(Resource.Id.CAinputIme);
            userInput_prezime = FindViewById <EditText>(Resource.Id.CAinputPrezime);
            userInput_broj    = FindViewById <EditText>(Resource.Id.CAinputBrojTelefona);
            userInput_email   = FindViewById <EditText>(Resource.Id.CAinputEmail);
            userInpu_ulicaibr = FindViewById <EditText>(Resource.Id.CAinputUlicaIBroj);
            userInput_mjesto  = FindViewById <EditText>(Resource.Id.CAinputMjesto);
            next = FindViewById <Button>(Resource.Id.CANextButton);

            auth = FirebaseAuth.GetInstance(loginActivity.app);
            user = auth.CurrentUser.Uid;

            vrstaUslugeList.Add("Odaberite stavku");
            vrstaPoslaList.Add("Odaberite stavku");

            LoadData();

            ArrayAdapter <string> adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, vrstaUslugeList);

            vrstaUsluge.Adapter = adapter;

            next.Click += Next_Click;
            vrstaUsluge.ItemSelected += VrstaUsluge_ItemSelected;
        }
コード例 #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Registration);

            auth = FirebaseAuth.GetInstance(MainActivity.app);

            database = FirebaseDatabase.GetInstance(MainActivity.app);

            register_btn = FindViewById <Button>(Resource.Id.register_button);
            name         = FindViewById <EditText>(Resource.Id.user_name);
            phone_number = FindViewById <EditText>(Resource.Id.user_phone);
            email        = FindViewById <EditText>(Resource.Id.user_email);
            password     = FindViewById <EditText>(Resource.Id.user_password);
            location     = FindViewById <EditText>(Resource.Id.user_location);

            Set_Entries();

            initSpinner();


            register_btn.Click += Register_User;
        }
コード例 #11
0
        private void InitFriebase()
        {
            var options = new Firebase.FirebaseOptions.Builder()
                          .SetApiKey("AIzaSyAvDZA3xwVepEniUr0Jr3-vcGuIWs4MV64")
                          .SetApplicationId("project-706ea")
                          .Build();

            bool hasBeenInitialised          = false;
            IList <FirebaseApp> firebaseApps = FirebaseApp.GetApps(this);

            FirebaseApp.GetApps(this);
            foreach (FirebaseApp tempapp in firebaseApps)
            {
                if (tempapp.Name.Equals(FirebaseApp.DefaultAppName))
                {
                    hasBeenInitialised = true;
                    app = tempapp;
                }
            }

            if (!hasBeenInitialised)
            {
                app = FirebaseApp.InitializeApp(this, options);
            }
            auth = FirebaseAuth.GetInstance(app);
        }
コード例 #12
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.MainPage_Customer);

            database = FirebaseDatabase.GetInstance(MainActivity.app);

            mylist = FindViewById <ListView>(Resource.Id.listView);

            await loadData();

            auth = FirebaseAuth.GetInstance(MainActivity.app);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.hamburger_drawer);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(true);

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            Setup_Nav();

            mylist.ItemClick += Mylist_ItemClick;
        }
コード例 #13
0
ファイル: Dashboard.cs プロジェクト: jodyrutter/Ensemble
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.DashBoard);

            //Init Firebase
            auth = FirebaseAuth.GetInstance(MainActivity.app);


            //View
            btnChangePwd       = FindViewById <Button>(Resource.Id.dashboard_btn_change_pass);
            btnDelete          = FindViewById <Button>(Resource.Id.dashboard_btn_delete_pass);
            btnProfile         = FindViewById <Button>(Resource.Id.dashboard_btn_go_profile);
            btnMessages        = FindViewById <Button>(Resource.Id.dashboard_btn_go_messages);
            txtWelcome         = FindViewById <TextView>(Resource.Id.dashboard_welcome);
            btnLogOut          = FindViewById <Button>(Resource.Id.dashboard_btn_logout);
            input_new_pwd      = FindViewById <EditText>(Resource.Id.dashboard_newpassword);
            activity_dashboard = FindViewById <RelativeLayout>(Resource.Id.activity_dashboard);

            btnChangePwd.SetOnClickListener(this);
            btnDelete.SetOnClickListener(this);
            btnLogOut.SetOnClickListener(this);
            btnMessages.SetOnClickListener(this);

            //check session
            if (auth != null)
            {
                txtWelcome.Text = "Welcome , " + auth.CurrentUser.Email + "Favorite instrument";
            }
        }
コード例 #14
0
ファイル: SignUp.cs プロジェクト: BogartPoe/Abtracks-Xamarin
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "SignUp" layout resource
            SetContentView(Resource.Layout.SignUp);

            //Init Firebase
            auth = FirebaseAuth.GetInstance(MainActivity.app);

            //connectors
            //connecting button singup in axml
            btnSignup = FindViewById <Button>(Resource.Id.signup_btn_register);
            //connecting button login in axml
            btnLogin = FindViewById <TextView>(Resource.Id.signup_btn_login);
            //connecting input email in axml
            input_email = FindViewById <EditText>(Resource.Id.signup_email);
            //connecting input password in axml
            input_password = FindViewById <EditText>(Resource.Id.signup_password);
            //connecting re input password in axml
            reinput_password = FindViewById <EditText>(Resource.Id.signup_repassword);
            //connecting button singup in axml
            activity_sign_up = FindViewById <RelativeLayout>(Resource.Id.activity_sign_up);

            //onclick action
            //create a action to click the login button
            btnLogin.SetOnClickListener(this);
            //create a action to click the sign up button
            btnSignup.SetOnClickListener(this);
        }
コード例 #15
0
        /*protected override void OnStart()
         * {
         *  //Check if user is signed in (non-null) and update UI accordingly
         *  if (auth.CurrentUser != null)
         *  {
         *      currentUser = auth.CurrentUser;
         *      //Adrian 03/28/18 TODO: Add code/function call to update UI
         *  }
         * }*/

        private void InitFirebase()
        {
            var options = new FirebaseOptions.Builder()
                          .SetApplicationId("1:100312271278:android:3d79789aa8f833cd")
                          .SetApiKey("AIzaSyAH9j_K2-wcnrmxj9hEarZaFvCh6dMsOWw")
                          .SetDatabaseUrl("https://fir-database-ec02e.firebaseio.com/")
                          .Build();

            if (app == null)
            {
                app = FirebaseApp.InitializeApp(this, options);
            }

            auth            = FirebaseAuth.GetInstance(app);
            auth.AuthState += (sender, e) =>
            {
                currentUser = e?.Auth?.CurrentUser;

                if (currentUser != null)
                {
                }
                else
                {
                }
            };
        }
コード例 #16
0
ファイル: MainActivity.cs プロジェクト: wongn27/Recipe
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);


            mAuth = FirebaseAuth.GetInstance(FirebaseApp.Instance);
            var reference = CrossCloudFirestore.Current.Instance;

            mAuth.CreateUserWithEmailAndPassword(email, password);


            emailEditText    = FindViewById <EditText>(Resource.Id.emailEditText);
            passwordEditText = FindViewById <EditText>(Resource.Id.passwordEditText);
            loginButton      = FindViewById <Button>(Resource.Id.loginButton);
            registerButton   = FindViewById <Button>(Resource.Id.goToRegisterButton);

            this.FindViewById <Button>(Resource.Id.loginButton).Click += this.Message;

            //registerButton.Click += delegate
            //{
            //    SetContentView(Resource.Layout.activity_register);
            //};

            loginButton.Click += LoginButton_Click;
        }
コード例 #17
0
        //public async Task<string> AuthenticateUsingCredential(AuthCredential cred)
        //{
        //    try
        //    {

        //        var user = mAuth.SignInWithCredential(cred);
        //        //var token = await user.User.GetIdTokenAsync(false);
        //        return token.Token;
        //    }
        //    catch (FirebaseAuthInvalidUserException e)
        //    {
        //        e.PrintStackTrace();
        //        return string.Empty;
        //    }
        //    catch (FirebaseAuthInvalidCredentialsException e)
        //    {
        //        e.PrintStackTrace();
        //        return string.Empty;

        //    }
        //}

        public void InitializeFireBase(Context context)
        {
            var app = FirebaseApp.InitializeApp(context);

            mContext = context;

            if (app == null)
            {
                var options = new FirebaseOptions.Builder()
                              .SetApplicationId("testproject-26b97")
                              .SetApiKey("AIzaSyCqsCzTUJb4x3esTr40iJx7rZr5flvZzxg")
                              //.SetDatabaseUrl("")
                              //.SetStorageBucket("")
                              .Build();
                app   = FirebaseApp.InitializeApp(context, options);
                mAuth = FirebaseAuth.GetInstance(app);
            }
            else
            {
                mAuth = FirebaseAuth.Instance;
                if (mAuth == null)
                {
                    mAuth = new FirebaseAuth(app);
                }
            }
        }
コード例 #18
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.confirmOrder);
            Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);

            confirmOrderButton = FindViewById <Button>(Resource.Id.COconfirmOrderButton);
            userInfo           = FindViewById <TextView>(Resource.Id.COuserInfo);
            chosenServices     = FindViewById <TextView>(Resource.Id.COchosenServices);
            chosenCar          = FindViewById <TextView>(Resource.Id.COchosenCar);
            opisKvara          = FindViewById <TextView>(Resource.Id.COopisKvara);
            addDate            = FindViewById <Button>(Resource.Id.COpickaDate);
            addedDate          = FindViewById <TextView>(Resource.Id.bestPossibleDate);

            vrstaPosla   = Intent.GetStringExtra("vrstaPosla");
            vrstaUsluge  = Intent.GetStringExtra("vrstaUsluge");
            carChosen    = Intent.GetStringExtra("carChosen");
            getOpisKvara = Intent.GetStringExtra("opisKvara");

            potrebnaVucnaSluzba = Intent.GetBooleanExtra("potrebnaVucnaSluzba", false);
            potrebnoNarucivanje = Intent.GetBooleanExtra("potrebnoNarucivanje", false);

            if (potrebnaVucnaSluzba)
            {
                zahtjevZaVucnomSluzbom = "Da";
            }
            if (!potrebnaVucnaSluzba)
            {
                zahtjevZaVucnomSluzbom = "Ne";
            }
            if (potrebnoNarucivanje)
            {
                zahtjevZaNarucivanjem = "Da";
            }
            if (!potrebnoNarucivanje)
            {
                zahtjevZaNarucivanjem = "Ne";
            }

            var auth = FirebaseAuth.GetInstance(loginActivity.app);

            id = auth.CurrentUser.Uid;

            getUserInfo();


            userInfo.Text       = userData;
            chosenServices.Text = vrstaUsluge + ", " + vrstaPosla + ", " + "Zahtjev za vučnom službom: " + "" + zahtjevZaVucnomSluzbom + ", " + "Zahtjev za naručivanjem dijelova: " + zahtjevZaNarucivanjem;
            chosenCar.Text      = carChosen;
            opisKvara.Text      = getOpisKvara;

            userInfo.Click       += UserInfo_Click;
            chosenCar.Click      += ChosenCar_Click;
            opisKvara.Click      += OpisKvara_Click;
            chosenServices.Click += ChosenServices_Click;

            confirmOrderButton.Click += ConfirmOrderButton_Click;
            addDate.Click            += AddDate_Click;
        }
コード例 #19
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "ViewMap" layout resource
            SetContentView(Resource.Layout.Email);
            // Create your application here

            //Init Firebase
            auth = FirebaseAuth.GetInstance(MainActivity.app);

            //connectors
            //connecting webview in axml
            webView = FindViewById <WebView>(Resource.Id.webView1);
            //connenting back buttion in axml
            btnback = FindViewById <Button>(Resource.Id.button1);

            webView.SetWebViewClient(new ExtenWebViewClient());


            WebSettings webSettings = webView.Settings;

            webSettings.JavaScriptEnabled = true;

            //  txtemail.Click += EmailOnclick;

            //Checking session



            MaplinkFirebase();

            //onclick action
            //create a action to click the back button
            btnback.SetOnClickListener(this);
        }
コード例 #20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SignUp);

            //init Firebase
            try
            {
                auth = FirebaseAuth.GetInstance(Login.appFlights);
            }
            catch
            {
                Console.WriteLine(auth);
            }
            //view
            btnSignup       = FindViewById <Button>(Resource.Id.signup_btn);
            btnLogin        = FindViewById <TextView>(Resource.Id.signup_login);
            btnForgotPass   = FindViewById <TextView>(Resource.Id.signup_btn_forgot_password);
            input_email     = FindViewById <EditText>(Resource.Id.signup_email);
            input_password  = FindViewById <EditText>(Resource.Id.signup_password);
            activity_signup = FindViewById <RelativeLayout>(Resource.Id.signUp);

            btnLogin.SetOnClickListener(this);
            btnForgotPass.SetOnClickListener(this);
            btnSignup.SetOnClickListener(this);
        }
コード例 #21
0
        public static FirebaseAuth GetAuth()
        {
            var          app = FirebaseApp.InitializeApp(Application.Context);
            FirebaseAuth auth;

            if (app == null)
            {
                var option = new FirebaseOptions.Builder()
                             .SetApplicationId("pediburratingapp")
                             .SetApiKey("AIzaSyC6ZBvONyo6vt7ZH1pzwG8i1oxsEnXLRLA")
                             .SetDatabaseUrl("https://pediburratingapp.firebaseio.com")
                             .SetStorageBucket("pediburratingapp.appspot.com")
                             .Build();

                app = FirebaseApp.InitializeApp(Application.Context, option);

                auth = FirebaseAuth.GetInstance(app);
            }
            else
            {
                auth = FirebaseAuth.GetInstance(app);
            }

            return(auth);
        }
コード例 #22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "AddTracker" layout resource
            SetContentView(Resource.Layout.AddTracker);

            //Init Firebase
            auth = FirebaseAuth.GetInstance(MainActivity.app);

            //connectors
            //connecting email in axml
            txtWelcome = FindViewById <TextView>(Resource.Id.dashboard_welcome);
            //connecting button back in axml
            back = FindViewById <Button>(Resource.Id.dashboard_btnback);
            //conneting to add button in axml
            add = FindViewById <Button>(Resource.Id.dashboard_btn_add);
            //conneceting input add in the axml
            input_add = FindViewById <EditText>(Resource.Id.dashboard_renewpassword);
            //create an onlick action on add button
            inputname = FindViewById <EditText>(Resource.Id.dashboard_name);

            add.Click += addOnClick;
            //onclick action

            //create a action to click the back button
            back.SetOnClickListener(this);

            //Checking session
            //create a funtion that display the email
            if (auth.CurrentUser != null)
            {
                txtWelcome.Text = "Do you want to Add a Tracker, " + auth.CurrentUser.Email;
            }
        }
コード例 #23
0
        public async Task <string> LoginWithEmailPasswordAsync(string email, string password)
        {
            var instance = FirebaseAuth.GetInstance(MainActivity.app);

            if (instance == null)
            {
                mAuth = new FirebaseAuth(MainActivity.app);
            }
            else
            {
                mAuth = instance;
            }

            IAuthResult res;

            try
            {
                res = await mAuth.SignInWithEmailAndPasswordAsync(email, password);
            }
            catch (Exception ex)
            {
                return(await Task.FromResult("false:" + ex.Message));
            }
            return(null);
        }
コード例 #24
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Dashboard);

            //init firebase
            auth = FirebaseAuth.GetInstance(MainActivity.app);

            //view
            txtWelcome          = FindViewById <TextView>(Resource.Id.dashboard_welcome);
            input_new_password  = FindViewById <EditText>(Resource.Id.dashboard_newpassword);
            btnChangePass       = FindViewById <Button>(Resource.Id.dashboard_btn_change_pass);
            btnLogout           = FindViewById <Button>(Resource.Id.dashboard_btn_logout);
            acitivity_dashboard = FindViewById <RelativeLayout>(Resource.Id.activity_dashboard);

            btnChangePass.SetOnClickListener(this);
            btnLogout.SetOnClickListener(this);

            //check session
            if (auth.CurrentUser != null)
            {
                txtWelcome.Text = "Welcome ," + auth.CurrentUser.Email;
            }
        }
コード例 #25
0
ファイル: MainActivity.cs プロジェクト: eduardegomez/AppTest
        private void InitFirebaseAuth()
        {
            FirebaseOptions firebaseOptions = new FirebaseOptions.Builder()
                                              .SetApplicationId("1:827796226132:android:92005fe6efc1faf20a2dc1")
                                              .SetApiKey("AIzaSyBRjnuEAX65axPVwdeWTERXWYiABtjdqNs")
                                              .SetDatabaseUrl("https://tfgedu-6bc6f.firebaseio.com")
                                              .SetStorageBucket("tfgedu-6bc6f.appspot.com")
                                              .Build();

            if (app == null)
            {
                app = FirebaseApp.InitializeApp(this, firebaseOptions, "TFGEdu");
            }

            if (app == null)
            {
                Console.WriteLine("app sigue siendo null");
            }

            auth = FirebaseAuth.GetInstance(app);

            if (auth == null)
            {
                Console.WriteLine("AUTH sigue sinedo null");
            }
        }
コード例 #26
0
        public void OnAuthStateChanged(FirebaseAuth auth)
        {
            FirebaseUser user = FirebaseAuth.GetInstance(app).CurrentUser;

            if (user != null)
            {
            }
        }
コード例 #27
0
        private void makeDatabaseRecord(string token)
        {
            FirebaseUser users = FirebaseAuth.GetInstance(loginActivity.app).CurrentUser;

            id = users.Uid;
            var firebase = new FirebaseClient(loginActivity.FirebaseURL);
            var item     = firebase.Child("tokens").Child(id).PutAsync <string>(token);
        }
コード例 #28
0
ファイル: Auth.cs プロジェクト: armandasalmd/tidalio
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="context"></param>
 private AuthHelper(Context context)
 {
     this.context = context;
     if (app == null)
     {
         app = FirebaseApp.InitializeApp(context, GetOptions());
     }
     auth = FirebaseAuth.GetInstance(app);
 }
コード例 #29
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.MyLocationLayout);

            this.AddMapFragmentToLayout(Resource.Id.map_container);

            auth = FirebaseAuth.GetInstance(MainActivity.app);
        }
コード例 #30
0
        public override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            auth     = FirebaseAuth.GetInstance(MainActivity.app);
            database = FirebaseDatabase.GetInstance(MainActivity.app);

            await loadData();
        }