firebase-realtime-database

Ordering Users List based on MessageList - Kotlin & Android

断了今生、忘了曾经 提交于 2020-12-15 01:38:53
问题 I am trying to sort a list of User Objects by the order in which User IDs appear in the MessageList Array. The MessageList consists of ID's of people a user is chatting with (ordered by time - using sortwith), which is then to be sent to a User Adapter as a list of Users in the same order as the message list. This is so that username, profile image and other details can be displayed... I have learnt a datasnapshot of the Users from firebase provides as is order and hence needs to be ordered

Ordering Users List based on MessageList - Kotlin & Android

梦想的初衷 提交于 2020-12-15 01:38:02
问题 I am trying to sort a list of User Objects by the order in which User IDs appear in the MessageList Array. The MessageList consists of ID's of people a user is chatting with (ordered by time - using sortwith), which is then to be sent to a User Adapter as a list of Users in the same order as the message list. This is so that username, profile image and other details can be displayed... I have learnt a datasnapshot of the Users from firebase provides as is order and hence needs to be ordered

Type mismatch: inferred type is String? but String was expected

北慕城南 提交于 2020-12-14 13:13:51
问题 Due to this line in my codes : var myRef = child_myRef.child(FirebaseAuth.getInstance().uid) 回答1: The reason because your FirebaseAuth.getInstance().uid is String? (can be Null), but input of .child() need a String (none Null), so please check null before that: FirebaseAuth.getInstance().uid?.let{ var myRef = child_myRef.child(it) ..... } Or if you make sure FirebaseAuth.getInstance().uid never Null, you can using FirebaseAuth.getInstance().uid!! , but It not is a good approach 回答2: You can

Firebase getDisplayName() returns empty

≯℡__Kan透↙ 提交于 2020-12-13 11:38:06
问题 I have the following code that should return the user data logged in by Firebase, it returns the user with no problem, ID and Email, but the value of the name returns empty or null. As if the user had been registered without a name, but in the register the name of the user appears. Does anyone know why? I already searched it and it looks like it has some bug with the Firebase getDisplayName. Does anyone have a solution? public static FirebaseUser getUsuarioAtual() { FirebaseAuth usuario =

Sort chat-list by the most recent message with firebase

拥有回忆 提交于 2020-12-10 08:35:03
问题 I don't know why I got stuck in a problem that the chatList is not sorting by the last message time or by the most recent message. I have tried storing timestamp in the database and orderChildBy timestamp but it still not working. not working means the list get not sort after every message and keep showing the list as the sorted after first message. Look at the image how chats are disordered! This is the way I created chatList in the firebaseDatabase in ChatActiviy on sendMessage: val timeAgo

Sort chat-list by the most recent message with firebase

放肆的年华 提交于 2020-12-10 08:34:05
问题 I don't know why I got stuck in a problem that the chatList is not sorting by the last message time or by the most recent message. I have tried storing timestamp in the database and orderChildBy timestamp but it still not working. not working means the list get not sort after every message and keep showing the list as the sorted after first message. Look at the image how chats are disordered! This is the way I created chatList in the firebaseDatabase in ChatActiviy on sendMessage: val timeAgo

Firebase Android - Crash with “Found a conflicting setters with name: setGregorianChange” when .setValue()

試著忘記壹切 提交于 2020-12-09 06:32:59
问题 I'm playing with FirebaseDatabase and I can't resolve a very annoying crash. Everytime I try to execute: FirebaseDatabase.getInstance().getReference().child("...").push().setValue(...) The app crash and I have this message : com.google.firebase.database.DatabaseException: Found a conflicting setters with name: setGregorianChange (conflicts with setGregorianChange defined on java.util.GregorianCalendar) at com.google.android.gms.internal.zzbqi$zza.<init>(Unknown Source) at com.google.android

Firebase Android - Crash with “Found a conflicting setters with name: setGregorianChange” when .setValue()

痴心易碎 提交于 2020-12-09 06:30:08
问题 I'm playing with FirebaseDatabase and I can't resolve a very annoying crash. Everytime I try to execute: FirebaseDatabase.getInstance().getReference().child("...").push().setValue(...) The app crash and I have this message : com.google.firebase.database.DatabaseException: Found a conflicting setters with name: setGregorianChange (conflicts with setGregorianChange defined on java.util.GregorianCalendar) at com.google.android.gms.internal.zzbqi$zza.<init>(Unknown Source) at com.google.android

Firebase database doesnt work after publishing app to play store

心不动则不痛 提交于 2020-12-07 15:55:31
问题 I have a problem. I've coded app in android studio. After publishing app to play store, firebase database doesn't work at all. I added SHA1 key to firebase console project settings, what can be wrong? Any help appreciated. I took SHA1 key from here: 回答1: there different SHA1 keys for debug and release version you are most likely using debug SHA1 key generate relase SHA1 key using below code and add it to console firebase will work keytool -list -v -keystore ~/.android/debug.keystore -alias

Firebase database doesnt work after publishing app to play store

夙愿已清 提交于 2020-12-07 15:52:25
问题 I have a problem. I've coded app in android studio. After publishing app to play store, firebase database doesn't work at all. I added SHA1 key to firebase console project settings, what can be wrong? Any help appreciated. I took SHA1 key from here: 回答1: there different SHA1 keys for debug and release version you are most likely using debug SHA1 key generate relase SHA1 key using below code and add it to console firebase will work keytool -list -v -keystore ~/.android/debug.keystore -alias