firebase-realtime-database

How to sum older data with new one in firebase

会有一股神秘感。 提交于 2021-02-10 14:50:44
问题 I have table named poin and kegiatan, when I input score to kegiatan, its input to poin too, the problem is when I input score to poin and sum it with older data in poin, its will looping over and over. what should I do? Btw, this is how my database and code for input score to poin look like. kegiatan + user id - poin = score poin +stringDate -userId = score reference = FirebaseDatabase.getInstance().getReference(); reference.child("poin").child(stringdate).child(nama).addValueEventListener

How to sum older data with new one in firebase

守給你的承諾、 提交于 2021-02-10 14:49:18
问题 I have table named poin and kegiatan, when I input score to kegiatan, its input to poin too, the problem is when I input score to poin and sum it with older data in poin, its will looping over and over. what should I do? Btw, this is how my database and code for input score to poin look like. kegiatan + user id - poin = score poin +stringDate -userId = score reference = FirebaseDatabase.getInstance().getReference(); reference.child("poin").child(stringdate).child(nama).addValueEventListener

startListening in Firebase UI

折月煮酒 提交于 2021-02-10 14:27:44
问题 My app crashes when I sign in. The issue stems from the load function. when it initiates the adapter.startListening(); I am not sure if it is from versions conflict or otherwise. please help My logcat: FATAL EXCEPTION: main Process: abcd.com.eatme, PID: 10687 java.lang.RuntimeException: Unable to start activity ComponentInfo {abcd.com.eatme/abcd.com.eatme.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.firebase.ui.database.FirebaseRecyclerAdapter

startListening in Firebase UI

半世苍凉 提交于 2021-02-10 14:27:01
问题 My app crashes when I sign in. The issue stems from the load function. when it initiates the adapter.startListening(); I am not sure if it is from versions conflict or otherwise. please help My logcat: FATAL EXCEPTION: main Process: abcd.com.eatme, PID: 10687 java.lang.RuntimeException: Unable to start activity ComponentInfo {abcd.com.eatme/abcd.com.eatme.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.firebase.ui.database.FirebaseRecyclerAdapter

Firebase update on disconnect

倖福魔咒の 提交于 2021-02-10 07:33:43
问题 I have a node on firebase that lists all the players in the game. This list will update as and when new players join. And when the current user ( me ) disconnects, I would like to remove myself from the list. As the list will change over time, at the moment I disconnect, I would like to update this list and update firebase. This is the way I am thinking of doing it, but it doesn't work as .update doesnt accept a function. Only the object. But if I create the object beforehand, when

Firebase update on disconnect

两盒软妹~` 提交于 2021-02-10 07:32:15
问题 I have a node on firebase that lists all the players in the game. This list will update as and when new players join. And when the current user ( me ) disconnects, I would like to remove myself from the list. As the list will change over time, at the moment I disconnect, I would like to update this list and update firebase. This is the way I am thinking of doing it, but it doesn't work as .update doesnt accept a function. Only the object. But if I create the object beforehand, when

Getting nil in parsing Firebase values swift using Codable and CodableFirebase

孤者浪人 提交于 2021-02-10 06:56:33
问题 I am using Firebase Realtime Database, using codable approach in swift and external library CodableFirebase. I have created model structure but when I am trying to parse values (as i am getting all values) with model structure it gives me nil. My database has keys which might I am not properly handling in nested values. Please help. Thanks database structure snapshot attached. Code: Database.database().reference().child("users").observeSingleEvent(of: .value, with: { (snapshot) in guard let

How to send one parent with multi child to firebase over Google app script?

北城余情 提交于 2021-02-10 06:12:34
问题 i have G-AppScript code where should make item batches as child of the parent "Article code" like photo below: google sheets data table: the target result i tried to write the link below: G-AppScript function writeDataToFirebase() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var data = sheet.getDataRange().getValues(); var dataToImport = {}; for(var i = 1; i < data.length; i++) { var ItemCode = data[i][0]; var Batch = data[i][3]; dataToImport[ ItemCode ] =

How to send one parent with multi child to firebase over Google app script?

混江龙づ霸主 提交于 2021-02-10 06:08:50
问题 i have G-AppScript code where should make item batches as child of the parent "Article code" like photo below: google sheets data table: the target result i tried to write the link below: G-AppScript function writeDataToFirebase() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var data = sheet.getDataRange().getValues(); var dataToImport = {}; for(var i = 1; i < data.length; i++) { var ItemCode = data[i][0]; var Batch = data[i][3]; dataToImport[ ItemCode ] =

Firebase onCreate add custom claims to the auth.user

人盡茶涼 提交于 2021-02-10 06:07:01
问题 I am trying to add a custom claims, isRegistered to firebase. My firestore has another user collection to keep register info records. Now I am trying to keep a isRegistered custom claim but I can not seem to get it work. exports.addRegisteredRole = functions.database.ref('/user') .onCreate((snap, context) => { return // **I added this later, but the issue still remains.** admin.auth() .setCustomUserClaims(context.auth.uid, {isRegistered: true}) .then(() => { console.log('done', snap) return {