How to check if user is signed in? (Firebase Auth)

This is my first time using Thunkable. I’ve successfully created a Sign Up where I can see that new users are being added to the Firebase Authentication. However, how should I go about checking if the current user is logged in throughout the screens of the app? For example, if I want certain screens to only be available to signed in users. Also, how do I retrieve user information such as ID and email, so that I can associate user inputs in the Realtime DB with the appropriate user? Thank you!

To do this, you need to make an additional field in the database and, when entering the database, write the user status to the global variable. If it is a subscriber, then true. Before opening each protected screen (or before going to the screen), you check the value of this variable. If true, then you give the opportunity to see the information to the subscriber (or go to this screen).

Thank you for replying! However, how would I know if the user logs out, by uninstalling the app, for example, so that I know to update the user status in the DB?

What do you need to know if the user deleted the application? Are you afraid that there will be many empty subscriptions in the database - the user has deleted the application, and its status in the database exists?

If the subscription is free, then it can operate until the subscriber unsubscribes from it. From time to time you can do a mailing to the mailing addresses of subscribers with announcements, and at the end of the letter give a link to unsubscribe. If the user clicks it, you will see that the subscription has been canceled.

If the subscription is paid, then it is valid for some time, after which a notification is sent to the user that the subscription ends. If there is no response from the user, then when the subscription expires, it is automatically deleted.

How do I write a code(blocks) where my app will auto check the paid subscription from database and then give access to full functionality?

Also paid subscription will end automatically after a month

You are writing unrelated content in a post 3 years old. What benefits are you seeking?

These questions have no connection with this post.

1 Like

K. I will post as a new query