firebase-realtime-database

Firebase once() timeout

*爱你&永不变心* 提交于 2019-12-23 18:44:39
问题 I am using Firebase once() method to retrieve a value in a React Native mobile app. Trouble is if the phone is offline, once() never returns. Documentation says that ref.off() method should cancel callbacks, but that doesn't seem to work. I'm guessing that off() doesn't apply to once() callbacks. If so how would I create a timeout? 回答1: There's no such concept as a timeout when dealing with Firebase Realtime Database APIs on any platform. Clients are generally not expected to know or care if

What is the proper way to change Firebase data structure?

ぃ、小莉子 提交于 2019-12-23 18:34:03
问题 Let's say I have a Firebase database in working. Suddenly I want to add an additional field in an object. What's the proper way to do it? Export the data json file then add it manually? Add it programmatically? What's your suggestions for modifying the Firebase schema? Cheers Well 来源: https://stackoverflow.com/questions/40734586/what-is-the-proper-way-to-change-firebase-data-structure

Where is or What is the serviceAccountKey.json is the node js sample of firebase realtime database

China☆狼群 提交于 2019-12-23 17:43:55
问题 I have downloaded the zip of Firebase real-time database node.js sample and navigate to the database section https://github.com/firebase/quickstart-nodejs/tree/master/database And I located to the line 35 which has the following code var serviceAccount = require('path/to/serviceAccountKey.json'); But I was wondering where is/what is the serviceAccountKey.json? 回答1: It's a JSON file generated in the Firebase Console (see Add Firebase to your App) containing credentials about your corresponding

Getting keys from Firebase query

帅比萌擦擦* 提交于 2019-12-23 17:41:00
问题 I am having problem getting keys from queried results. This is my Firebase Database structure: { "Users" : { "7idb6ThWR8aqmnEHFao5GRCV1kI3" : { "dPicture" : "https://firebasestorage.googleapis.com/v0/b/parkir-ngasal.appspot.com/o/Profile_images%2Fcropped1465266876.jpg?alt=media&token=44f83fdf-935a-4b3c-8138-561dcba2fca7", "status" : "hi my name is erik", "uid" : "7idb6ThWR8aqmnEHFao5GRCV1kI3", "username" : "erik" } }, "posts" : { "-KfsrGsY8TWb2wiMFtAq" : { "dPicture" : "https:/

Firebase listener effect on battery life and CPU [closed]

☆樱花仙子☆ 提交于 2019-12-23 17:04:22
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . If I want to have a service in my android app that listens from Firebase if a child has been added to the signed user friend's request, does it affect the battery or the CPU of the users? I yes, should I consider finding another solution? I plan to have 3 other listeners in the background as well.

Could not find com.google.firebase:firebase-database:9.2.0

大兔子大兔子 提交于 2019-12-23 17:03:25
问题 I was trying to install new firebase database into my app, but it was failed with next error: Error:Could not find com.google.firebase:firebase-database:9.2.0. Required by: appName:app:unspecified than i clone official google example frome here and was trying to build database example, but i still get same error... looks like this is because of some google error. am i right? in other case, why it happens and how to fix this? 回答1: You have to update/install Google Repository, revision 30 (Your

Firebase database no class found error (NoClassDefFoundError)

落花浮王杯 提交于 2019-12-23 16:42:44
问题 I have large project that uses multiple sub-modules, I have added the firebase database dependency to one of my modules that is included in my project. When testing locally where modules are included as open projects everything works fine, when building using closed modules (my modules come as aar files) I get the following error: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/database/FirebaseDatabase; I have include the following dependency in my module:

How to Insert new data in existing array in Firebase Database from Android?

跟風遠走 提交于 2019-12-23 16:12:54
问题 I'm Learning the Firebase Database with Android, Having array of data in Firebase Database Like Below image. cineIndustry is an Array of data. In JSON it looks Like this "cineIndustry" : [ { "type" : "Hollywood" }, { "type" : "Kollywood" }, { "type" : "Bollywood" } ] I want Insert new data in this Array. POJO Class @IgnoreExtraProperties public class CineIndustry { void CineIndustry(){} public String type; } Save new data CineIndustry cineIndustry = new CineIndustry(); cineIndustry.type =

firebase Cloud function transaction working sporadically

一笑奈何 提交于 2019-12-23 16:12:03
问题 I have the cloud function like so: exports.updateNewsCount = functions.database.ref('/channels/{channelId}/news/{newsId}/') .onWrite (event => { const channelId = event.params.channelId; const newsId = event.params.newsId; let CntRef = admin.database().ref('/channelDetails/' + channelId + '/newsCnt'); if (event.data.exists() && !event.data.previous.exists()){ return CntRef.transaction(function(current){ if (current){ console.log ('current is not null'); return (current || 0) + 1; } else {

Unable to use interface with AngularFirebase

独自空忆成欢 提交于 2019-12-23 15:38:24
问题 While trying to create a shopping cart in angular, I've run into type issues regarding my components and services. My service currently returns AngularFireList<{}> and though I can change its type, doing so has side-effects in other methods and inside of my component. I'm wondering if there is an efficient way to allow my current interface to become the type. I've tried to cast the type as Observable<ProdInterface> which again, solves one issue while bringing in another. My current interface