firebase

Angular 7 Guard redirection only works on double click

独自空忆成欢 提交于 2021-02-11 12:41:21
问题 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 {

Add Custom user Property through firebase function

柔情痞子 提交于 2021-02-11 12:33:14
问题 Currently in our realtime database, we have a planDetails node for each uid that has fields like startDate , endDate , planType . I want to track the number of users whose premium plan is active. I am trying to do this by making a firebase function that runs daily and updates a boolean custom user property, say isPremiumActive , to either true or false. I cannot just track the users who have purchased the premium plan because there are many who take the plan once and then don't renew it.

Running flutter web app locally without android studio

岁酱吖の 提交于 2021-02-11 12:31:54
问题 I have a flutter app using Firebase's cloud firestore. I've done the web build and running it on Chrome through Android Studio works well. I would like to share my web app progress to my client but don't want to host it (because it's not finished yet). Hence I'd like to find a way to run it locally the same way you can do it with Android Studio but without needing to install Android Studio (and hopefully not requiring to install flutter either), so that I can send the build file to my client

Download json file from firebase storage

懵懂的女人 提交于 2021-02-11 12:29:20
问题 Let me restate my question. I have a vue.js app that uploads a json file to a bucket in my firebase storage. I need to download the file to use in my app but when I try to download a json file from firebase storage I get a "Uncaught (in promise) undefined" error. What I would like to do is download the file back into an object to use in my app Here is my code to download and read the file: const storage = firebase.storage() const storageRef = storage.ref() const objectRef = storageRef.child(

Firestore use database/server time for query

允我心安 提交于 2021-02-11 12:29:01
问题 I have a collection in Firestore that contains a string for the next 365 days. It's effectively a codeword that our app needs to display on that particular day. We've noticed that if a user changes the date and comes back to the app, Firestore correctly returns the codeword for that day because our query uses today's date to query for the codeword. Previously, we had a bespoke API on a server that would fetch based on the server's time to ensure this couldn't happen. What would be the best

Can't pass null for argument 'pathString' in child()? This the error I'm getting when retrieving data from firebase

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-11 12:28:20
问题 I'm creating an app with firebase as a backend, First I got output but after few changes I did for intent then it shows like this, Can anyone help me to solve this error. I used if to check whether I'm getting data or not and It goes through that if condition still it shows null. Activity 1: public class centerActivity extends AppCompatActivity { RecyclerView recyclerView; ArrayList<data> mArrayList; FrontlistAdapter mAdapter; FirebaseRecyclerOptions<data> options; FirebaseDatabase database =

How can I wait for data before it is available - flutter

时光怂恿深爱的人放手 提交于 2021-02-11 12:28:01
问题 @override void didChangeDependencies() async { if (_isInit) { print('First stat'); final restaurant = await Provider.of<Restaurants>(context, listen: false) .fetchAndSetRestaurants(); print('test'); } _isInit = false; super.didChangeDependencies(); } bool showFavourites = false; @override Widget build(BuildContext context) { return Scaffold( //bottomNavigationBar: BottomNavBar(), appBar: homeAppBar(context), body: SingleChildScrollView( child: showFavourites ? Padding( padding: const

Firebase functions RangeError: Maximum call stack size exceeded

烈酒焚心 提交于 2021-02-11 12:26:42
问题 I have a Callable function that uploads an image and update Firestore and Storage accordingly. The function does what it should do. but I still get this error: Unhandled error RangeError: Maximum call stack size exceeded here is the function: export const uploadImageToStripe = functions.https.onCall(async (data, context) => { let businessDoc: DocumentSnapshot try { if (!fireStoreDB) { fireStoreDB = admin.firestore(); fireStoreDB.settings(settings); } businessDoc = await fireStoreDB.collection

Firebase functions RangeError: Maximum call stack size exceeded

天涯浪子 提交于 2021-02-11 12:26:05
问题 I have a Callable function that uploads an image and update Firestore and Storage accordingly. The function does what it should do. but I still get this error: Unhandled error RangeError: Maximum call stack size exceeded here is the function: export const uploadImageToStripe = functions.https.onCall(async (data, context) => { let businessDoc: DocumentSnapshot try { if (!fireStoreDB) { fireStoreDB = admin.firestore(); fireStoreDB.settings(settings); } businessDoc = await fireStoreDB.collection

Firebase Functions throw function with internal error [closed]

橙三吉。 提交于 2021-02-11 12:22:37
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . Improve this question I am developing a project under Firebase Hosting with Firebase Functions. Index.js: exports.simpleFunction = functions.https.onCall((data, context) => { return data; }); Index.html: var simpleFunction = firebase.functions().httpsCallable('simpleFunction'); simpleFunction("12")