firebase-realtime-database

Firebase Database Error - Expected a Map while deserializing, but got a class java.util.ArrayList

北慕城南 提交于 2020-01-11 12:29:07
问题 Edit: Figured it out, check my posted answer if you're having similar issues. I know there are several questions about this issue, but none of their solutions are working for me. In my model class I have made sure to use List instead of Arraylist to avoid Firebase issues, but am still getting this error. It's a lot of code but most questions ask for all the code so I'll post it all. TemplateModelClass.java // I've used this basic model successfully many times. For the HashMaps<String, List

Which ports have to be open to communicate with Firebase Database (not FCM messaging)?

假装没事ソ 提交于 2020-01-11 11:41:32
问题 I have written a Windows service in C# which connects to the Firebase Database and stores data. For connection and database communication, I use a NuGet Packages called "FirebaseAuthentification.net" and "FirebaseDatabase.net", both by StepUp Labs, Inc. On my test system, everything works fine. On the customer's system, there are firewall/procy restrictions which deny communication. We already opened Port 443 and are able to send a request, but the answer does not arrive. Old GCM Doc says: If

Swift function works in app but not within override func viewDidLoad()

岁酱吖の 提交于 2020-01-11 11:33:07
问题 In my iOS app, I have two Firebase-related functions that I want to call within viewDidLoad(). The first picks a random child with .queryOrderedByKey() and outputs the child's key as a string. The second uses that key and observeEventType to retrieve child values and store it in a dict. When I trigger these functions with a button in my UI, they work as expected. However, when I put both functions inside viewDidLoad(), I get this error: Terminating app due to uncaught exception

Creating and appending arrays in Firebase-ios-swift

有些话、适合烂在心里 提交于 2020-01-11 11:32:54
问题 How to create an array in the firebase 3.0 and perform the functions of append and delete in the array This is the data structure i am looking for:- 1-UserIds --0.) 12345 --1.) 678910 --2.) 1112131415 2-UserProfile --0.) 12345 -0.) userName : "Rayega" -1.) friends : ["Julian","Mary","Powers"] --1.) 678910 -0.) userName : "Morse" -1.) friends : ["Polme","Mary","Finn"] --2.) 1112131415 -0.) userName : "Tanya" -1.) friends : ["Ester","Hulio","Julian"] i want to create an array like UserIds and

Firebase databases replication

北城余情 提交于 2020-01-11 10:10:47
问题 I need a data from one Firebase project's database in 2 iOS apps (with different bundle names). So, the question is: Is it possible to configure replication between 2 different Firebase project's databases? Or is it possible to use 1 Firebase project (1 database) for 2 ios apps? 回答1: There is no built-in feature to replicate Firebase Databases. I'm not aware of any tools that replicate between two Firebase Databases. The closest is probably making a backup from one database and restore to

Firebase databases replication

心不动则不痛 提交于 2020-01-11 10:09:13
问题 I need a data from one Firebase project's database in 2 iOS apps (with different bundle names). So, the question is: Is it possible to configure replication between 2 different Firebase project's databases? Or is it possible to use 1 Firebase project (1 database) for 2 ios apps? 回答1: There is no built-in feature to replicate Firebase Databases. I'm not aware of any tools that replicate between two Firebase Databases. The closest is probably making a backup from one database and restore to

Adding items to Firebase array in Swift without observing for array first

▼魔方 西西 提交于 2020-01-11 09:23:10
问题 Currently I add a new post to my Firebase array by observing for the array first, appending my new post, and then updating the ref: REF_USER.child(UID).observeSingleEventOfType(.Value, withBlock: { snapshot in if !snapshot.exists() {return} if let dict = snapshot.value as? Dictionary<String, AnyObject>, let posts = dict["posts" as? [String] { posts.append(newPost) REF_USER.child(UID + "/posts").setValue(posts) } } Is there a way to skip the step of observing , and straight away update posts

Firebase prevent duplicate categories using rule [duplicate]

懵懂的女人 提交于 2020-01-11 07:43:12
问题 This question already has answers here : Firebase how to prevent duplicate entries atomically (4 answers) Closed 3 years ago . Here is my database structure for categories I want prevent duplicate data using Firebase rules here is my firebase rule { "rules": { ".read": "auth != null", ".write": "auth != null", "categories": { "$catid": { ".validate": "!root.child(newData.child('type').val()).exists()" } } } } When I am trying to insert again java it's inserting duplicate of java how do I

Firebase Realtime DB: Howto index properly on key-value pair

↘锁芯ラ 提交于 2020-01-11 07:43:08
问题 Question I have this Firebase Realtime Database: { "groupUsers" : { "group1key" : { "user1key" : "admin" }, "group2key" : { "user1key" : "admin", "user2key" : "readonly", "user3key" : "readwrite" } } } In my Android app I query that like this DatabaseReference ref = FirebaseDatabase.getInstance().getReference("groupUsers"); ref.orderByChild(auth.getCurrentUser().getUid()).startAt("").addValueEventListener() {...} That produces the warning: Using an unspecified index. Consider adding ".indexOn

Firebase Android - startAt() and endAt() not working correctly?

三世轮回 提交于 2020-01-11 07:37:07
问题 How do I search for users based on their usernames? I have looked at numerous SO posts on this matter but am still unable to achieve what I want to do.. I have tried to apply what I saw in those posts and is shown below: DatabaseReference usersRef = FirebaseDatabase.getInstance().getReference("users"); usersRef.orderByChild("username") .startAt(queryText) .endAt(queryText+"\uf8ff"); usersRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange