firebase-realtime-database

Firebase Storage: Using Download Url Instead of Storage Ref

谁说我不能喝 提交于 2020-05-15 04:59:20
问题 I have an iOS app that uses Firebase Storage for storing images. After an image is uploaded I save its storage reference in my Firebase Database . When the app loads, it fetches various storage references from the database and uses the FirebaseUI method to display their corresponding images like so: let storageRef = Storage.storage().reference(forURL: imageUrl) imageView.sd_setImage(with: storageRef, placeholderImage: nil) This works great... but its very slow. While looking for solutions to

When does it make sense to use Firebase realtime DB and Firestore together? [closed]

醉酒当歌 提交于 2020-05-14 09:13:31
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 20 days ago . Is there any situation where it makes sense to use both realtime and firestore in conjunction? What situations lend themselves more favorably to firebase realtime vs firestore, or a combination? I keep reading about horror stories of people getting hit with huge costs is there

Why we need an empty Constructor to passing/save a Data From Firebase?

十年热恋 提交于 2020-05-13 18:06:35
问题 maybe this question little bit easy, but I don't get any idea why we need an empty constructor to passing a data from Firebase. Here is an example for the code: public class Hero{ String Name, Weapon, Description, Price, Discount, Id; public Hero() { } public Hero(String name, String weapon, String description, String price, String discount, String id) { Name = name; Weapon= weapon; Description = description; Price= price; Discount = discount; Id= id; }} then we need a getter and setter for

Why we need an empty Constructor to passing/save a Data From Firebase?

丶灬走出姿态 提交于 2020-05-13 18:06:35
问题 maybe this question little bit easy, but I don't get any idea why we need an empty constructor to passing a data from Firebase. Here is an example for the code: public class Hero{ String Name, Weapon, Description, Price, Discount, Id; public Hero() { } public Hero(String name, String weapon, String description, String price, String discount, String id) { Name = name; Weapon= weapon; Description = description; Price= price; Discount = discount; Id= id; }} then we need a getter and setter for

How do I get specific values from a datasnapshot in flutter?

ε祈祈猫儿з 提交于 2020-05-13 04:54:06
问题 I have this datasnapshot "{post1: {pic: https://i.redd.it/ni6zhxh874011.jpg, title: title, desc: desc}, post2: {pic: https://i.redd.it/krj9miojg5011.jpg, title: awsdas, desc: desc2}}" and I would like to retrieve the "pic" values from each post. snapshot.value["pic"] does not work it returns null. thanks in advance this is how I recieved the datasnapshot for my future builder Future<Object> _obj ()async { Object _objdatabase; await FirebaseDatabase.instance.reference().child("Communities")

How to get class of generic type parameter in Kotlin

99封情书 提交于 2020-05-11 07:40:22
问题 I would like get the class property from a generic type T . I've decided to extend to Any but I'm getting an error. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html#extension-properties I have the following code: class FirebaseDBRepo<T : Any>(val child:String) { private var callback: FirebaseDatabaseRepositoryCallback<T>? = null private val ref: DatabaseReference private val listener = object : ValueEventListener { override fun onDataChange(dataSnapshot: DataSnapshot) { //T

What is the exact size of a Firestore document?

僤鯓⒐⒋嵵緔 提交于 2020-05-09 16:15:55
问题 The docs says that the size of a document is composed of: document name size The sum of the string size of each field name The sum of the size of each field value 32 additional bytes The following document example: "type": "Personal" "done": false "priority": 1 "description": "Learn Cloud Firestore" Has the size of 147 . Question: When calculating the size of a document, is there anything else I should care of? Perhaps some metadata? Because when using this calculation, there's for sure

Generate parent UID for registration with google auth android studio firebase [closed]

北城余情 提交于 2020-05-09 06:36:31
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month . I need help how can I use user model. when creating the account instead of generating the parent node with email. make the main node the uid. I tried some modifications but I was not successful someone could help me. the account is created by google auth wanted that instead of email it would

Generate parent UID for registration with google auth android studio firebase [closed]

荒凉一梦 提交于 2020-05-09 06:36:06
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month . I need help how can I use user model. when creating the account instead of generating the parent node with email. make the main node the uid. I tried some modifications but I was not successful someone could help me. the account is created by google auth wanted that instead of email it would

how to handle callback using kotlin coroutines

て烟熏妆下的殇ゞ 提交于 2020-05-08 04:06:06
问题 the following snippet returns the result as 'null' on sequential code flow. I understand coroutines could be a viable solution to handle the callback asynchronously. fun getUserProperty(path: String): String? { var result: String? = null database.child(KEY_USERS).child(getUid()).child(path) .addListenerForSingleValueEvent(object : ValueEventListener { override fun onCancelled(error: DatabaseError) { Log.e(TAG, "error: $error") } override fun onDataChange(snapshot: DataSnapshot) { Log.w(TAG,