firebase-realtime-database

Use different GoogleService-Info.plist for single project in xcode using swift4

*爱你&永不变心* 提交于 2021-02-08 04:55:34
问题 I have a single project but with 4 different environments (Dev,Stagging,QA,Production). I have given their (environment's webservice url) paths from mobile's setting. Now I want to use different GoogleService-info.plist for all these different environments. Like when I select Dev from backend the project should take GoogleService-Info.plist of Dev project only. These GoogleService-Info.plists are created on 4 different accounts. Project should take the path of GoogleService-info.plist

How to limit Firebase database persistence store to only some nodes?

本秂侑毒 提交于 2021-02-08 04:42:31
问题 Adding the following code to the AppDelegate will make the Firebase database available when the user is off-line: FIRDatabase.database().persistenceEnabled = true How can we make just some parts of the database available in off-line mode and some parts available just when the user is on-line? 回答1: Short answer: you can't . Firebase don't currently provide such a fine grained persistence scope API. What you can do instead is decrease/increase the amount of disk space used by the persistence

Firebase understanding snapshot.child()

試著忘記壹切 提交于 2021-02-08 03:31:31
问题 consider this data structure referenced on the Firebase quick start guide (here) {"name": {"first": "Fred","last": "Flintstone"} The docs say that one can access the datasnapshot location of each child object of "name" returned from a query using: var ref = new Firebase("https://docs-examples.firebaseio.com/samplechat/users/fred"); ref.once("value", function(snapshot) { var nameSnapshot = snapshot.child("name"); var name = nameSnapshot.val(); name === { first: "Fred", last: "Flintstone"} var

delete node in firebase

落花浮王杯 提交于 2021-02-08 01:33:49
问题 been reading docs and other posts but I am unable to remove a node. I am attempting to select the node by a value. var eventContactsRef = firebase.database().ref('events-contacts'); eventContactsRef.orderByChild('eventContactId').equalTo(eventContactId); then call the remove method on the result eventContactsRef.remove(function (error) { console.log(error); }); nothing happens except a null error value. I am using the latest firebase, most examples are for older versions so I am unsure if I

How to implement pagination in Firebase using JavaScript?

点点圈 提交于 2021-02-07 21:03:10
问题 I am working on Firebase pagination using JavaScript. I have implemented a soft delete feature where the record is not deleted in Firebase but deleted in the web display. So when a soft delete is being done, the visible flag in Firebase becomes false. I want to display on my web form, the contacts whose visible flag is true using JavaScript ( with the NEXT and PREV buttons ). Since I am new to this, I would love to get suggestions and help!! A Snapshot of Firebase is as follows: My code of

How to implement pagination in Firebase using JavaScript?

戏子无情 提交于 2021-02-07 21:00:07
问题 I am working on Firebase pagination using JavaScript. I have implemented a soft delete feature where the record is not deleted in Firebase but deleted in the web display. So when a soft delete is being done, the visible flag in Firebase becomes false. I want to display on my web form, the contacts whose visible flag is true using JavaScript ( with the NEXT and PREV buttons ). Since I am new to this, I would love to get suggestions and help!! A Snapshot of Firebase is as follows: My code of

Firebase Multi-Language support: Is possible?

China☆狼群 提交于 2021-02-07 20:59:38
问题 Is it possible to have a multilanguage json file for Firebase Database? Example: I have the following in json file: "219" : { "AnswerA" : "Monarchy", "AnswerB" : "Aristocracy", "AnswerC" : "Theocracy", "AnswerD" : "Anarchy", "CategoryID" : "01", "CorrectAnswer" : "Theocracy", "IsImageQuestion" : "false", "Question" : "What is the type of Government in Swaziland?" }, How can i add a translation, so when user choose another language, get the question and answer in the new language? 回答1:

Firebase Multi-Language support: Is possible?

£可爱£侵袭症+ 提交于 2021-02-07 20:56:22
问题 Is it possible to have a multilanguage json file for Firebase Database? Example: I have the following in json file: "219" : { "AnswerA" : "Monarchy", "AnswerB" : "Aristocracy", "AnswerC" : "Theocracy", "AnswerD" : "Anarchy", "CategoryID" : "01", "CorrectAnswer" : "Theocracy", "IsImageQuestion" : "false", "Question" : "What is the type of Government in Swaziland?" }, How can i add a translation, so when user choose another language, get the question and answer in the new language? 回答1:

How to handle Firebase Database error in iOS? #AskFirebase

守給你的承諾、 提交于 2021-02-07 19:50:04
问题 I need to handle "Permission Denied" error differently from all other errors. In Android I've done it: (Kotlin) override fun onCancelled(error: DatabaseError) { if (error.code == DatabaseError.PERMISSION_DENIED) { // Warn user } } In iOS I have only: someDbReference.observe(.childAdded, with: { data in // Do something }, withCancel: { err in // err is Error print((err as NSError).code) // 1 // Which error? O_o }) How to determine error type? I've read whole documentation, and I think that err

How to handle Firebase Database error in iOS? #AskFirebase

∥☆過路亽.° 提交于 2021-02-07 19:48:56
问题 I need to handle "Permission Denied" error differently from all other errors. In Android I've done it: (Kotlin) override fun onCancelled(error: DatabaseError) { if (error.code == DatabaseError.PERMISSION_DENIED) { // Warn user } } In iOS I have only: someDbReference.observe(.childAdded, with: { data in // Do something }, withCancel: { err in // err is Error print((err as NSError).code) // 1 // Which error? O_o }) How to determine error type? I've read whole documentation, and I think that err