firebase-realtime-database

Getting the values of data stored in firebase

China☆狼群 提交于 2019-12-25 08:44:21
问题 I'm trying to get access to the values stored in firebase dashboard to use them in different functions and methods in the class. I used this method in this question I have tried to print their values, the whole app has crashed and it gave me that their nil! They are not nil actually! I used a similar method in viewDidLoad and I could retrieve the values to labels! let refer = FIRDatabase.database().reference().child("UserDevices") var globalEmail : String! var globalPhone : String! var

Firebase imageview array

﹥>﹥吖頭↗ 提交于 2019-12-25 08:39:08
问题 in my app, I am using a custom image array view. A number of images the user uploads per post should be a number of images displayed in a carousel-like manner. In firebase, I have values from image to imageFive { "image" : "W585B.jpg", "imageFive" : "", "imageFour" : "", "imageThree" : "", "imageTwo" : "", } As you can see in this example only one value has a string in it. The users have the ability to post one to five images. I want to append however many images the user uploads and display

Why I am getting an ArrayList instead a HashMap on Firebase-RealDatabase?

对着背影说爱祢 提交于 2019-12-25 08:34:06
问题 My Database: { "Shops": { "Title": { "1": "Footlocker", "2": "Nike Store", "3": "Adidas Store" }, "Lat": { "1": "123", "2": "123", "3": "123" }, "Lon": { "1": "123", "2": "123", "3": "123" } } } The numbers "1","2" and "3" represent a shop. For example "1" shop has "Footlocker" for title and "123" latitude (probably this should be a number, but that's not my problem). My goal is to get all the titles in a Hashmap<String,String> (key would be "1"... value "Footlocker" etc...) So I create a

best practize summarize FirebaseDatabase values

自作多情 提交于 2019-12-25 08:32:54
问题 I am creating a Firebase Android and Web app, that simply collects weight data of model trucks on an event base. So I have a list of trucks and their properties. All cars attending the event are listed in the database under the attendingCars path, sample for one entry: "attendingCars" : { "-K_t-PnY49QJP5QXQJ5_" : { "carDescription" : "MB SK Sattel mit Kippmulde", "carEmptyWeight" : 7.456999778747559, "carLoadCnt" : 13, "carLoadSummary" : 12.059002876281738, "carLoadTotal" : 109.00000762939453

Getting 'Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference' even when the reference is not null

ⅰ亾dé卋堺 提交于 2019-12-25 08:28:51
问题 I'm using FirebaseUI in my app and FirebaseRecyclerAdapter to be more specific. I'm fetching data from my FirebaseDatabase reference using the method given here. Here's my code: private void attachRecyclerViewAdapter() { Query lastFifty = mDatabase.child(rID).limitToFirst(50); mRecyclerViewAdapter = new FirebaseRecyclerAdapter<AModelClass, AModelClass.ViewHolder>( AModelClass.class, R.layout.a_player_layout, APlayersModelClass.ViewHolder.class, lastFifty) { @Override protected void

Complex query from Firebase

你离开我真会死。 提交于 2019-12-25 08:27:23
问题 I need to join my two tables from Firebase. Right now, i got the data structure as shown below. When a log is created by a user, it gets a unique ID from Firebase. This ID is saved under the user who created it (test2@test.dk). But i want to show the logs, only to the user who is logged in, how do i achieve this? Right now, i can only get the key, but i need the data such as duration and startDate. logs -KVMbJKN1i2vAxzutiYq duration: 14 startDate: 28/10/2016 -KVMbLL4i_9dwaRZ9REB duration: 28

Firebase queryEqualToValue get Key in Swift 2.3

*爱你&永不变心* 提交于 2019-12-25 08:18:02
问题 I am developing a small application in iOS using Swift and Firebase. I am having trouble querying a data and retrieving the value. My firebase realtime database is this: "qrcode" : { "postsedation_room" : "http://bing.com", "preprocedure_room" : "http://google.com", "presedation_room" : "http://en.m.wikipedia.org" } I would like to make this query : let query = rootRef.child("qrcode").queryEqualToValue("http://bing.com") query.observeSingleEventOfType(.Value, withBlock: { snapshot in print

Swift Firebase check if email is already in use

青春壹個敷衍的年華 提交于 2019-12-25 08:17:58
问题 I want to be able to check if an email address is already been used (so if somebody put test1@test.com but another user already registered with that email account). I have a simple test if it has NOT been used an image view shows a green arrow, if it HAS been used then it is red x when I create the user I use the following code FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: { (user, error) in if error == nil { self.ref.child("userEmails").child((user?.uid)!)

Get cell index from tableviewcell

百般思念 提交于 2019-12-25 08:17:56
问题 Hey I have this tableview controller that list restaurants from my database. what I want to do is if the cell/row is selected it opens a more detail page about the restaurant. for some reason I can't retrieve the index or its not going to the func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) to give me index here is what I have: class HomeTableViewController: UITableViewController{ var restaurantArray = [Restaurant]() var resTransfer: Restaurant? var

Join queries with polymer and firebase

送分小仙女□ 提交于 2019-12-25 08:16:26
问题 I'm trying to do something which in theory should be simple. I have the following data structure in Firebase: - projects -- 1 --- name: some project --- organisation: awesome organisation --- users ---- uid1: true ---- uid2: true - users -- uid1 --- name: Bob --- email: bob@test.com --- tel: 020 3456 3456 -- uid2 --- name: tom --- email: tom@test.com --- tel: 020 3456 3456 I have a project id that is passed from a parent element, and I'd like to display all the users for that project. <dom