firebase-realtime-database

How to clear data from ViewModel ?MVVM [closed]

天涯浪子 提交于 2020-08-10 23:01:11
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 days ago . Improve this question Is there any way to clear/delete all data stored using MVVM pattern? My app looks like Login Activity -> Main Activity -> fragments(each fragment: Firebase singleton +repository singleton+view model + view) All the data is stored as livedata and when I

How to clear data from ViewModel ?MVVM [closed]

青春壹個敷衍的年華 提交于 2020-08-10 22:55:57
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 days ago . Improve this question Is there any way to clear/delete all data stored using MVVM pattern? My app looks like Login Activity -> Main Activity -> fragments(each fragment: Firebase singleton +repository singleton+view model + view) All the data is stored as livedata and when I

How to clear data from ViewModel ?MVVM [closed]

让人想犯罪 __ 提交于 2020-08-10 22:54:07
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 days ago . Improve this question Is there any way to clear/delete all data stored using MVVM pattern? My app looks like Login Activity -> Main Activity -> fragments(each fragment: Firebase singleton +repository singleton+view model + view) All the data is stored as livedata and when I

Send Form to users using Firebase Realtime-Database

▼魔方 西西 提交于 2020-08-10 19:16:17
问题 I am almost done fixing a huge problem I have been having the last few weeks. Long story short I'm trying to be able to send array data to my Firebase Database. I will show what the send button is currently sending when I press send: I would like the zero to be every user's id (one node for each row). The number of users and who they are is determined by a table and the child values to be the values in the array. Here is the code for the function that sends to firebase: @IBAction func

How to get specific child data from firebase

我的未来我决定 提交于 2020-08-10 19:13:31
问题 I have need to access a specific child from node, i have only "available key" of the specific child not complete path. 回答1: Since you know the key of the child you're looking for, you can query on that: DatabaseReference schoolsRef = FirebaseDatabase.getInstance().getReference().child("School"); Query query = schoolsRef.orderByKey().equalTo("MZ3bW5kLJAQorgnZbYiTaOoWWSG2"); db.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot

Retrieving data from nested nodes in Firebase Database

好久不见. 提交于 2020-08-10 19:06:07
问题 This is my database structure: All the children of the Request node are timestamps. For a particular timestamp, within the product node, i want to retrieve all the values of the object productName. And then arrange them so that it is composed as the body of an email. The part where i am stuck at is in fetching the data of productName. So far i've been able to fetch the data of the total in the second node. the code i'm using is this: DatabaseReference ref = FirebaseDatabase.getInstance()

delete tableView cell, and remove data from firebase

只愿长相守 提交于 2020-08-09 21:42:08
问题 I'm new to swift and firebase. Done some research here, could not find solution that would solve my problem, lack of experience. Got a problem when trying to delete tableView Cell from firebase "Value of type 'Group' has no member 'ref'" func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { let ref = groupsArray[indexPath.row].ref ref!.removeValue() groupsArray.remove(at: indexPath.row)

delete tableView cell, and remove data from firebase

▼魔方 西西 提交于 2020-08-09 21:41:21
问题 I'm new to swift and firebase. Done some research here, could not find solution that would solve my problem, lack of experience. Got a problem when trying to delete tableView Cell from firebase "Value of type 'Group' has no member 'ref'" func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { let ref = groupsArray[indexPath.row].ref ref!.removeValue() groupsArray.remove(at: indexPath.row)

delete tableView cell, and remove data from firebase

大城市里の小女人 提交于 2020-08-09 21:39:40
问题 I'm new to swift and firebase. Done some research here, could not find solution that would solve my problem, lack of experience. Got a problem when trying to delete tableView Cell from firebase "Value of type 'Group' has no member 'ref'" func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { if editingStyle == .delete { let ref = groupsArray[indexPath.row].ref ref!.removeValue() groupsArray.remove(at: indexPath.row)

How to impersonate the database authentication from Firebase Cloud Function with admin privileges?

假装没事ソ 提交于 2020-08-08 04:31:25
问题 I have a set of Firebase Functions that works as an API for an application. These Firebase Functions connect to the database with admin privileges as this: const serviceAccount = require(`./config/xxx-firebase-adminsdk.json`); admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: DATABASE_URL, }); I was able to create a custom token and I'm receiving/decoding it in the server but I cannot make use of the security rules because the Firebase function is