Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 2 Support (Qt 5) › Anonymously connect to Firebase

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #21943

    test opty

    Hi all,

    I created a Felgo project named “admin-products” based on the Felgo tut on using the Firebase plugin. Here are the files:
    DataModel.qml 

    DetailPage.qml 

    LoginPage.qml
    Main.qml

    MasterPage.qml

    The project runs successfully on my Android Tablet and registers the new admins on Firebase, and then shows all products. I want that possibility to be provided for all users when the button “Customer” is clicked, not only for the admins when they log in.

    For that, I created a new AppButton with the text “Customer” at the bottom of the first page and a signal customerLogin. When the button is clicked that signal is emitted and in the Main.qml it’s caught onCustomerLogin: dataModel.loginCustomer() and the function is also called. In the function loginCustomer(), in DataModel.qml, auth.loginUserAnonymously() is carried out and according to Docs:
    After completion, the loggedIn() signal gets emitted. If the login was successful, authenticated and authenticatedAnonymously will both be true afterwards.”

    Now the problem is that, when that button is clicked, the page goes to the “product Items” (the list of products) but no product is shown! But When an admin logs in, the page products is shown and all the items in the database are shown! Why, please? And where to change to be able to see all products in both cases, when logging in and also when the button “Customer” is clicked?

     

    Anonymous sign-in method is also enabled in Firebase.

    #22038

    Alex
    Felgo Team

    Hi,

    since we are not familiar with your exact implementation, it sounds like you want to give authenticated users write permissions, and anyone read permission? You might want to have a look at the Firebase Database Rules: https://firebase.google.com/docs/database/security

    Cheers,
    Alex

    #22047

    test opty

    Hi,

    since we are not familiar with your exact implementation

    Why are you not familiar with my exact implementation? I’ve sent all my files code!

     

    it sounds like you want to give authenticated users write permissions, and anyone read permission?

    Yes.

    There’s only one user on the database. When we run the app on our mobile and tap on the “Customer” button, there must be “no authentication” done because we just want to “read” the data of that user. That is, we want to remove the authentication part for the customers. And when that “customer” button is not tapped but the “Login” button, then authentication part must be carried out to give us ability to both “read” and “write” data. Is it clear, please?

     

    You might want to have a look at the Firebase Database Rules: https://firebase.google.com/docs/database/security

    I didn’t see any guidance for that specific use there.

    Also, I have two side questions: Why is Felgo forum that inactive? It takes days and weeks to get an answer! And the second question is: Why is Felgo license that expensive? (80 Euros per month for a single developer!) Not all developers live in rich countries all over the world.

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

RSS feed for this thread

You must be logged in to reply to this topic.