Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo Plugins Support › Firebase Realtime Database/Cloud Firestore

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19541
    #19546

    Günther
    Felgo Team

    Hi Edward,

    with Firebase Authentication, your users can register with and are created in Firebase. Which data you then store in your database is completely up to you. The Firebase User Accounts really only covers authentication – not your user data.

    After authentication, you can simply store your profile data in the realtime database. The FirebaseDatabase::getUserValue and setUserValue functions allow to store user-specific data. The data in the database is matched with the user account via the user id of the user in Firebase. See the Felgo docs for a short example: https://felgo.com/doc/test/plugin-firebase/#firebase-authorization-and-private-database-example

    To protect certain paths in your database, it is possible to define access rules: https://firebase.google.com/docs/database/security/

    A default Rule set that protects user specific data could look like this (taken from the Firebase docs):

    {
      "rules": {
        "users": {
          "$uid": {
            ".write": "$uid === auth.uid"
          }
        }
      }
    }

    This ruleset specifies that any data within users/<$uid> is only write-able for the logged-in user (where $uid matches auth.uid, the id of the authenticated user).

    The same principles also apply for the cloud storage, which you can use as described here: https://felgo.com/doc/test/plugin-firebase/#firebase-storage-cloud

     

    Best,
    Günther

    #19557

    Edward

    Hi Gunther,

    Thanks for this, could I tie my setUserValue in with my registration form button (code below),

    I have already adjusted the login form to include firstname, surname and other details when the register button is checked, but how would I make it store these information also?

    I have tried adding  FirebaseDatabase.setUserValue(“firstName”, firstname.text) into the onclicked area but this doesn’t seem to be working,

     

    Thanks

    Edward

                AppButton {
                    id: loginbutton
                    text: registerCheckbox.checked ? "Register" : "Login"
                    flat: false
                    anchors.horizontalCenter: parent.horizontalCenter
                    onClicked: {
                        loginPage.forceActiveFocus()
                        loginbutton.visible = false
                        registerCheckbox.visible = false
                        indicator.visible = true;
                        indicator.startAnimating()
                        if(registerCheckbox.checked) {
                            // Register firebase user
                            firebaseAuth.registerUser(txtUsername.text, txtPassword.text)
                        } else {
                            firebaseAuth.loginUser(txtUsername.text, txtPassword.text)
                        }
                    }
                }

     

    #19560

    Günther
    Felgo Team

    Hi Edward,

    you can view the PluginDemo for usage and integration examples of Firebase. To get help with use-case specific coding questions, or if you require support for integration of certain features, we offer support packages for purchase. Felgo devs will then have a look at your code personally or e.g. create a prototype. You can also use the included support of Felgo Indie or Enterprise this way.

    Just let us know if this would be interesting for you.

    Best,
    Günther

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded