How To Use Firebase Authentication With Xamarin Forms

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ •

  • @broadshare
    @broadshare 2 роки тому

    Your are so fluent, do you have any .Net courses? Always learning alot from your tuts, thank you

    • @TechWithPat
      @TechWithPat  2 роки тому

      I haven't thought about it yet but why not in the future.

  • @cissemy
    @cissemy 2 роки тому

    Thanks
    How to add authorization to it? I want admin to only access certain pages.

  • @nosiphokhumalo656
    @nosiphokhumalo656 3 роки тому

    where is the base viewModel coming from?

  • @tellezrosasrodrigoisaac4966
    @tellezrosasrodrigoisaac4966 2 роки тому

    The code is the same for Android?

  • @shivaninaeck2524
    @shivaninaeck2524 2 роки тому

    how to implement this for a cross platform app (both android and ios)

  • @dotnetdevni
    @dotnetdevni 3 роки тому

    How do u deal with roles such as admin user

  • @madraven37
    @madraven37 3 роки тому

    How can we check if the email is already registered? How can we connect the authentication on our realtime database?

  • @al-atawa7691
    @al-atawa7691 3 роки тому

    how to check if email already exist is signup function?

  • @TechWithPat
    @TechWithPat  4 роки тому +2

    Firebase Authentication in Xamarin Forms, let me know what you think

    • @gjhdigital
      @gjhdigital 4 роки тому +1

      Great stuff! Very helpful. Is there any way you can do a tutorial on OneSignal Push Notifications for iOS? I cant seem to get iOS working no matter what. thanks

    • @TechWithPat
      @TechWithPat  4 роки тому +1

      @@gjhdigital Thanks for your comments, I will think about a OneSignal tutorial.

    • @velicanevli
      @velicanevli 4 роки тому +1

      Hi bro thanks for video .I have a question . Other information of the login person, how do I hold it firebase database ?

    • @TechWithPat
      @TechWithPat  4 роки тому +1

      @@velicanevli If you want to save information like phone number, surname, etc.
      You will need to create a profile document in a database like Cloud Firestore or Realtime Database.
      The profile document can have a UserId property that will hold the user Uid.
      When you create a user with email and password, you also add a new profile document in the database.
      When a user connects, you can fetch his profile by Uid in the database.
      In the link below, you will find a NuGet package to interact with Firestore :
      github.com/f-miyu/Plugin.CloudFirestore

    • @velicanevli
      @velicanevli 4 роки тому +1

      @@TechWithPat thanks bro .I’ll try

  • @yesmangunera9574
    @yesmangunera9574 2 роки тому

    can it be used with android? And if so, what should be changed?

  • @greeksinmars
    @greeksinmars 3 роки тому

    how can be the same in Android ? and how can be the same in iOS via visual studio not xcode ?

  • @dannykhreet
    @dannykhreet 3 роки тому

    Thanks for this video. Do you have any idea how i can implement role for users on the registration form

    • @TechWithPat
      @TechWithPat  3 роки тому

      Danny, sorry but I never implemented role-based access in Xamarin

  • @joelcaracot411
    @joelcaracot411 Рік тому

    how about the authentication for andriod?

    • @TechWithPat
      @TechWithPat  Рік тому

      Check the Github repo : github.com/techwithpat/XamarinFormsFirebaseAth

  • @HamSamwichCHAPS
    @HamSamwichCHAPS 3 роки тому

    Does this not work for android?

  • @brianfortuna50
    @brianfortuna50 4 роки тому +1

    Hey Pat! .How could I implement it in android?

    • @TechWithPat
      @TechWithPat  4 роки тому +2

      In Firebase :
      Register an Android App. You will get a file named "google-services.json".
      In Visual Studio, in the Android project :
      add the following packages "Xamarin.Firebase.Auth" and "Xamarin.Firebase.Core".
      add the "google-services.json" file, set the build action to "GoogleServicesJson", you will need to edit the project file (.csproj) like below
      ItemGroup>
      In the main activity file, before the "LoadApplication" method, initialize Firebase.
      FirebaseApp.InitializeApp(Application.Context)
      In the service implementation, the code is the same, except the way you access the Firebase current instance.
      iOS : Firebase.Auth.Auth.DefaultInstance
      android : Firebase.Auth.FirebaseAuth.Instance

    • @brianfortuna50
      @brianfortuna50 4 роки тому +1

      @@TechWithPat Thank You so much! By the way, do you plan to make a video one day, but now have you implemented authentication for Google? Thanks again and excuse my English

    • @TechWithPat
      @TechWithPat  4 роки тому +1

      @@brianfortuna50 You welcome! no, I haven't planned a video for google auth but that may be something to try

    • @Activity247
      @Activity247 4 роки тому +1

      @@TechWithPat Thank you very much, go perfect in iOS but in Android I am unable to compile without errors, so it's not just the "Firebase.Auth.FirebaseAuth.Instance", do you have the file to compare it? Thanks again I have already subscribed!

    • @TechWithPat
      @TechWithPat  4 роки тому +1

      @@Activity247 I agree, I oversimplified. You can find the Android implementation in the following repository : github.com/estyval/XamarinFormsFirebaseAth/tree/add-android
      These are the versions of the nuget package used :
      Xamarin.Firebase.Auth : 71.1605.4
      Xamarin.Firebase.Core : 71.1601.4

  • @vaibhav4820
    @vaibhav4820 3 роки тому

    I am not signed in still it doesn't go to sign-In page but directly opens Homepage

    • @TechWithPat
      @TechWithPat  3 роки тому

      Check the source code in the description, it has all you need.

  • @OnlineItSkills
    @OnlineItSkills Рік тому

    Thanks for such a useful🥰 information thanks

  • @isaacibrahim9541
    @isaacibrahim9541 3 роки тому

    Thanks bro
    I've learned a lot from this video
    Keep up the good work.

  • @FatherofDragons
    @FatherofDragons 3 роки тому

    Hi there, first of all thanks for this great tutorial. Sadly I got an error and do not know any help even though I tried a lot. Probably you are able to help me:
    I got in the class Firabase Authentication in the Android Folder the following error:
    class FirebaseAuth.Firebase.Auth
    CS0433: The type 'FirebaseAuth' exist in both 'Firebase.Auth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Xamarin.Firebase.Auth, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
    I hope for your help.

    • @TechWithPat
      @TechWithPat  3 роки тому

      Hi, check your dependencies, make sure the package is referenced only once.

    • @FatherofDragons
      @FatherofDragons 3 роки тому

      @@TechWithPat Hey Pat, my dependencies look okay. Where do I find those references?

    • @TechWithPat
      @TechWithPat  3 роки тому

      @@FatherofDragonsTry to delete "bin" and "obj" folders, if it doesn't work, check in the AndroidManifest.xml file for any duplicate service.

    • @FatherofDragons
      @FatherofDragons 3 роки тому

      @@TechWithPat thanks for ur help bro so far. I did managed it that it works. I ve got one more issue to solve. When I want to sign in a new user in the FirebaseAuthentication class. I get an error with the GetIdTokenAsync method:
      Error CS1061 'FirebaseUser' does not contain a definition for 'GetIdTokenAsync' and no accessible extension method 'GetIdTokenAsync' accepting a first argument of type 'FirebaseUser' could be found (are you missing a using directive or an assembly reference?)
      Do you have any Idea?
      By the way firebase contains a lot of stuff like documentations. Could you tell me which one you use? Because there is no exactly help for Xamarin. Only for unity and stuff or is this kind of similar?

    • @TechWithPat
      @TechWithPat  3 роки тому

      There is no documentation for Xamarin, I looked at the code in the nuget package.
      If you still have troubles, clone the repo for this video, it works.
      github.com/estyval/XamarinFormsFirebaseAth/tree/add-android