firebase-realtime-database

How to set this.props.key into the Firebase database reference in react native

谁都会走 提交于 2019-12-24 08:37:46
问题 I have retrieved the values from the other component and displayed in the TextInput for users to edit the values which are the (itemTitle: this.props.title, itemIng: this.props.ing, itemSteps: this.props.steps) and now I'm trying to update the values back to firebase after user pressed the button in modal. But I'm having a problem to get the firebase database reference, I'm able get the {this.props._key} from another component but when I write as a .child(itemKey) it's not working and shows

React + Firebase undefined using click event

。_饼干妹妹 提交于 2019-12-24 08:36:34
问题 Hopefully this is a quick fix. Basically, I have set onClick listeners on a few elements of a child component, and when they are clicked, it runs a function from the main component. Everything works good, up until we hit a specific line in the call to the firebase database, where I get issues of undefined. I have included comments to the code below so you know exactly what's going on. getDataName(event) { var title; var that = this; // Grabs data name attribute from element clicked var

firebase connection check online offline status in android

随声附和 提交于 2019-12-24 08:35:26
问题 If user turn off both wi-fi, 3g, 4g, and so on and reverse (no internet connection). Firebase database name child connections:(true/false) So, when internet connections, wi-fi, 3g, 4g, and so on are off or missing, the user is offline so he can't be found. Remember the two scenarios: Before and After. If user is offline before an other user search him, then he will not displayed in the list result, if user is off-line after an other user search him, then it will display NO MORE AVAILABLE icon

How to make For loop wait for Firebase Database response?

冷暖自知 提交于 2019-12-24 08:29:31
问题 I have a function that receives an object array. The array looks like this: var receivedObjects = [{nuih329hs: 100}, {8suwhd73h: 500}, {2dsd73ud: 50}, {9u238ds: 200}]; Each key is an ID, and each value is a number. The objects are in a set order and what I want to do is iterate through the objects and define each value as a variable, which I'll then use when creating a html row. The problem I'm having is, I have to make a call to a Firebase database inside this iteration code, the result is

How secure is offline data stored on clients by Firebases Realtime Database? [duplicate]

孤街浪徒 提交于 2019-12-24 08:24:07
问题 This question already has answers here : Firebase Database Persistence Storage [closed] (2 answers) Closed 2 years ago . The documentation on Offline Capabilites of the Firebase Realtime Database explains how Firebase provides tools for persisting data locally on the client: By enabling persistence, any data that the Firebase Realtime Database client would sync while online persists to disk and is available offline, even when the user or operating system restarts the app. This means your app

Does Firebase handle threading on Java Server SDK with App Engine?

北战南征 提交于 2019-12-24 08:23:21
问题 I have a setup like this: Client <----> Realtime Database <----> AppEngine Server The AppEngine server has some code inside the servlet init() method. @Override public void init(ServletConfig sc) throws ServletException { // Setup Firebase.... firebase.addChildEventListener(..nested SingleValueEventListener..); } Whenever the client updates a node in firebase, the AppEngine will listen for this change, and do some processing and update some other nodes. This setup works for testing, as I am a

How to prevent duplicated uname of Users Firebase [duplicate]

狂风中的少年 提交于 2019-12-24 08:15:54
问题 This question already has answers here : How do you prevent duplicate user properties in Firebase? (2 answers) Closed 2 years ago . I am adding username for my Chat App to Firebase Database successfully. I implemented in activity: FirebaseDatabase firedb = FirebaseDatabase.getInstance(); in createUser Method. private void createUser(String uname){ Map<String,Object> newUser = new HashMap<String, Object>(); newUser.put("uname",uname); DatabaseReference dbref = firedb.getReference(); dbref

Get a database reference in the new Firebase 4.0 release

£可爱£侵袭症+ 提交于 2019-12-24 08:06:19
问题 In Firebase 3.0+ the method to get the database reference was as such: var ref: FIRDatabaseReference! ref = FIRDatabase.database().reference() ref.child("rooms").observeSingleEventOfType(.Value, withBlock: { (snapshot) in if snapshot.hasChild("room1"){ print("true rooms exist") }else{ print("false room doesn't exist") } }) In Firebase 4.0 the naming convention changed but I can't get it to work!? var ref: DatabaseReference! ref = Database.database().reference() Has anyone else encountered

How to manipulate firebase snapshot data

[亡魂溺海] 提交于 2019-12-24 08:03:56
问题 I am trying to understand how to delete a node inside a snapshot. I have looked at other examples but I did not find something on deleting. this is what the JSON looks like { "series": { "audit": null, "contacts": null, "images": null, "products": { "-LQgKSWzEtN9eVHcVLzV": { "dataEntryDevice": "FIGGG", "dataEntryDeviceVersion": "1.0", "dateTimeUploaded": "2018-11-06T20:02:20-08:00", "marketId": 19, "metrostudyMarketId": "D245B426-102C-4678-BED2-BB9FB35764BD", "products": [ { "auditDate": "11

React Native Firebase DataSnapshot

这一生的挚爱 提交于 2019-12-24 08:01:04
问题 I'm trying to implement firebase into my React Native app with the following code: import * as firebase from 'firebase' var fireBaseconfig = { apiKey: "MY KEY", authDomain: "MY DOMAIN", databaseURL: "MY URL", storageBucket: "MY BUCKET", }; var firebaseApp = firebase.initializeApp(fireBaseconfig); var rootRef = firebase.database().ref; var query = rootRef.ref("items"); query.once("value") .then(function(snapshot) { snapshot.forEach(function(childSnapshot) { var key = childSnapshot.key; var