locked
How to use Firebase Database in Xamarin Forms RRS feed

  • Question

  • User3177 posted

    I am thinking on using Firebase Database in Xamarin Forms.

    The idea behind Xamarin Forms is to just have 1 base code.

    But for Firebase Database there are 2 different codes, one for Android and one for iOS. Does that mean I have to code that part twice ?

    Using the REST service is not an option, because I want to use the Offline mode in Firebase.

    Wednesday, December 27, 2017 2:25 PM

Answers

  • User3177 posted

    I found an example but its not perfect but help to show how to do it.

    https://www.youtube.com/watch?v=zoeZoGgAFzA

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, December 28, 2017 3:17 AM
  • User3177 posted

    Adding more information here in case someone is interested.

    So as the video shows, some functionality as the same method signature on Android and iOS, but I found out some signatures are different, even some class names.

    For example, when using queries on Real Time Database, signature is very different. On iOS need to pass NSObject.

    For example, on Firebase Auth, in iOS the main class is "Firebase.Auth.Auth" . In Android the main class is "Firebase.Auth.FirebaseAuth"

    So that means I cant have one base code for everything. :(

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, December 30, 2017 3:00 AM

All replies

  • User3177 posted

    I found an example but its not perfect but help to show how to do it.

    https://www.youtube.com/watch?v=zoeZoGgAFzA

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, December 28, 2017 3:17 AM
  • User3177 posted

    Adding more information here in case someone is interested.

    So as the video shows, some functionality as the same method signature on Android and iOS, but I found out some signatures are different, even some class names.

    For example, when using queries on Real Time Database, signature is very different. On iOS need to pass NSObject.

    For example, on Firebase Auth, in iOS the main class is "Firebase.Auth.Auth" . In Android the main class is "Firebase.Auth.FirebaseAuth"

    So that means I cant have one base code for everything. :(

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Saturday, December 30, 2017 3:00 AM
  • User367572 posted

    I am interested to this problem if you find solution please put it here

    Friday, April 20, 2018 1:03 AM
  • User369473 posted

    I have this problem , can you explain how to add Firebase in XamarinForms, and then how to create database , how to insert and read from firebase database ?

    Thursday, October 4, 2018 1:29 PM
  • User265278 posted

    it seems that there is no information about it, there are some solutions:

    1º: Use DI 2º: Here this example: https://github.com/JoseMariaBernad/SupClub it's interesting 3º: Use flutter.

    Any other solution?

    Thursday, October 4, 2018 7:54 PM