I am working on an Android App where I want a Firebase database like
Basically, I want to verify email before creating a user on the app. Whenever a user registers in my app, First it will be checked whether the email address is available in the users database reference. if available, then only he is allowed to register. But I found that Firebase doesn't allow an email as a child. So How can I do it? Any other suggestion for achieving this in Firebase Database.
getInstance(FirebaseApp app, String url) Gets a FirebaseDatabase instance for the specified URL, using the specified FirebaseApp. DatabaseReference. getReference() Gets a DatabaseReference for the database root node.
A simultaneous connection is equivalent to one mobile device, browser tab, or server app connected to the database. This isn't the same as the total number of users of your app, because your users don't all connect at once.
Edit and update your rulesOpen the Firebase console and select your project. Then, select Realtime Database, Cloud Firestore or Storage from the product navigation, then click Rules to navigate to the Rules editor. Edit your rules directly in the editor.
Because Firebase does not allow symbols as .
in the key, I suggest you encode the email address like this:
[email protected] -> name@email,com
As you probably see, instead of .
I have used ,
. To achieve this, you can use the following methods:
static String encodeUserEmail(String userEmail) {
return userEmail.replace(".", ",");
}
static String decodeUserEmail(String userEmail) {
return userEmail.replace(",", ".");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With