public FirebaseHelper() { client = new FirebaseClient("https://bim493project.firebaseio.com/"); storage = new FirebaseStorage("bim493project.appspot.com"); authService = DependencyService.Get <IFirebaseAuthService>(); }
public App() { InitializeComponent(); SetUpUnity(); _firebaseAuthService = ServiceLocator.Current.GetInstance <IFirebaseAuthService>(); }
public MainViewModel(IFirebaseAuthService firebaseAuthService, IMvxNavigationService mvxNavigationService) { _firebaseAuthService = firebaseAuthService; _mvxNavigationService = mvxNavigationService; LoginUserCommand = new MvxCommand(LoginUserAsync); RegisterUserCommand = new MvxCommand(RegisterUserAsync); }
public SigninPage() { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); MessagingCenter.Subscribe <object, string>(this, "INFO", (sender, data) => { if (data != null) { ShowInfo(data); } }); MessagingCenter.Subscribe <object, string>(this, "seccuss", (sender, data) => { if (data != null) { UpdateUINavigate(data); } }); }
public SignInViewModel( AppBootstrapper appBootstrapper, IAuthService authService = null, IFirebaseAuthService firebaseAuthService = null) : base(null) { _firebaseAuthService = firebaseAuthService ?? Locator.Current.GetService <IFirebaseAuthService>(); authService = authService ?? Locator.Current.GetService <IAuthService>(); TriggerGoogleAuthFlow = ReactiveCommand.Create( () => { _provider = "google"; authService.TriggerGoogleAuthFlow( Config.GoogleAuthConfig.CLIENT_ID, null, Config.GoogleAuthConfig.SCOPE, Config.GoogleAuthConfig.AUTHORIZE_URL, Config.GoogleAuthConfig.REDIRECT_URL, Config.GoogleAuthConfig.ACCESS_TOKEN_URL); }); TriggerGoogleAuthFlow.ThrownExceptions.Subscribe( ex => { this.Log().Debug(ex); }); authService.SignInSuccessful .SelectMany(authToken => AuthenticateWithFirebase(authToken)) .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(_ => appBootstrapper.MainView = new MainViewModel(appBootstrapper)); }
public FirebaseService(IFirebaseAuthService firebaseAuthService, string collectionName) { FirestoreDb db = FirestoreDb.Create(ApiKeys.FirebaseProjectId); collection = db.Collection(collectionName); this.firebaseAuthService = firebaseAuthService; }
public BookedTicket() { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); }
public ProfileViewModel(IUserDialogs userDialogServices) { _userDialogService = userDialogServices; _firebaseAuthService = DependencyService.Get <IFirebaseAuthService>(); _firebaseDatabaseService = DependencyService.Get <IFirebaseDBService>(); _firebaseDatabaseService.Connect(); }
public FeedbackPage() { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); }
public PhoneAuthPhoneNumberEntryViewModel( AuthAction authAction, IObservable <Unit> whenVerified, IFirebaseAuthService firebaseAuthService = null, IViewStackService viewStackService = null) : base(viewStackService) { _firebaseAuthService = firebaseAuthService ?? Locator.Current.GetService <IFirebaseAuthService>(); var canExecute = this.WhenAnyValue( vm => vm.PhoneNumber, phoneNumber => { return(!string.IsNullOrEmpty(phoneNumber)); }); VerifyPhoneNumber = ReactiveCommand.CreateFromObservable( () => { if (authAction == AuthAction.SignIn) { return(_firebaseAuthService .SignInWithPhoneNumber(_phoneNumber) .SelectMany(result => HandleResult(authAction, result, whenVerified))); } else { return(_firebaseAuthService.CurrentUser .LinkWithPhoneNumber(PhoneNumberTest) .SelectMany(result => HandleResult(authAction, result, whenVerified))); } }, canExecute); VerifyPhoneNumber.ThrownExceptions .Subscribe( ex => { if (ex is FirebaseAuthException firebaseEx) { switch (firebaseEx.FirebaseAuthExceptionType) { case FirebaseAuthExceptionType.FirebaseAuth: Console.WriteLine(firebaseEx.Message); break; case FirebaseAuthExceptionType.FirebaseAuthInvalidCredentials: Console.WriteLine(firebaseEx.Message); break; } Console.WriteLine(firebaseEx.Message); } else { Console.WriteLine(ex.Message); } }); }
public FirebaseClientSingleton(IFirebaseAuthService firebaseAuthService) : base( Constants.FIREBASE_REALTIME_DATABASE_BASE_URL, new FirebaseOptions() { AuthTokenAsyncFactory = async() => (await firebaseAuthService.GetAuth()).FirebaseToken }) { }
public FirebaseDataStore(IFirebaseAuthService authService, string path) { var token = authService.AuthLink.FirebaseToken; this.uid = authService.AuthLink.User.LocalId; _query = new FirebaseClient(Config.ApiKeys.FirebaseUrl, () => Task.FromResult(token)) .Child(path); }
public LoginViewModel(IUserDialogs userDialogsService) { _userDialogService = userDialogsService; _firebaseService = DependencyService.Get <IFirebaseAuthService>(); MessagingCenter.Subscribe <String, String>(this, _firebaseService.getAuthKey(), (sender, args) => { LoginGoogle(args); }); }
public CheckPage() { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); CheckForInternet(); }
public TokenAuthenticationHandler( IOptionsMonitor <AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IFirebaseAuthService firebaseAuthService) : base(options, logger, encoder, clock) { this.firebaseAuthService = firebaseAuthService; }
public AccountController(IFirebaseAuthService firebaseAuthService, IFirebaseDbService firebaseDbService, IMemoryCache memoryCache, IConfiguration configuration) { this.firebaseAuthService = firebaseAuthService; this.firebaseDbService = firebaseDbService; this.memoryCache = memoryCache; this.cacheEntryOptions = new MemoryCacheEntryOptions() .SetAbsoluteExpiration(TimeSpan.FromMinutes(int.Parse(configuration["CacheExpiryInMinutes"] ?? "60"))); this.issuer = configuration["MyCompany"]; this.twoFactorAuth = new TwoFactorAuth(issuer); }
public RepositoryRegistrar(IFirebaseAuthService firebaseAuthService, IMutableDependencyResolver dependencyResolver) { _firebaseClient = CreateFirebaseClient(firebaseAuthService); dependencyResolver.Register(() => CatalogCategoryRepo, typeof(ICatalogCategoryRepo)); dependencyResolver.Register(() => CatalogItemRepoFactory, typeof(ICatalogItemRepoFactory)); dependencyResolver.Register(() => UserRepo, typeof(IRepository <SSBakeryUser>)); dependencyResolver.Register(() => RewardsMemberRepo, typeof(IRepository <RewardsMember>)); dependencyResolver.Register(() => AdminVarRepo, typeof(IAdminVarRepo)); }
public App() { InitializeComponent(); _firebaseService = DependencyService.Get <IFirebaseAuthService>(); MessagingCenter.Subscribe <String, String>(this, _firebaseService.getAuthKey(), (sender, args) => { LoginGoogle(args); }); MainPage = new NavigationPage(new MainPage()); }
public RegistrationTypeSelectionPageViewModel( INavigationService navigationService, IAnalyticService analyticService, IFirebaseAuthService authService, IUserDialogs dialogs) : base(navigationService) { Title = "Registration Type"; analyticService.TrackScreen("registration-type"); Tradesman = ReactiveCommand.CreateFromTask(async() => { await dialogs.AlertAsync("Coming Soon!").ConfigureAwait(false); analyticService.TrackTapEvent("register-as-tradesman"); //await navigationService.NavigateAsync(nameof(TradesmentRegistrationPage)).ConfigureAwait(false); }); Contractor = ReactiveCommand.CreateFromTask(async() => { analyticService.TrackTapEvent("register-as-contractor"); await navigationService.NavigateAsync( nameof(ContractorRegistrationPage), new NavigationParameters { { "user_id", _userId } }).ConfigureAwait(false); }); GoBack = ReactiveCommand.CreateFromTask <Unit, Unit>(async _ => { var result = await dialogs.ConfirmAsync( new ConfirmConfig { Title = "Cancel Account Creation?", Message = "Are you sure you want to cancel account creation? This will discard any information you have entered so far", OkText = "Yes", CancelText = "No" }); if (result) { analyticService.TrackTapEvent("cancel-account-creation"); // make sure we log out so the user has to log in again await authService.Logout(); await NavigationService.NavigateToLoginPageAsync().ConfigureAwait(false); } return(Unit.Default); }); NavigatingTo .Where(args => args.ContainsKey("user_id")) .Select(args => args["user_id"].ToString()) .BindTo(this, x => x._userId); }
public MainViewModel() { _firebaseAuthService = DependencyService.Get <IFirebaseAuthService>(); _firebaseDatabaseService = DependencyService.Get <IFirebaseDBService>(); _firebaseDatabaseService.Connect(); _firebaseDatabaseService.GetMessage(); MessagingCenter.Subscribe <String, String>(this, _firebaseDatabaseService.GetMessageKey(), (sender, args) => { Message = (args); }); }
public MainContainerPage() { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); user = new UserModel(); }
public ProfilePage(Models.UserModel user) { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); SetProfile(user); GetProfile(); }
public BookTicket(object ticket) { InitializeComponent(); ticketModel = ticket as TicketModel; _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); ViewTicket(ticketModel); }
public RegisterViewModel( IMvxNavigationService mvxNavigationService, INotificationService notificationService, IFirebaseAuthService firebaseAuthService, IUserRepository userRepository) { _mvxNavigationService = mvxNavigationService; _firebaseAuthService = firebaseAuthService; _notificationService = notificationService; _userRepository = userRepository; RegisterUserCommand = new MvxCommand(RegisterUserAsync); }
public MainPage() { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); Device.StartTimer(new TimeSpan(0, 0, 3), () => { Geo_Clicked(null, null); return(true); }); }
public LoginViewModel( IMvxNavigationService mvxNavigationService, IUserRepository userRepository, INotificationService notificationService, IFirebaseAuthService firebaseAuthService) { _mvxNavigationService = mvxNavigationService; _userRepository = userRepository; _firebaseAuthService = firebaseAuthService; _notificationService = notificationService; LoginUserCommand = new MvxCommand(LoginUserAsync); }
public MainViewModel() { _firebaseAuthService = DependencyService.Get <IFirebaseAuthService>(); _firebaseDatabaseService = DependencyService.Get <IFirebaseDBService>(); _firebaseDatabaseService.Connect(); _firebaseDatabaseService.GetMessage(); MessagingCenter.Subscribe <String, ObservableCollection <Homework> >(this, _firebaseDatabaseService.GetMessageKey(), (sender, args) => { //Message = (args); List = new ObservableCollection <Homework>(args.OrderBy(x => x.HomeWork)); }); }
public RewardsProgramActivationViewModel(IFirebaseAuthService firebaseAuthService = null, IViewStackService viewStackService = null) : base(viewStackService) { _firebaseAuthService = firebaseAuthService ?? Locator.Current.GetService <IFirebaseAuthService>(); NavigateToPhoneNumberVerificationPage = ReactiveCommand.CreateFromObservable( () => { return(ViewStackService .PushPage(new PhoneAuthPhoneNumberEntryViewModel(AuthAction.LinkAccount, WhenLinked()))); }); }
public BookRoomPage(object room, object hotel) { InitializeComponent(); _firebaseDatabase = DependencyService.Get <IFirebaseDatabaseService>(); _firebaseAuth = DependencyService.Get <IFirebaseAuthService>(); Room = room as RoomModel; BHotel = hotel as HotelModel; ShowRoom(Room, BHotel); }
public MainViewModel(IFirebaseAuthService authService = null, IViewStackService viewStackService = null) : base(viewStackService) { _authService = authService ?? Locator.Current.GetService <IFirebaseAuthService>(); NavigateToCatalogPage = ReactiveCommand.CreateFromObservable( () => { return(ViewStackService.PushPage(new CatalogCategoryListViewModel())); }); NavigateToAlbumPage = ReactiveCommand.CreateFromObservable( () => { return(ViewStackService.PushPage(new AlbumListViewModel())); }); NavigateToStoreInfoPage = ReactiveCommand.CreateFromObservable( () => { return(ViewStackService.PushPage(new StoreInfoViewModel())); }); if (_authService.CurrentUser.Providers.Contains("phone")) { NavigateToRewardsPage = ReactiveCommand.CreateFromObservable( () => { return(ViewStackService.PushPage(new RewardsViewModel())); }); } else { NavigateToRewardsPage = ReactiveCommand.CreateFromObservable( () => { return(ViewStackService.PushPage(new RewardsProgramActivationViewModel())); }); } this.WhenActivated( d => { Disposable.Empty.DisposeWith(d); }); NavigateToCatalogPage.ThrownExceptions.Subscribe( ex => { System.Console.WriteLine(ex.Message); }); }