firebase-realtime-database

Cannot use optional chaining on non-optional value of type 'Auth'

跟風遠走 提交于 2019-12-25 21:08:37
问题 var loggedInUser: User? let storageRef = Storage.storage().reference() let databaseRef = Database.database().reference() // structure definition goes here override func viewDidLoad() { super.viewDidLoad() self.loggedInUser = Auth.auth()?.currentUser//Cannot use optional chaining on non-optional value of type 'Auth' self.databaseRef.child("user_profiles").child(self.loggedInUser!.uid).observeSingleEventOfType(.Value) { (snapshot:DataSnapshot) in //'observeSingleEventOfType(_:withBlock:)' has

Cannot use optional chaining on non-optional value of type 'Auth'

为君一笑 提交于 2019-12-25 21:07:36
问题 var loggedInUser: User? let storageRef = Storage.storage().reference() let databaseRef = Database.database().reference() // structure definition goes here override func viewDidLoad() { super.viewDidLoad() self.loggedInUser = Auth.auth()?.currentUser//Cannot use optional chaining on non-optional value of type 'Auth' self.databaseRef.child("user_profiles").child(self.loggedInUser!.uid).observeSingleEventOfType(.Value) { (snapshot:DataSnapshot) in //'observeSingleEventOfType(_:withBlock:)' has

Cannot use optional chaining on non-optional value of type 'Auth'

▼魔方 西西 提交于 2019-12-25 21:07:30
问题 var loggedInUser: User? let storageRef = Storage.storage().reference() let databaseRef = Database.database().reference() // structure definition goes here override func viewDidLoad() { super.viewDidLoad() self.loggedInUser = Auth.auth()?.currentUser//Cannot use optional chaining on non-optional value of type 'Auth' self.databaseRef.child("user_profiles").child(self.loggedInUser!.uid).observeSingleEventOfType(.Value) { (snapshot:DataSnapshot) in //'observeSingleEventOfType(_:withBlock:)' has

firebase database keys to arraylist

旧时模样 提交于 2019-12-25 18:58:14
问题 i am trying to add the keys from a firebase database to an arraylist in my onDataChange method. mDatabase = FirebaseDatabase.getInstance().getReference("events"); mDatabase.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if(dataSnapshot.exists()) { for (DataSnapshot snapshot : dataSnapshot.getChildren()) { String event = snapshot.getKey(); Log.d("did it work??", event); eventList.add(event); } } } @Override public void

Firebase not observing until accessed once [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 18:49:33
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Firebase is configured in APPDelegate . Read is set to .true in rules. But, before I have a user sign into my application, I am checking for usernames, within a separate table of my Firebase DB. It would skip the observation block entirely, until I forced signed-in into another already created account of mine.

How to check if sub child exists in Firebase Realtime Database?

走远了吗. 提交于 2019-12-25 18:43:13
问题 My main node Employees has 3 values: Mob. no., UserPIN and empID. I need to check in one of my activities that if the entered UserPIN exists under thos node or not. I am not able to do this by using: if(datasnapshot.child(enteredUserPIN).exists(){ } And also I can't change my node layout as I am checking for the Mob. no. as well in another activity. Plus I can't directly give the path till the Mob. no. Please guide. Employees node: EDIT My code: private void mpinexists(){ Log.d("abcd",

Error in jjoe64 GraphView Library

≯℡__Kan透↙ 提交于 2019-12-25 18:39:20
问题 someone can help me? I found this error and I can't find the resolution to my problem. This is the Android Error: 09-15 18:26:47.434 3096-3096/com.example.user.navigationdrawer E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.user.navigationdrawer, PID: 3096 java.lang.IllegalArgumentException: new x-value must be greater then the last value. x-values has to be ordered in ASC. at com.jjoe64.graphview.series.BaseSeries.appendData(BaseSeries.java:388) at com.example.user

How to automatically delete a user in Firebase?

雨燕双飞 提交于 2019-12-25 18:37:03
问题 CODE: app.js setInterval(function() { console.log("1"); var pendingRef = admin.database().ref("pending"); var now = Date.now(); var cutoff = now - 1 * 60 * 60 * 1000; var old = pendingRef.orderByChild('timestamp').endAt(cutoff).limitToLast(1); console.log("2"); var listener = old.on('child_added', function(snapshot) { console.log("3"); console.log("A VALUE:"+snapshot.val()); snapshot.delete().then(function() { snapshot.ref().remove(); }, function(error) { console.log("USER WAS NOT DELETED:"+

Command PhaseScriptExecution failed with a nonzero exit code I

为君一笑 提交于 2019-12-25 18:25:30
问题 I am getting the below error /Users/user321/Desktop/MapForAppNewest/Pods/Target Support Files/Pods-MapForAppNewest/Pods-MapForAppNewest-frameworks.sh: line 114: local: `=': not a valid identifier /Users/user321/Desktop/MapForAppNewest/Pods/Target Support Files/Pods-MapForAppNewest/Pods-MapForAppNewest-frameworks.sh: line 114: local: `/Users/user321/Desktop/MapForAppNewest/Pods/Mapbox-iOS-SDK/dynamic/826E141E-8875-3C3B-A106-2B772F8A0684.bcsymbolmap': not a valid identifier Command

Count number of mutual friends in Firebase

送分小仙女□ 提交于 2019-12-25 17:45:06
问题 I'm trying to pull the number of mutual friends that I have with any given userID. I first pulled all my friends from Firebase and then I pulled the userID's friends. I'm just not sure how to count the number of mutual friends from there. Please let me know if I'm going about it the wrong way. func fetchMutualFriends(myID: String, userID: String) { let myID = Auth.auth().currentUser!.uid let postRef = self.databaseRef.child("friends").child(myID) postRef.observe(.value, with: { (snapshot) in