firebase-realtime-database

Firebase App Search Feature - Query Using String Regex

烂漫一生 提交于 2019-12-31 01:45:07
问题 I am porting an app over from Parse to Firebase and I used to be able to query using matchesRegex and putting the search into "(?i)\(searchBar.text!)" . By doing this, the user could search "p" and the database would return (for example) "person", "People", "pot", etc. I can't seem to find a way to query like this using Firebase that allows a user to search part of a String and Firebase looks for the substring within the database. I am using: databaseReference.child("Schools")

Android how to remove value from firebase database?

半城伤御伤魂 提交于 2019-12-31 00:49:13
问题 this is my first project in firebase. I am trying to remove value from firebase but when ever i am trying to remove value from firebase, my application crashes. I am not getting how do i solve this error Service.class public class NotiListener extends Service { @Override public IBinder onBind(Intent intent) { return null; } //When the service is started @Override public int onStartCommand(Intent intent, int flags, int startId) { //Opening sharedpreferences SharedPreferences sharedPreferences

Is a Firebase UID always 28 characters?

对着背影说爱祢 提交于 2019-12-30 17:22:26
问题 I am creating security rules for my Firebase project and wanted to add UIDstring.length == 28 to my database rules. All of my users UIDs are 28 characters, but I wanted to check if they can be any longer or shorter? Thanks 回答1: A Firebase developer had this to say on their forums: I would not rely on a constant length for the UIDs forever. We chose the current value because it provides a big enough ID space while still being under the 36-character limit for Firebase Analytics user properties.

Firebase Android addListenerForSingleValueEvent sometimes not returning data

家住魔仙堡 提交于 2019-12-30 17:17:28
问题 When my application starts, I check the current user's details in my Firebase database (I'm storing it's uid for that). I'm attaching addListenerForSingleValueEvent to user's ref to read it's data. My problem is that sometimes, it doesn't return any value, neither success nor failure. Only clearing application's data solves it, but of course forces the user to login again. I've read some posts at SO, but didn't find any solution. Here's my piece of code: DatabaseReference newUser =

How to retrieve 'double' values saved under one key in Firebase?

故事扮演 提交于 2019-12-30 14:36:30
问题 I have stored Geofire coordinates in database and now I'm trying to retrieve them using childEventListener() like this: mDatabase.child("geofire").child(key).child("l").addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { if (dataSnapshot.getValue() != null) { //error on line below Map<Double, Double> newRequest = (Map<Double, Double>) dataSnapshot.getValue(); venueLatString = newRequest.get(0).toString(); venueLngString =

Cloud Functions for Firebase HTTP Request

一笑奈何 提交于 2019-12-30 13:56:22
问题 I want to send an HTTP Request from Android to a cloud function, post some values, then input these values into real time database. index.js const functions = require('firebase-functions'); exports.testPost = functions.https.onRequest((req, res) => { console.log(req.body); }); How can I accomplish this? 回答1: I see three steps in here: Calling a Cloud Function from Android . This is the same as calling any other HTTP URL from Android. See Calling a Cloud Function from Android through Firebase

firebase cloud function API Error with Google Cloud Storage

我怕爱的太早我们不能终老 提交于 2019-12-30 11:33:29
问题 With the introduction of Firebase Cloud Functions we are looking at moving some of our current node.js server side code to cloud functions. One issue I am having is with downloading a file from a GCS bucket to a temp file on disk, and then emailing that as an attachment (using mailgun-js). The piece of code causing me grief is: return mkdirp(tempLocalDir).then(() => { const bucket = gcs.bucket(gcsBucket); const tempFilePath = tempLocalDir + gcsFile; return bucket.file(gcsFile).download({

Can we have Email Id as key in Firebase database? [duplicate]

泄露秘密 提交于 2019-12-30 11:28:30
问题 This question already has an answer here : Swift Firebase Must be a non-empty string and not contain '.' '#' '$' '[' or ']' (1 answer) Closed last year . I want to create a login system , when the user logs in, based on the logged in users email id, I want to retrieve the EID. The JSON structure I want is: { "joel@dept.com": { "EID":"0153" }, "Stan@dept.com": { "EID":"0163" } } I tried importing the JSON file with above structure into the Firebase projects database, but got an error

Firebase User photoURL and displayName

青春壹個敷衍的年華 提交于 2019-12-30 11:22:11
问题 I'm having a time trying to wrap my head around what I thought was a simple concept. I have an app where I sign up a user, allow that user to set a 'photoURL' to their 'user' information in the Firebase Auth system. This works. When the user creates a post in my app, I want to display the title, image and 'photoURL' of the creator. Currently, I save the post: -Post { -id -title -image -photoURL <- from current logged in user } I also allow users to visit the posters page via routing /poster/

How to connect to Firebase by Firebase Admin against a proxy?

不羁岁月 提交于 2019-12-30 11:14:17
问题 Currently, I am using Firebase Admin SDK to connect a Firebase database in a NodeJS server side application. But I do not find an option to connect Firebase via proxy settings, or it can detect my system HTTP_PROXY environment variable. When I run the node script by node index.js , and got some timeout messages like this(I know in my work network, I can not connect to Firebase directly). Error: Credential implementation provided to initializeApp() via the "credential " property failed to