If someone else tried to log in, a tag in Firebase called logged would be set to the other devices name (which can be made up, like random letters and numbers, as long as the own device knows it is its own).
Then when another device tries to log in, its already saved/newly created name will not be the same as this, as we can set it to check in case the extremely unlikely event that it matches, only when creating device unique ID.
Then if new device tries to log in, it sets the logged tag to its device name, so when the older device tries to log in, it does not equal the current value in Firebase. Apologies if my explaining is terrible, but I am certain it would work.
I understand all you say… and it is ok!
The real problem is how to do this
I think we need to modify functions in the firebase site… we need to do anything in thunkable app?
I have this project just to try this function: Thunkable
Thunkable have a list of tutorials? if not is a good ideia to beginners developers.
It sounds like we are overcomplicating this perhaps - if we are Using Firebase and the sign in component couldn’t you store the UserID when somebody signs in with an email to firebase and then match it when they go to sign in again, the UserID is device specific so it will know if somebody is using it on a different device - see below:
We click button 1 to register a new user. we sign them up, then they sign in then we save their email and their device id,
Then when they open the screen for login (probably best if this was a login button) we call the sign in component then use realtime database and see if device ID on login equals id stored in the database
Yes because user id is your account id, (ie. it is not specific to the device)
Change user ID to a randomly generated number, even 10 digits long, and make a saved variable on the device called myID and a cloud variable called Logged(set the cloud variable and stored variable to the device ID, which is randomly generated, it can be anything). If logged = myID then allow access. If not, continue with sign in but change to the new devices random 10 digit number.
Of course, logged is saved under the username tag (thats how I would do it).
So every name has their own logged cloud variable.
Then, add a listener for logged, under the users username tag in Firebase, then if not = to, go to loading screen. And on the loading screen perform the same check and go to sign in screen.
(edit)
Add listeners on every page, so that a user cannot have the app open then sign in again.
hi.
It looks like you know a lot of thunkable programming and some spotify implementation also.
I hope it is okay to write to you. I hope maybe you can helo me.
I need to know if it is possible in my app to open the spotifi app( that is possible i can do that allready) but i like to log in to a specific account automatically, is that possible you think. And if yes can you help me a little i am newbe in this programming-
I do not know how Spotify works. I only recommended a way to stop two people to log in at the same time. Spotify is more complex. They allow you to connect to WiFi devices and thus at other device logs in and becomes a remote. They do not deny log in, but they have a system in place to stop people listening at the same time if online.
On your point about opening specific accounts in Spotify I have no clue, sorry. And I don’t think this is possible in Thunkable or any app builder. If their app only supports on log in at a time then that is that. You are thinking of something like LastPass or Google Chrome to save passwords for different accounts to allow quick login.
I think so, but only partly. I log into my app across 3 devices with the same email and each shows a different device id on the onesignal page. they could still download the app on a different device and register with a different email.
the best way to deter someone from registering for multiple accounts may be using their phone number as part of the rregistration process and requiring a text code sent to them as part of the signup process
Firebase does also permit registration with phone numbers. Maybe reading the documentation on how to use that and sending it with the sign in/up request somehow.