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
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.