How can I get alerted when the Firebase service goes down?

I know I can manually go to status.firebase.com but I need to be alerted immediately when my firebase app goes down and when it comes back up. I thought I could possibly use dingitsup.com to send myself a notification, but i don't know where to point it. I would also like to have the option of automatically displaying a message to my users when Firebase is down to let them know the system is down and its not a problem on their end. Is there a Zapier integration i could use to achieve this? A

Firebase Validation Details

Is there any way to get the REAL reason for a failure to save data in Firebase? Right now, it seems that any data validation issue or security issue results in a "PERMISSION_DENIED" error. That is not particularly useful. Does it mean the user is not valid? Does it mean the user doesn't have permission to write somewhere? Does it mean that the property "accountName" must be longer than 2 characters and shorter than 500? Permission Denied should mean the user doesn't have permission. Sur

How do I set up a Firebase DB for Topeka, the Polymer sample quiz app?

I am trying to customize the Topeka quiz app by the Polymer team for a class, but do not know how to set up a Firebase DB for the leaderboard. I don't have the authentication needed to view the Polymer team's DB. I have changed topeka-leaderboard.html and topeka-datasource.html to reference my DB. The quiz app is hosted at http://adueppen.github.io/quiz and the DB is at https://incandescent-fire-8717.firebaseio.com.

firebase how to temporary secure data with a pincode

Read and write to boxes is only for authenticated user. Modification of boxes values only if the padlock is open less than 15 second ago. To open the padlock for 15 seconds, just update the value with the current time. How can i protect the padlock with a second simple auth layer? (like a client side pin code) Is the only way to use privileged worker? Web client securely send the pincode to the privileged worker. The worker will check the code and update the open timestamp. Add a security rule

Adding uid to firebase database using angularfire

I am using angularfire for my current project. I am having hard time configuring security rules. Here is my data structure: { users : { uid1 : { .. }, uid2 : { .. } } } Security rules: { "rules" : { "users" : { "$uid" : { ".write": "auth !== null && auth.uid === $uid", ".read": "auth !== null && auth.uid === $uid" } } } } I am using anonymous auth and "uid1" and "uid2" are nothing by auth.uid. I am

Firebase Restricting child/field access with security rules

I'm writing an app that allows users to submit nominations which are moderated before being displayed to other users. This requires a number of restrictions I've so far been unsuccessful in implementing with security rules: Hide any nominations that haven't been approved yet Hide private fields from submission (phone, approval status, creation date etc.) My current rules are as follows: { "rules": { "nominations": { ".read": true, "$nominationId": {

Redirect Custom domain to specific firebase hosted app URL route with masking

I have a SPA hosted using firebase hosting. I currently have a custom domain connected to the app. i.e mycustomedomain.com directions users to myapp.firebaseapp.com . However I want to achieve now is redirect multiple custom domains to specific app url routes. while keeping the address in the url bar as the original customedomain i.e mycustomdomainB.com --> myapp.firebaseapp.com/routeB mycustomdomainC.com --> myapp.firebaseapp.com/routeC mycustomdomainD.com --> myapp.firebasea

RxJs Compose a list of Observables and then combine (Firebase)

