I am working on the signup page and am using one of Thunkable’s templates as guidance. However, I cannot find the Local storage toggle option. As you can see, if I click on the toggle, I can only choose between “Sign up”, “Sign_In1”, “Realtime_DB1” but not “Local_Storage1”.
Could you please let me know what I need to do?
The template you’re referring to is using [Local Storage] database option just to save the login details in the phone to use it to fill in the details automatically in subsequent logins.
Local storage and localDB is not anymore available and have been superseded by Local Data Source.
However, you do not need to bother about storing the login details for later retrieval. At this point it is worth to focus on the main task of having the login in/sign up process working.
@muneer , thanks. Given that you said I cannot use the email address as a key, how can I identify the user throughout the signup process?
To elaborate: If the user selects an interest, e.g. “Partying”, I want it to be stored in “universities/mailsac/user/the particular user who is going through the signup process(not sure what I need to put in here)/interests”.
You can see the database structure attached. A new user entry should be created with a name, email address and interests. Then, when the user selects the interest “Partying”, it should create an entry in the list "interests.
How can I do that? What variable can I use for the user throughout the signup?
The sign in component will create a unique ID to every user who successfully signs in. Use this unique ID as the user in your database structure.
This ID will always be unique and you can always rely on Firebase to maintain it for you.
Thanks, where can I find this unique ID? I cannot find this block.
@muneer Right, I added the userid but no entry in the RT database is made. Why is that and how can I add different values to the userid? Every userid must have a name, email and a list of interests.
I think you should try it
The userID is available in the [sign in] block not in the [sign up] block
but I need the userid for the signup process. When a user types in the name, email and password, it needs to create an id. This id would be used on the next screen to allocate a particular interest to that user. So, how would that block look like then?
The [sign up] process is to verify the user with the email authentication. This could take some time.
If the email is verified successfully then you can pass the email address and password entered by the user to the [sign in] block and obtain the userID.
Another way is to ask the user to sign in to the system after successful authentication of the email.
Use whichever way you see it appropriate to your app but remember you will only need the [sign up] once and then you will use the [sign in] every time the user needs to use the system.
Right, but how would I do it if I want the email verification to happen after the user selected their interests? That would mean that I would not have any userID, right? How would I then be able to successfully allocate the selected interests to that particular user?
I’m not sure I understood you correctly. You only require a userID when you want to save it to the database. Anything before this stage the app is running just like any general app without any user identification.
Are you allowing the user to use your app without login?
If yes, then you will not need the userID until the time you decide to save the information to the database.
If, in the other hand, if your user has to be identified to continue using the app then the user will go through a login process which will produce a userID.
You can find the process below.
- Signin > User ID will be used as key to identify user throughout the next stages
- Interest selection > User selects “Partying”. It should be stored under "universities/mailsac/users/User ID/interests.
The problem is that it does not identify the User ID. It says: "There is no User record corresponding to this identifier.
The delimiter should be “/”
Thanks, but now it still does not add the partying activity to the user, Simon Eisi who was going through the signup process. As you can see, the UserId becomes a separate user. It does not identify the userId.
It did exactly what you told it to do in the sign up button click event.
Your code works correctly but you are not supplying the correct userID because you are processing the code in the [sign up] block which does not contain the internal userID from the database.
You keep asking the same question but in many different ways.