How can i get all user data when he reinstall app

i made a login screen otp connected to firebase authentication.


after that user wants to enter username,

like this,
so,i have to do that the when user reinstall app and after login his old username that he used to enter first time should automaticallly aded to his account.
please help

I don’t think this is possible, because you can’t get the Device ID and storing such information online is a bad idea in terms of Data Security/Privacy.

But you could save the IP on login with the username online and get it when the App is reinstalled. Make sure to encrypting the IP.

Short Google Search:

May be possible with firebase…

use firebase. once user logged in, save his name as tag and user name as value. so next time or every time user try to login, first check whether the number is the database or not. if not allow the app to send OTP, if not automatically call the tag value and display… simple…

I use firebase login authentication. and then save all user data in the database. every time the same user logs in, I pull the data back.

You can use tinydb (for local) and file (for backup).

Tinydb to get data if app is installed. But if the user clear data or uninstall application, we have backup data on the files stored in the storage, as long as the files are in the storage, we can get back data again.

I didn’t understand what data you want to recover exactly.
What you want to save is the username?
If yes, just link the phone number to the username. If user type number +5521999874569 you just have to check in your online database what is the username related to that cellphone number.

This is not exactly the same that you said that you want, but solve the problem.

ok i am going to try it now if it works i will mark this as a solution

Tag : user number
Value : user name.

When he try to get OTP
Set web URL = https://(project I’d).firebaseio.com/mobile number text box text

Also add .get

If the web got text as null mean, he is new user so set firebase authenticate to request for OTP

If the response is some value then user is exist and the value is the use name. It means he has reinstalled the app it means…

(Note: Call firebase value using web component method, you will get succeed.)

1 Like

Authenticates a user by Firebase Auth. then saves all data to RealTimeDataBAse. in a “TAG” > USER DATA.

So every time the user connects you make a request with these GET block
blocks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.