I'm attempting to combine a list of observables, but haven't had luck with zip or other maps. What I want to do is get a list of Genres for a given Artist Id. I'm using firebase, so it's a nosql database. I have a 'genresPerArtist' list that is a list of Artist keys, and each Artist key has a list of Genre keys. Structure: { genresPerArtist: { artist1: { genre1: true, genre2: true, genre3: true }

Can't download file using google cloud storage and Cloud Functions for Firebase

I am having the opposite as this issue: issues deleting an image using Cloud Functions for Firebase and @google-cloud/storage (for the record, I have tried all things suggested there). Basically I have a known file path, then a cloud function triggered by a database event. I can initialise a bucket, get a file as well as its name, but then when I try and download it I get API Error: not found. Here is my code: module.exports = (orgID, reportID) => { const bucket = gcs.bucket("MY_PROJEC

Firebase add/link password to existing federated provider

I'm allowing user to Sign Up with Google, Facebook or Email. Follow this link I know how to link multiple auth provider to the same account but here is my scenario Let say an user create account with Google or Facebook but later(after his account created) he want to set password so he can login with email and password as well. I know how to link an email/password account with other federated provider(google, facebook) but not the other way. My only though is to create an new account with that

Error initialising firebase in golang app

I am using firebase go sdk (https://github.com/acoshift/go-firebase-admin) and have followed the docs to set up my app. But when I try to initialize the app with firebase.NewApp I get an error saying google: could not find default credentials. Can someone please help Here is the code snippet opt = option.WithCredentialsFile(viper.GetString("firebase")) app, err = firebase.NewApp(context.Background(), nil, opt) if err != nil { log.Fatalf("error initializing app: %v\n", err) }

Firebase database rules allowing to read deeper nodes by field

I have items for each user with privacy field (see structure below). I need use a rule, that allows to owner user read all his items, but another users could read only items with privacy > 0 (0 means private item). So please help me create this rules. My current rules doen't work, because it not allowing to read user's items using getReference("items/{userUid}").addChildEventListener in my Android app. root items {userUid} {itemUid} name: a privacy: 0 {itemUid}

Firebase How to remove Cloud Firestore field type specifiers when using REST API?

I totally made up the name "type specifiers." What I mean is the stringValue key in front of a value. Usually I would expect a more-standard response: "name" : "name_here". { "fields": { "name": { "stringValue": "name_here" } } } Is it possible to remove those when making a GET call? More importantly, it be nice to understand why it's structured like it is. Even for POST-ing data? The easy answer is probably because Cloud Firestore, unlike Realtime Database, needs to know the specif

Firebase create at timestamp

In firebase, once you've created several rows of your DB, is there a way that you can query the created at timestamp of a "row" based on the "id". I didn't explicitly store a timestamp and didn't know if there was a method that you could get that back from a query. Is is a part of the meta data?

Firebase Cloud Messaging Ignoring APNS key

I'm trying to send a notification to my device using the apns key as described here: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig. The push notification does arrive, but the title is not overridden. When I omit the notification key, the notification is only send (in the background) when I add the content_available: true option. This is what my body looks like: { "to" : <TOKEN>, "apns" : { "payload" : { "aps" : {

set FCM high-priority when using firebase-admin

I have the following code which uses firebase-admin to send messages using Firebase cloud messaging Message message = null; message = Message.builder().putData("From", fromTel).putData("To", toTel).putData("Text", text) .setToken(registrationToken).build(); String response = null; try { response = FirebaseMessaging.getInstance().sendAsync(message).get(); responseEntity = new ResponseEntity<String>(HttpStatus.ACCEPTED); } catch (InterruptedException | ExecutionExceptio

Firebase How to migrate collections from Mongodb to Cloud Firestore

We are currently running on MongoDB but are now interested in moving over to Cloud Firestore. We have not found any tools for such a task so our planned approach is to create a "schema aware" script that makes a special sequence of queries from the MongoDB, and for each document create a new entry in Firestore while creating a map between the old mongo _id and the newly assigned id in Firestore. These maps will be used in later queries in the sequence that need to make reference to other docum

Firebase Securely saving data in Firestore

The Firestore documentation shows examples of how to secure data using Firestore security rules based on the request.auth.uid field. These typically look something like this: service cloud.firestore { match /databases/{database}/documents { match /stories/{storyid} { // Only the authenticated user who authored the document can read or write allow read, write: if request.auth.uid == resource.data.author; } } } That makes perfect sense. What I don't understand (and does

Firebase FCM — portability to plain Web Push protocol?

I would like to build push notifications on top of [Firebase Cloud Messaging][1, to benefit from sending to multiple subscribers at the same time. This implies a Google account and a Firebase project to be created. But I would like the ability to convert the platform to usage of plain Push API. The difference is that the later does not require a Google account, but it does require authentication with the push service by signing requests with VAPID keys. The browser gives you a subscription lik

how to know the provider of firebase authentication in a cloud function

I am using firebase cloud functions to send welcome email to users when they creates new accounts to the app. I need to send this welcome email only if the user creates its email using emailAndPassword authentication so I need to know the authentication provider of the user. This is my code now : const gmailEmail = functions.config().gmail.email; const gmailPassword = functions.config().gmail.password; const mailTransport = nodemailer.createTransport({ service: 'gmail', auth: { use

Firebase response payload different from documentation

I'm using firebase auth rest API for practice, and looking in the docs, the expected response from the https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=[API_KEY] should be: { "kind": "identitytoolkit#VerifyPasswordResponse", "localId": "ZY1rJK0eYLg...", "email": "[user@example.com]", "displayName": "", "idToken": "[ID_TOKEN]", "registered": true, "refreshToken": "[REFRESH_TOKEN]", "expiresIn": "3600" } But in my responses I'm only g

Firebase Maximum amount of batch deletes in Firestore

I'm trying to find out if the 500 amount mentioned in the batched writes section applies to delete as well? Looked through Usage and Limits, nothing mentioned there. Can anyone let us know if there's any limit to that kind of operation ?

Update table data in angular 6 site without refreshing state when data update in firebase

I am developing angular 6 site. it's fetching data from firebase firestore and display on table. But if site is already load and I have fetch data and display on table after that If I delete or update record in firebase directly then Can I get that immediate reflection on web table Is it possible with observable of angular firebase like AngularFirestore ?

error in multiple uploads Vue / firebase (undefined or null reference)

The following code works perfectly, all photos are uploaded to the firebase storage normally, except I want to push the downloadURL to an array, it doesn't do that one as it sees it undefined or null reference! I have created the form like this: <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script> <form @submit.prevent="uploadImage" method="POST" enctype="multipart/form-data"> <b-form-file v-model="files" class="mb-3" accept="image/*"

Firebase How to send notification to a Topic

I want a code to send notification from one device to multiple devices on a specific topic and I want to show that notification on devices who subscribe to that topic? I will use firestore to store data and store tokens and also use Firebase messaging to send notifications

Espresso tests with mock location on Google Firebase Test Lab

I developed Android Espresso tests and I want to test some location changes in my app. I have tests that fail because they must run on a device located in national territory (Portugal).I mocked the location and I needed also to enable the application in the devs options using an ADB command: How to write Espresso Tests which are mocking GPS locations and use them in Google Testlab? and How to set Allow Mock Location on Android Device before executing AndroidTest with uiautomator and espresso? Ho

Error when saving Document to Firebase Cloud Database in Flutter

I have a database service which performs the following actions: class DatabaseService { final String uid; DatabaseService({this.uid}); //collection reference final CollectionReference userCollection = Firestore.instance.collection('users'); //USER METHODS //update user data Future updateUserData(String username, int colorData, String avatar) async { return await userCollection.document(uid).setData( { 'username': username, 'color': colorData, 'a

RangeError when querying for Document in Firebase

I'm trying to query for data in Firebase with the following method: static Future<QuerySnapshot> getUserData(String creatorId) { Future<QuerySnapshot> data = _firestore .collection('users') .where('creatorId', isEqualTo: creatorId) .getDocuments(); return data; } I'm then trying to access the data via this FutureBuilder: body: FutureBuilder( future: DatabaseService.getUserData(widget.ride.creatorId), //future: DatabaseService

Firebase Using user's Google account profile picture in Flutter app

Good day, I am currently using firebase/flutter to create an app where users can log in to proceed to the next page. My log in and firebase are all in working order, but an issue I'm having is being able to access the user's profile picture on the initial log in. The gif attached shows it better than I can explain, but basically when I log in the first time, the user image is not there, but if I exit and go back in (user still signed in) the picture is then loaded: Issue: User's profile pictu

Using Firebase realtime database indexes

My query: const query = ref.child(`/text_preview_user/${user_id}`).orderByChild('last_timestamp').limitToFirst(150); query .once("value") .then((snapshot) => { console.log(snapshot); const orderedPromise = new Promise((resolve, reject) => { let arr = []; snapshot.forEach(function (childSnapshot) { console.log(childSnapshot); arr.push(childSnapshot.val());

Pass environment variables to Firebase predeploy scripts fails silently

I am trying to run a npm build during my hosting pre-deploy script. If I was going to run the build from the command line, I can successfully run this: set NUXT_ENV_GCLOUD_PROJECT=whatever&&npm run build And that works just fine. But when I try the same in the following firebase.json file it simply skips the build: { "hosting": { "predeploy": ["set NUXT_ENV_GCLOUD_PROJECT=whatever&& npm run build"], } } > firebase deploy --only hosting === Deploying to 'xxx'...

Flutter Firebase Storage : no auth token for request

I have been trying to upload an image to the Firebase Storage while using the Image_Picker. When I want to upload the image(imageFile) to Firebase Storage Future uploadFile() async { StorageReference storageReference = storage.ref().child('profile/${Path.basename(imageFile.path)}}'); print('uploading..'); StorageUploadTask uploadTask = storageReference.putFile(imageFile); //waiting for the image to upload await uploadTask.onComplete; print('File Uploaded');

Firebase Firestore batch commits: are the batch's instructions executed in the specified order?

I am working on a like/unlike system of posts based on Firestore and Cloud Functions. Currently, I'm setting up a Cloud Function that will be executed when the app user takes a look to the list of posts. This Cloud Function's aim is to count the number of likes of each post, sum up the number of likes of each post of the same post owner, and saves in database the number of likes of all the posts of each post owner into the post owner document. So: I iterate over all my users documents, and se

Firebase Google Tasks Api - Error: 3 INVALID_ARGUMENT: Request contains an invalid argument

I've written the below code to create a task whenever a new item is added to a collection in the firestore. import * as functions from 'firebase-functions' import * as admin from 'firebase-admin' const { CloudTasksClient } = require('@google-cloud/tasks') exports.moveActivityFromPlanToRecord = () => functions .region('europe-west1') .firestore.document('Users/{userId}/Activities/{activityId}') .onCreate(async snapshot => { const moveTime = snapshot.data()

Firebase Query (Sort) field Firestore KOTLIN

I try query(Sort) one of my fields in Firestore by input a value from a spinner, But I doesn't get it work. Should I use "whereEqualTo" or "orderBy"? Here is my code: override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { firestoreDB.collection("posts") .whereEqualTo("genre", position) .get().addOnSuccessListener { println(it.documents) } val type =

Firebase Best strategy for a Firestore database for municipalities

Here in Italy the land is politically divided into regions, provinces and municipalities. For example I live in the city of Varazze, whose province is Savona, in the region of Liguria. I created a Firestore database that accepts businesses whose addresses are composed like the example up here. Nothing difficult as I use an external service which give me consistent and correct geo data. The rest of the information for the business is entered by the user. Now I need to search into this db of bus

Firebase how to add multiple document to firestore after launching the app to the app store?

I am working on my very first flutter app, and I was wondering what are the possible ways to add multiple documents to the cloud firestore after launching the app to the app store? I know that I can do it manually on the firestore but the question is, can I do it using the source code of my app? or is there another way? Currently, I used this way to add products: Future<void> addBsBooks() async { try { _products.forEach( (book) { productsCollection.add(

Can Firebase users created without a password still sign in?

In a scenario where a new Firebase user is created without a password, could the user sign in using just their email address (passing a null/empty string as the password)? Or does Firebase reject all attempts to authenticate with email + password when no password is specified in the user auth object? The Firebase Admin SDK docs are clear that password is an optional property for createUser(), but the Password Authentication docs don't appear to specify Firebase's behavior when the user wa

Firebase Flutter - The instance member 'remoteConfig' can't be accessed in an initializer

I am trying to call a remoteConfig string inside my List class HomeModel { final RemoteConfig remoteConfig; //HomeModel() is called in Home() and fetches the param from there HomeModel({this.remoteConfig}); List taskList = [ { 'title': 'Hello', 'url': remoteConfig.getString(''), }, ]; } However, it shows me the error - The instance member 'remoteConfig' can't be accessed in an initializer

Flutter: Try to read Firestore data from Firebase emulator, but still reading from Firebase console

I run the Firebase emulator by having imported my collections: firebase emulators:start --import prod-data However, the data I receive is from the Firebase console and not from my emulator. I changed the host in the settings before making my request. FirebaseFirestore.instance.settings = Settings( host: "http://127.0.0.1:8080", sslEnabled: false, persistenceEnabled: false, ); try { List<Product> products = List<Product>(); QuerySnapsh

Firebase Allow only a particular use to create, update and delete the record in Firestore

I am working on a webapp, in which user can authenticate and write quotes. Can anyone help me by advising appropriate rule combination to write in firestore so that the a particular user who has written the quote can only delete/update that and not anyone. Here is the hierarchy of file structure. ,and here is what i am using right now, it's working fine for allquotes collection but not for userQuotes. service cloud.firestore { match /databases/{database}/documents { match /allquotes/{data

Firebase React native notification push using strapi

I’m developing an application using react native, and I’m going to deal with the push notifications. So I was looking for some information and tutorials but there is none ressources about sending notifications push using strapi, all the ressources are with th following stack : “Expo + firebase + React Native”. So I have some questions : Is it possible to send push notifications using strapi ? Is it possible to send push notifications using firebase even if I'm using strapi ? Do I have to do somt

Firebase How to structure a like query in Firestore?

I'm building a simple application where posts appear on a user's home page and he can like or unlike them. first when there were no users in the applications, I made a simple boolean field "liked", as shown in the figure, to determine if a post is liked or un-liked. However, when I started working with users, I find it hard to find the perfect structure for the likes field. In Firestore, I added a field named "likedBy" for each post, which contains a map with a key of each us

firebase get some data using where

This is my firebase each group of documents added by different user I want to get the documents based in the userId filed I sored that filed in id variable and that is my code the condition is not working, it gets me all documents in glucose collection stream: FirebaseFirestore.instance .collection('glucose') .where('userId', isEqualTo: id) .snapshots(), builder: (BuildContext context, AsyncSnapshot<QuerySnapshot>

Is there any way to configure firebase functions?

I need you guidance anyone can spare few minutes to help me out ? I need to clone https://github.com/ketanchoyal/Our-E-School this open source flutter project but I don't know how to set up firebase functions please guide me how to setup this project.

  1    2   3   4   5   6  ... 下一页 最后一页 共 97 页