firebase-realtime-database

Firebase iOS Swift fatal error: NSArray element failed to match the Swift Array Element type

时光毁灭记忆、已成空白 提交于 2019-12-23 05:00:32
问题 I am trying to fetch data from firebase database the format of data is below. { "chits": { "Chit-1": { "Bidders": [ { "bankAccNumber": "5555566966", "bankIFSC": "GFHJJHHJ", "bankName": "55666", "bidderEmail": "desi@venkat.co.in", "bidderId": "Bidder-1", "bidderName": "Venkat Desi", "bidderPhone": "9999999999", "checked": false, "paymentType": 66555 }, { "bankAccNumber": "5555566966", "bankIFSC": "GFHJJHHJ", "bankName": "55666", "bidderEmail": "desi@venkat.co.in", "bidderId": "Bidder-2",

How to grant read-read/write access to specific UIDs from Firebase Auth and Database

吃可爱长大的小学妹 提交于 2019-12-23 04:49:07
问题 I have been struggling to grasp an understanding from recent researching of how to implement to grant different access levels to certain users in my system. I want to be able to grant one user read access and another with read/write referencing their uid. What work is required to implement this? Do I need to restructure my DB and how are my JSON rules structured? UPDATE - Implemented new rules and db structure Current DB reference for store 01 - database = FirebaseDatabase.getInstance()

Adding Firebase Post Overwrites All Other Posts Swift

ぃ、小莉子 提交于 2019-12-23 04:46:07
问题 I have written code that correctly writes a single post to my Firebase database. The issue is that when I add another post it overwrites the post that was there previously. How can I add the posts to the existing array without overwriting? func postToFirebase(imgUrl: String) { let post: Dictionary<String, AnyObject> = [ "caption": postDescription.text! as AnyObject, "imageUrl": imgUrl as AnyObject, "likes": 0 as AnyObject ] let firebasePost = DataService.ds.REF_POSTS.childByAutoId()

Combining JSON Data Sets

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 04:35:28
问题 Let's say I have the following two data sets: { "food": { "apple": { "color": "red" }, "orange": { "color": "orange" }, "potato": { "color": "brown" }, "tomato": { "color": "red" } } } and { "fruits": { "apple": { "isFruit": "yes" }, "orange": { "isFruit": "yes" }, "tomato": { "isFruit": "yes" } } } Is there a way to combine these two sets so that they end up looking like: { "food": { "apple": { "color": "red", "isFruit": "yes" }, "orange": { "color": "orange", "isFruit": "yes" }, "potato": {

How to apply rxjs operator to data got from angularfire2

我怕爱的太早我们不能终老 提交于 2019-12-23 04:21:17
问题 Suppose I requested for data in angularfire2 like this: var ref = new Firebase("firebase url"); Now how can I apply rxjs operator like map operator to the data coming 回答1: I don't think you are looking at angularfire2 there - that's v1 code... You can use the rxjs operators in angularfire2 - the data is returned as an Observable (FirebaseListObservable or FirebaseObjectObservable) - so you can import and apply any of the rxjs operators to those... In general, you just assign the data to a

FireBaseRecyclerView in FirebaseRecyclerView can not be applied to : (arguments)

陌路散爱 提交于 2019-12-23 04:14:06
问题 I'm trying to retrieve data from Firebase to Recyclerview. I've already implement all other steps but now i'm getting error at the last stage when i'm implementing the adapter(FirebaseRecyclerAdapter). My Fragment public class Journal extends Fragment { RecyclerView recyclerView; DatabaseReference myref; @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.activity_journal,container

Retrieve and check whether a particular user enter email is present in firebase

人盡茶涼 提交于 2019-12-23 04:07:07
问题 I am developing an android application and using Firebase to store my data. I want to query the firebase instance to check whether the user entered email address matches one of the email in Firebase. Attaching the Firebase backend data. My requirement is, I want to loop through the "guardians" , which is the direct child of the Database instance and check whether the user entered email matches any one of the email address in that child. In the attached image, if the user entered email matches

How to get properties / values from snapshot.val() or snapshot.exportVal() in Firebase?

旧时模样 提交于 2019-12-23 03:55:12
问题 I was able to fetch my interested object as snapshot as shown in this CodePen Following is the code snippet : $scope.post = {}; var postsRef = new Firebase('https://docs-examples.firebaseio.com/web/saving-data/fireblog/posts'); $scope.searchPost = function () { console.log('searched for author : ' + $scope.post.authorName); postsRef.orderByChild('author') .equalTo($scope.post.authorName) .once('value', function (snapshot) { var val = snapshot.val(); console.log("Searched Post is : "); console

Strange behavior when dragging items on the second drag react-beautiful-dnd

谁说我不能喝 提交于 2019-12-23 03:49:09
问题 For some reason every second drag is not performing very well when using the react-beautiful-dnd package (see image) my onDragEnd function is looking like this: const onDragEnd = result => { if (!result.destination) { return; } if ( result.destination.droppableId === result.source.droppableId && result.destination.index === result.source.index ) { return; } const draggedItem = list[result.source.index]; list.splice(result.source.index, 1); list.splice(result.destination.index, 0, draggedItem)

Not retrieving new data after setting Firebase Persistence Enabled to true?

烈酒焚心 提交于 2019-12-23 03:48:09
问题 After making FirebaseDatabase.getInstance().setPersistenceEnabled(true); When query to get data Query query = FirebaseDatabase.getInstance() .getReference() .child("notifications") .child("entities") .child(FirebaseAuth.getInstance().getCurrentUser().getUid().toString()) .orderByChild("seen") .equalTo(0); From data tree it gives old data that is in cache instead of new changed data in Firebase databse.But When I change setPersistenceEnabled(true) to setPersistenceEnabled(false) then