google-cloud-firestore

How do I read and write a text file from firebase storage in Flutter?

帅比萌擦擦* 提交于 2021-02-05 08:40:49
问题 I need to make a storage for my saved images in firebase storage. Is there a way I can read and write to online text file on firebase storage in flutter? Is there any alternative to make my images storage? 回答1: It's so simple. Let's explain the solution with the example. import the library as following : import package:firebase_storage/firebase_storage.dart' as firebase_storage; Secondly, get the firebase reference by : firebase_storage.Reference ref = firebase_storage.FirebaseStorage

How to Store Credentials to Local Storage to Allow Firebase Auth to Sign-in

半城伤御伤魂 提交于 2021-02-05 08:35:30
问题 I'm working in an Angular 10 project, I am also using firebase hosting and cloud firestore (for DB). I am using AngularFire in my project as well. My project is already able to get documents from my firestore collection, and display them (also can edit, delete, and create them). I also set up authentication, where I use AngularFireAuth to sign in and sign out. I also have route guards to only allow users access to info after signing in. I've discovered that Firestore also has rules, and that

How to Store Credentials to Local Storage to Allow Firebase Auth to Sign-in

荒凉一梦 提交于 2021-02-05 08:34:47
问题 I'm working in an Angular 10 project, I am also using firebase hosting and cloud firestore (for DB). I am using AngularFire in my project as well. My project is already able to get documents from my firestore collection, and display them (also can edit, delete, and create them). I also set up authentication, where I use AngularFireAuth to sign in and sign out. I also have route guards to only allow users access to info after signing in. I've discovered that Firestore also has rules, and that

Firestore add security rule to allow reads only from mobile app [duplicate]

我的梦境 提交于 2021-02-05 08:30:35
问题 This question already has answers here : Is there any way to give everyone access to firestore database, but only via app? (1 answer) How can I set Rules in Firebase so that only my app can write on my database firestore? (1 answer) Closed 7 months ago . I am making a mobile app with Firestore and React Native. There is no authentication system and upon starting the app, the user download a collection from Firestore. rules_version = '2'; service cloud.firestore { match /databases/{database}

How to get download url for firebase storage and update firestore document?

自闭症网瘾萝莉.ら 提交于 2021-02-05 08:27:09
问题 I have been struggling to get download url for an image uploaded to firebase storage from my app. I want to send this url to firestore databse (not realtime database). I am setting itemImageUri to uri.toString() but in onCreate() method itemImageUrl is null and shows null in firestore. I cannot use CollectionRefernece addItemRef in onSuccess method as it gives error for all string variables: Variable is accessed from within inner class needs to be declared final. public class AddItemActivity

Pricing when updating more than one field of the same document within a Firestore transaction

让人想犯罪 __ 提交于 2021-02-05 08:15:26
问题 I have the following transaction using Firestore: mDb.runTransaction(new Transaction.Function<Void>() { @Override public Void apply(final Transaction transaction) throws FirebaseFirestoreException { DocumentReference documentReference = mDb.collection("collectionOne").document("documentOne"); /* some code */ transaction.update(documentReference, App.getResourses().getString(R.string.field_one), FieldValue.increment(1)); transaction.update(documentReference, App.getResourses().getString(R

Pricing when updating more than one field of the same document within a Firestore transaction

杀马特。学长 韩版系。学妹 提交于 2021-02-05 08:11:04
问题 I have the following transaction using Firestore: mDb.runTransaction(new Transaction.Function<Void>() { @Override public Void apply(final Transaction transaction) throws FirebaseFirestoreException { DocumentReference documentReference = mDb.collection("collectionOne").document("documentOne"); /* some code */ transaction.update(documentReference, App.getResourses().getString(R.string.field_one), FieldValue.increment(1)); transaction.update(documentReference, App.getResourses().getString(R

Is Firebase getDocument run line by line?

ε祈祈猫儿з 提交于 2021-02-05 08:01:30
问题 I'm a swift and Firebase beginner, I met a problem that confuses me a lot. We all know the following code var a = [Int]() for i in 0..2{ a.append(i) print(a) print(a) should give me the output [0] [0,1] [0,1,2] [0,1,2] And it is true as the result. However, when I work on getDocument(), and I write a similar logic code, the output is strange! The code is the following. override func viewDidLoad() { super.viewDidLoad() let docSecond = getThirtyData() getDataContent(thirtyData: docSecond) }

What is the best practice for a multi-tenant app with Collection Group Queries in Firestore?

試著忘記壹切 提交于 2021-02-05 07:58:26
问题 What is the best practice for multi-tenant app collection group queries? For example query all invoices for a tenant's customers /tenant/1/customer/2/invoices If I create a collection group index called invoices , and I want to ensure that I can get all invoices for tenant 1, how do I do this easily? I tried setting up some security rules to prevent from querying over the tenants but it still threw Access denied errors since it was still querying across tenants. What would the correct

Is Anonymous Authentication Enough?

北战南征 提交于 2021-02-05 07:56:08
问题 I'm developing an app that doesn't require logging in because there isn't any user-specific data. My original plan was to just make my entire database be read only. However, upon doing some research, I found that those security rules would leave my database very vulnerable. My new plan is to implement anonymous authentication for each new user that opens my app and then delete that user once they exit my app. The security rule would be just to allow reading if the user is authenticated. Is