firebase

Firebase deploy keeps giving me an Error: Parse Error in remoteconfig.template.json

青春壹個敷衍的年華 提交于 2021-02-08 23:34:46
问题 I am trying to deploy a web app with firebase but every time I run deploy I keep getting this error Error: Parse Error in remoteconfig.template.json: No data, empty input at 1:1 ^ File: "remoteconfig.template.json" 回答1: You have a reference to a remoteconfig.template.json in your firebase.json files, but that template doesn't exist. This will typically look like: "remoteconfig": { "template": "remoteconfig.template.json" } The solution is to find this section in your firebase.json file, and

Salt/Hash for Firebase Simple Login?

我怕爱的太早我们不能终老 提交于 2021-02-08 23:29:24
问题 Firebase offers 'Simple Login' in which email/password is used for authentication. Does anyone know if firebase salts and hashes the password before storing it? I imagine that firebase would know enough to do so, but I just wanted to make sure, because I could not find anything on this after an hour of searching. Anticipated follow up: If firebase in fact does not salt+hash the passwords, would the Simple Login work if I took the user's password, salted+hashed, and passed it onto firebase to

Salt/Hash for Firebase Simple Login?

与世无争的帅哥 提交于 2021-02-08 23:19:11
问题 Firebase offers 'Simple Login' in which email/password is used for authentication. Does anyone know if firebase salts and hashes the password before storing it? I imagine that firebase would know enough to do so, but I just wanted to make sure, because I could not find anything on this after an hour of searching. Anticipated follow up: If firebase in fact does not salt+hash the passwords, would the Simple Login work if I took the user's password, salted+hashed, and passed it onto firebase to

How do I convert a Firestore date/Timestamp to Date in Kotlin?

拜拜、爱过 提交于 2021-02-08 21:48:10
问题 i'm working with firestore, and getting stuck when i get the timestamp from firestore. how i convert this Timestamp(seconds=1556006384, nanoseconds=994000000) to Date in kotlin. my minimum SDK is 21 so the code below doesn't work val timestamp = it["time"] as com.google.firebase.Timestamp val milliseconds = timestamp.seconds * 1000 + timestamp.nanoseconds / 1000000 val tz = ZoneId.of("Asia/Jakarta (UTC+07:00)") val localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(milliseconds), tz

Firebase Functions error: .once is not a function

被刻印的时光 ゝ 提交于 2021-02-08 21:47:10
问题 I am trying to deploy a simple function to Firebase, but I am having some difficulties. Every time I try to use .once on a reference Firebase tells me that it is not a function. Here is my code exports.testFunction = functions.database.ref('/Rooms/{firstID}/{pushId}/On').onWrite(event => { const value = event.data.val(); var ref = functions.database.ref(roomNum); return ref.once('value').then(snapshot => { console.log(snapshot.numChildren); return true; }); }); I have also tried the following

firebase return onSnapshot promise

不问归期 提交于 2021-02-08 21:19:46
问题 I'm using firebase/firestore and I'm looking a way to return promise of snapshot. onlineUsers(){ // i want to return onSnapshot return this.status_database_ref.where('state','==','online').onSnapshot(); } in other file I did componentDidMount(){ // this.unsubscribe = this.ref.where('state','==','online').onSnapshot(this.onCollectionUpdate) firebaseService.onlineUsers().then(e=>{ console.log(e) }) } I get the errors Error: Query.onSnapshot failed: Called with invalid arguments. TypeError:

Firebase Upload in Java Spring Boot

蓝咒 提交于 2021-02-08 20:59:37
问题 I'm trying upload a file to Firebase storage in Java Spring Boot. I have looked on Stack Overflow and elsewhere online but have not found a working solution yet. Please help and thanks in advance! So far I have the following code below, which is based on the code of this question: // Input Firebase credentials: FileInputStream serviceAccount = new FileInputStream("{{path to the keys}}"); FirebaseOptions options = new FirebaseOptions.Builder() .setCredentials(GoogleCredentials.fromStream

Firebase Firestore rules: will get()'ing the document being checked counted as another read?

纵饮孤独 提交于 2021-02-08 19:32:07
问题 I have a code in Firestore security rules like this (showing only relevant parts): match /users/{userId} { function isUserDisabled(userId) { return get(/databases/$(database)/documents/users/$(userId)) .data.admin == true; } allow read: if true; allow write: if request.auth.uid == userId && !isUserDisabled(userId); match /posts/{postId} { allow read: if true; allow write: if request.auth.uid == userId && !isUserDisabled(userId); } } isUserDislabled() is a function that will be called in

How to import firebase-functions and firebase-admin in ES6 syntax for transpiling with Babel for Node 10

回眸只為那壹抹淺笑 提交于 2021-02-08 19:02:07
问题 I'm currently writing my cloud functions in ES6 and transpiling with Babel to target the Node v10 environment. And I've noticed something weird. Why is that when I import firebase-functions like this: import functions from 'firebase-functions'; I get this error: ! TypeError: Cannot read property 'https' of undefined at Object.<anonymous> (C:\myProject\functions\index.js:28:55) And to fix it, I need to import it like this: import * as functions from 'firebase-functions'; While the following

I want to get serving url for my images on firebase storage

守給你的承諾、 提交于 2021-02-08 17:31:09
问题 It is possible to get a serving url like http://lh3.googleusercontent.com/-dB80E6geqWFVU41ZmWL1iGC0BkCDcXAGojwaAgMHG-wMe_xCpISffiaNy00Y6ATJ2J9_W_I8rMgwQYWQQyGcFuffw=s1024 It's done by using google app engine: images.get_serving_url(blobkey, secure_url=False) I don't want to use Google App Engine, just Firebase or the UI. Can this be accomplished? Thanks! I got the info/idea from here: http://www.photo-mark.com/notes/photo-site-app-engine/ List of all the App Engine images service get_serving