I have just published an app. One of the features is that it saves certain data inputted by users to a realtime database in Firebase using the RealtimeDB save blocks. The feature works perfectly when using the Thunkable Live app. However, the functionality does not work when users use the published app (Apple and Google Play Store). No data is being saved.
The API key and database URL are both correct in the app settings.
Does it work correctly when downloaded to iOS and Android from Thunkable?
The Realtime DB block has an error block so you could publish an update or test it in TestFlight first and display that error value for further testing.
So for some reason, I am getting a “PERMISSION DENIED” error when trying to save to the REaltimeDB. I have the user permissions in Firebase set to “auth.uid != null” and Firebase authentication is by email/password. Any idea on how I can fix this?
I have previously explained this behavior for other members.
Basically, you are using the email ID that you use for your Thunkable and for your browser in your computer and for your Android mobile device as the same email ID used to create the Realtime DB.
This means you are not a user to Firebase but you are an owner of the database and therefore you have access to the database even if your login using the app is not successful.
This is the reason why your users are not able to access the database.
You need to look into two things:
Make sure the Sign In component is executed without errors.
Make sure the Database rules do not have time restrictions.
Thanks @muneer. Inexplicably, the database is now working perfectly. I’m checking with Firebase whether they might have a problem with their servers. Thanks for your explanation above - I went back to double-check the sign-in components were working.
For the database rules, if I have not set any time restrictions, presumably users are not logged out after a period of time?