發表文章

How to make the response object that another ViewController's post request returns append to a...

圖片
1 1 I am a Swift beginner so apologies. With Siesta, I want to make a post request in a ViewController and then have the Entry object the request returns added to the TableViewController. In my ViewController: EntryAPI.sharedInstance.addEntry() The API code: func addEntry() -> Request { return newEntry().request(.post, json:["foo": "bar"]) } func newEntry() -> Resource { return service .resource("/entry") } After the post request the ViewController does an unwind segue to the TableViewController, of course before the post request completes. I am not sure where in the code I would take the response and call a function in the TableViewController that appends the new Entry object to the entry list. I am not sure if I should pa...

How to use getdownloadurl in recent versions?

圖片
0 Uri downloaduri=taskSnapshot.getDownloadUrl();//here i cant use getdownloadurl() function DatabaseReference new_prod=db.push(); new_prod.child("product name").setValue(prod_name); new_prod.child("product price").setValue(prod_price); new_prod.child("available stock").setValue(prod_quan); new_prod.child("product image").setValue(downloaduri); pd.dismiss();//fragments code I was unable to use getdownloadurl .I have already stored image in the firebase storage.Is it the fragment that is restricting the use of getdownloadurl? My motive is to make a query to store in firebase.please help me. android firebase fir...