firebase

ASP.NET FirebaseAdmin fails to initilize - System.MissingFieldException

谁说胖子不能爱 提交于 2021-02-11 13:18:43
问题 I have an ASP.NET ( Web API ) project, I added FirebaseAdmin to the project but it fails to initialize when calling the method FirebaseMessaging m = FirebaseMessaging.GetMessaging(App); Same steps on a new Windows Forms project work just fine, and was able to deliver the message. An exception of type 'System.MissingFieldException' occurred in FirebaseAdmin.dll but was not handled in user code Additional information: Field not found: 'Initializer.DefaultHandleUnsuccessfulResponseFunc'. Used

Trouble with generating PDF file to upload to firebase

房东的猫 提交于 2021-02-11 13:11:15
问题 I'm learning about puppeteer and firebase at the moment. What I am trying to do is create a pdf of a web page and upload to firebase storage. This is my code. const puppeteer = require('puppeteer'); const fs = require('fs').promises; const firebase = require('firebase'); require("firebase/storage"); const url = process.argv[2]; if (!url) { throw "Please provide URL as a first argument"; } var firebaseConfig = { #Firebase Config Goes here }; // Initialize Firebase firebase.initializeApp

Firebase Firestore security rules - read all nested docs based on resource (but it's null)

别说谁变了你拦得住时间么 提交于 2021-02-11 13:05:35
问题 I think I'm doing something wrong but I can't figure which part... Thanks for all the clarification I can get. So I have a collection named Bases that looks like this: { "id1": { "name": "My base 1", "roles": { "idUser_123": { "name": "John" } } }, "id2": { "name": "My base 2", "roles": { "idUser_456": { "name": "Jane" } } } } idUser_123 log in and want to access his collection. So I do: db.collection('bases').get() And I use a match rule to make sure John is not reading Jane's bases. And

Firestore with complex filter and composite indexes

ε祈祈猫儿з 提交于 2021-02-11 12:51:46
问题 I use Cloud Firestore and this is my data structure : Firestore-root | --- collection (collection) | --- uid (document) | --- name: some_name | --- some_fields: some_data | --- origin: [origin_1, origine_2, ...] <- List | --- category: [category_1, category_2, ...] <- List | --- meals: [meals_1, meals_2, ...] <- List | --- some_other_filters: [.....] <- List | --- all_categories: [origin_1:true, origine_2:true, meals_1:true, ....] I created the Map field all_categories to hold all different

Save and retrieve data from firebase database Android

Deadly 提交于 2021-02-11 12:50:32
问题 I'm working on a project where I have to do a custom "tour/trip" based on the locations the user chooses on the map. and every tour has a title, with the locations that he chose. say for example he made a tour(list) and called it 'Tour 1' and in this 'Tour 1' first he wants to go to the hotel, and then to KFC, and then to the beach. I'm at the point where I made a list and gave it a title, but can't show the places that I planned to go in the activity, here is a screenshot of the activity

Save and retrieve data from firebase database Android

痞子三分冷 提交于 2021-02-11 12:50:02
问题 I'm working on a project where I have to do a custom "tour/trip" based on the locations the user chooses on the map. and every tour has a title, with the locations that he chose. say for example he made a tour(list) and called it 'Tour 1' and in this 'Tour 1' first he wants to go to the hotel, and then to KFC, and then to the beach. I'm at the point where I made a list and gave it a title, but can't show the places that I planned to go in the activity, here is a screenshot of the activity

Android: Firebase realtime database updated when app destroyed

不羁的心 提交于 2021-02-11 12:49:04
问题 I'm new to firebase realtime database, and have a basic question I cannot seem to find the answer to. I need my Android app to keep track of changes in the database, so I understand I need to use addValueEventListener, with the onDataChange method. However will the method onDataChange, be called even if the app is destroyed? I need to be able to access the changes of the information in the database even if the app isn't running in the background, (for example the user force quits the app).

Get all doc data from collection seremon firestore

我的未来我决定 提交于 2021-02-11 12:48:58
问题 function Sermons() { const [{globalSeremon}, dispatch] = useStateValue() const [seremons, setSeremons] = useState([]) const [loading, setLoading] = useState(false) useEffect(() => { db.collection('sermons') .orderBy("date", "desc") .get() .then((snapshot) => { const localseremons = [] snapshot.forEach(doc => { localseremons.push(doc.data()) }) setSeremons(localseremons) }) .catch(e => console.log(e)) }) return ( <div> <Header/> <div className='container-lg seremon_container'> {seremons.map

Trying to access FirestoreAdminClient from Cloud Run service using firebase-admin. ERROR: 7 PERMISSION_DENIED: The caller does not have permission

╄→尐↘猪︶ㄣ 提交于 2021-02-11 12:47:29
问题 I've got the following code for a an API endpoint that is supposed to trigger a Firestore backup using firebase-admin . This is how I'm initializing firebase-admin ; import * as admin from "firebase-admin"; admin.initializeApp({ credential: admin.credential.cert( SERVICE_ACCOUNT as admin.ServiceAccount )}); The service account key is a JSON I've downloaded using the default firebase-admin service account: This is the backup.ts API request handler. export const backupData: RequestHandler =

Angular 7 Guard redirection only works on double click

不打扰是莪最后的温柔 提交于 2021-02-11 12:41:50
问题 THe problem is that I've implemented a Guard, meant to work with a specific directory . It should return true if the role of the current username equals 2 . If it doesn't then it shouldnt redirect. THis is my app-routing-module.ts file , the problem is in the 'userlist' path, were we implement the [RoleGuard] canActivate import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { Routes, RouterModule, Router } from '@angular/router'; import {