firebase-realtime-database

Firebase observe with type .childAdded retrieves all my information every time. Please assist

人盡茶涼 提交于 2019-12-29 05:37:25
问题 According to Firebase docs: ChildAdded is triggered once for each existing child and then again every time a new child is added to the specified path So, I have an app, that has a little banner at the top that pops up every time a user gets a new message. As you could have guessed, these messages are stored in a child in the user object in Firebase. So, here's the problem, when I load the app, it pops up for EVERY message the user has. Is it possible to have this observe event ONLY be called

Firebase UI RecyclerView onClick

不问归期 提交于 2019-12-29 04:54:48
问题 I am using Firebase UI FirebaseRecyclerAdapter to populate a RecyclerView. I managed to get click events from components of my item view (the title), but not for anywhere in the item view, which is what I need. I followed google sample. In my Activity: private void setRecyclerView() { recyclerView = (RecyclerView) findViewById(R.id.recycler_view_gigs); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(this)); mAdapter = new FirebaseRecyclerAdapter<Gig,

Firebase retrieve data Null outside method

大城市里の小女人 提交于 2019-12-29 02:12:33
问题 I put the below method inside an onCreate() , when the app launch it will trigger this method. But when I try to to get mName outside the ValueEventListener() , it return null and the app crashed. Anyone know why this issue happen? ValueEventListener postListener = new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { UserDetails info = dataSnapshot.getValue(UserDetails.class); Log.d(TAG, String.valueOf(dataSnapshot)); mName = info.getName(); **Log.d(TAG,

Firebase retrieve data Null outside method

时间秒杀一切 提交于 2019-12-29 02:11:42
问题 I put the below method inside an onCreate() , when the app launch it will trigger this method. But when I try to to get mName outside the ValueEventListener() , it return null and the app crashed. Anyone know why this issue happen? ValueEventListener postListener = new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { UserDetails info = dataSnapshot.getValue(UserDetails.class); Log.d(TAG, String.valueOf(dataSnapshot)); mName = info.getName(); **Log.d(TAG,

Android - Firebase - Send Users to Chat Room

穿精又带淫゛_ 提交于 2019-12-29 02:08:18
问题 Aim Allowing the Users to access their selected Group Chat. Once the user clicks on the Group Chat name, they will be entered into that Group Chat. Database Tree As shown in the Database Tree, the Currently Signed In user will be shown a list of Group Chat names that have been created. I have an Admin Account to create these Group Chats for the users. The Android, Asia, and Europe group chats that are seen within the Database ARE NOT fixed variables. They are names. A newly Group Chat name

Android Firebase onDataChange is not called?

↘锁芯ラ 提交于 2019-12-29 01:45:08
问题 I have more than 40,000 nodes in my Firebase Database. But whenever I am trying to read a key from my Android code, the onDataChange method is not getting called. MyCode: Firebase firebase = new Firebase(my url); firebase.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { Log.d(TAG, "onDataChange : " + dataSnapshot); if (dataSnapshot.getValue() != null) { Map map = (Map) dataSnapshot.getValue(); Iterator accountIterator = map

In the new Firebase console I can't edit the name of nor move nor clone any node of a realtime database

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-28 16:54:29
问题 In the new Firebase console I can't edit the name of nor clone nor move any node (change parent) of a realtime database I have even tested setting Rules to Public. Is this by design ? What then, is the use of this console ? ONLY to change child values ? 回答1: There is indeed no way to clone a node or rename a key in the Firebase Database console. Since the Firebase Database API doesn't have a clone/rename operation, we also don't have an equivalent in the UI. Note that this operation also wasn

How to add additional information to firebase.auth()

戏子无情 提交于 2019-12-28 15:50:08
问题 How can I add extra attributes phone number and address to this data set? It seems like Firebase documentation doesn't specify anything about that. I have implemented the login, register and update using firebase.auth() Login : //Email Login firebase.auth().signInWithEmailAndPassword(email, password).then( ok => { console.log("Logged in User",ok.user); }, error => { console.log("email/pass sign in error", error); } ); Register: //Sign Up firebase.auth().createUserWithEmailAndPassword(email,

How to delete a child from Firebase (Swift)

别等时光非礼了梦想. 提交于 2019-12-28 12:13:38
问题 I've been following a tutorial on making an instragram-esque app, and I'm having a lot of trouble figuring out how to delete a post, both from Firebase and from the feed. The image that the user selects or takes is uploaded to Firebase database with this function: func uploadToFirebase() { AppDelegate.instance().showActivityIndicator() let uid = FIRAuth.auth()!.currentUser!.uid let ref = FIRDatabase.database().reference() let storage = FIRStorage.storage().reference(forURL: "gs:/

Is there a way to store Key in class which I cast from Firebase object?

喜夏-厌秋 提交于 2019-12-28 07:07:30
问题 This is my database : [x] database -- > [+] students -----> [+] -KuGacomJymBwkcc7zlU (pushKey) -----------> Name - Jon -----------> Age - 21 I have Student.class : String name; String age; public Student(String Name, String Age) { this.name=Name; this.age=Age; } I read the information from firebase datasnapshot like this: Student newStudent = DataSnapshot.getValue(Student.class); When I do this I get the name and the age, but my question if there is a way to store the ID (pushKey) on the