Is it possible to implement user search function using firebase auth? - android

I wonder how to do user management using Firebase. I have completed the implementation of the authentication process using firebase auth, but is it developed in a way that additionally stores user information in Firestore to perform a user search function? I wonder if general users can use the user search function using the Firebase auth SDK.
Also, I'm curious about how the user operation on the client-side using Firebase is currently performed.

You can only register or verify the user using auth service and if you want to search user you have to store user data in real-time or firestore.

When Firebase auth is processed, user information is also recorded in Firestore. I was wondering if this method is correct.
Yes, that's correct. That's actually a common approach when it comes to storing user data. Once the user is authenticated grab the corresponding data and store it in the database. You can either use Firestore or the Realtime Database.
I was wondering if it is possible to get user information from the auth function and manage users more efficiently.
I'm not aware of a more efficient way of doing that.

Related

Optionally using Cloud Firestore in an app

I have an app that uses SQLite to store the users' data (stats and such). The app doesn't require users to sign up or log in. I would like to add the capability for cloud syncing of data to the app, so Cloud Firestore sounds like a great fit. However I don't want to force users to sign up or log in if they don't want to use cloud syncing features.
Is there some clever way to use Firestore locally without having to log in users? That way I could convert the SQLite data to non-relational format once and have one place where the data is stored. Otherwise I'd have to maintain and update two databases - one for users who don't want to sign up/log in, and another for those that do.
Cloud Firestore doesn't require users to sign in. You can easily use Firestore without having the users sign in. I do this all the time, since data in my apps is often simply shared between all users without any sense of ownership.
However: finding a user's data in a cloud-hosted database requires that you're able to identify the user. If you already have a way to identify them, then you can continue to use that identification with Firestore.
If you don't currently have a way to identify users, I recommend looking at Firebase's anonymous authentication. This is a completely transparent, non-interactive way to add a user identification token.

Best approach how to convert user from non authed to to authed when using Firebase Realtime Database

I'm working on the application using Firebase Realtime database. App is live but I see problem with users that they don't want to login (so I'm losing a lot of users because one of first screens is login screen).
I'm thinking to update my app to be able to work without login and when user decides to authenticate then I would send his/her data into cloud and continue working as usually.
What is (on your opinion) best approach? Should I create JSON nodes something like sessions_unauthed with random uuis for not logged users and sessions for logged users. And move data from one subtree to another when user login?
what you can do is that you can use anonymous login function of firebase and storing that uid to sharedpreferences and then moving those nodes to the newly logged in user's uid nodes.
Hope this helps

Multiple users updating data to firebase at a time

I have build an anroid app which uses firebase where in i send my data. I have a form in my app. the data from the form is sent to firebase. If two users are entering the data simultanously, and one of the users update the data first, the filled data in the other user's form is cleared. I need a solution to this issue. How can i avoid data being cleared from other users forms?
You need to implement transaction operations. Linked documentation here.
If you need per-user storage in the database, it doesn't make sense to store everyone's data in the same location in the database. Instead, use Firebase Authentication to get your users logged in with a unique user id, and use that user id to store user data in a dedicated location in the database.

Advantages of Firebase authentication?

i'm creating an android app, which requires some authentication system. I want to have 3 options to log in users: mail&password, facebook login and anonymous access (in case of anonymous i'll create some kind of anonymous account, so user'll be able to give his credentials later and secure his account with 'normal' password).
I'll also have my own webservice for this app. Webservice is in fact the most crucial part and android app will just show data from WS and put some new data on it.
I'll be using Firebase for handling notifications.
My question is: should i use Firebase authentication in this scenario or maybe it's better to stay with own authentication system? If i use Firebase i still need to have users in my database (webservice requires some info about users).
Is firebase authentication good choice for project like that?
Even in the case of Firebase where we use firebase authentication and the firebase database together, only a few details of user(user id, login email or number, provider details etc) are available under the Authentication tab. The rest of the details we receive after login and other custom user information we collect from the app have to be saved in the Firebase database.
So even if you have another Web service instead of using Firebase Database, you can use Firebase Authentication. There are definitely great advantages if you use Firebase Authentication.
Save time on developing Webservice methods for authentication :
Instead, you can just have a method to store user information after the user authenticates with Firebase. Also, there is considerable time saved since you can avoid developing server-side methods for different kinds of token verification in case you want to add social logins like Facebook and Google.
All that will be handled efficiently with Firebase.
Detailed Analytics: Also with Firebase authentication, you can also get good analytics and demographic information of users.
You don't have to use Firebase authentication in order to use FireBase Push Notifications, Invites, etc.
That's one of the beauties of Firebase; you can choose which service to use.
Since everything is built already, I would continue to use your own Auth system
You can save all users, and you can authenticate with Google, Facebook, only email.
It's like a database online and it's easy to connect with the same at Android Studio and after you can login with the users.

How to store Parse[dot]com application data

I am using Parse.com with android backed app and wanted to store some of data specific to application not user's data.
So, is there anyway I can accomplish this without login in any user & store data which belong to app not user.
Sure.. You can create and query objects on Parse regardless of whether you're logged in or not. You can also call cloud functions.
I would recommend using a Cloud Function, locking down the security of the classes you're using to store the data, and using the Master Key in the cloud function to access/write to the data securely.

Categories

Resources