firebase

How to avoid loops when writing cloud functions?

给你一囗甜甜゛ 提交于 2021-02-16 13:33:15
问题 When writing event based cloud functions for firebase firestore it's common to update fields in the affected document, for example: When a document of users collection is updated a function will trigger, let's say we want to determine the user info state and we have a completeInfo: boolean property, the function will have to perform another update so that the trigger will fire again, if we don't use a flag like needsUpdate: boolean to determine if excecuting the function we will have an

How to know which offline data has been synced to firebase Realtime Database

扶醉桌前 提交于 2021-02-16 09:32:53
问题 I'm writing a chat application with the help of firebase.Here I have a problem , if the device is offline the data is stored in cache and when device is back online the cache will be synced , but how to know which data is synced and which not (User may have poor internet connection , so syncing may be delayed).How to notify user that message has been sent or sending , and that too we need to manage a huge list of messages Thank you! 回答1: There are two ways: Using a completion listener as

Conversion Tracking with Firebase Analytics and UTM on Android

拥有回忆 提交于 2021-02-16 05:29:48
问题 I need to implement conversion tracking on my android app using firebase analytics. In order to do that I will add some UTM parameters to my links, and that links will open a screen on my android app (using deep linking) and then I think I will need to send those parameters to Firebase. What I want to know is what is the right/common approach to do this? Should I parse the URL on opening the app, save the UTM parameters and send them later when a conversion occurs? How shold I send them to

Conversion Tracking with Firebase Analytics and UTM on Android

荒凉一梦 提交于 2021-02-16 05:28:16
问题 I need to implement conversion tracking on my android app using firebase analytics. In order to do that I will add some UTM parameters to my links, and that links will open a screen on my android app (using deep linking) and then I think I will need to send those parameters to Firebase. What I want to know is what is the right/common approach to do this? Should I parse the URL on opening the app, save the UTM parameters and send them later when a conversion occurs? How shold I send them to

Conversion Tracking with Firebase Analytics and UTM on Android

你说的曾经没有我的故事 提交于 2021-02-16 05:28:05
问题 I need to implement conversion tracking on my android app using firebase analytics. In order to do that I will add some UTM parameters to my links, and that links will open a screen on my android app (using deep linking) and then I think I will need to send those parameters to Firebase. What I want to know is what is the right/common approach to do this? Should I parse the URL on opening the app, save the UTM parameters and send them later when a conversion occurs? How shold I send them to

Firebase Auth Custom claims not propagating to client

我们两清 提交于 2021-02-16 05:19:11
问题 I have a user with UID 1 where the custom claims are set as, frompos=true I am setting new custom claims to this user from the ADMIN SDK for java the following way: Map<String,Object> claims = new HashMap<>(); claims.put("frompos",false); FirebaseAuth.getInstance().setCustomUserClaimsAsync("1", claims).get(10000, TimeUnit.MILLISECONDS); I print the claims on the server side to check if the claims are set: UserRecord user = FirebaseAuth.getInstance().getUserAsync("1").get(10000, TimeUnit

Firebase Auth Custom claims not propagating to client

对着背影说爱祢 提交于 2021-02-16 05:18:22
问题 I have a user with UID 1 where the custom claims are set as, frompos=true I am setting new custom claims to this user from the ADMIN SDK for java the following way: Map<String,Object> claims = new HashMap<>(); claims.put("frompos",false); FirebaseAuth.getInstance().setCustomUserClaimsAsync("1", claims).get(10000, TimeUnit.MILLISECONDS); I print the claims on the server side to check if the claims are set: UserRecord user = FirebaseAuth.getInstance().getUserAsync("1").get(10000, TimeUnit

How does .indexOn works with users and unique keys?

烂漫一生 提交于 2021-02-15 07:49:05
问题 I am confused with index rules in firebase. I have this database and I wanted to extract distance_traveled in battery_and_cables . The thing is, 1 is something like a userID set by the user itself so that will vary. I used this code in pyrebase to extract the distance_traveled db.child("mileage_maintenance").order_by_child("distance_traveled").get() but I get Index not defined, add ".indexOn": "distance_traveled", for path "/mileage_maintenance", to the rules This is my database: Any my rules

How does .indexOn works with users and unique keys?

て烟熏妆下的殇ゞ 提交于 2021-02-15 07:49:04
问题 I am confused with index rules in firebase. I have this database and I wanted to extract distance_traveled in battery_and_cables . The thing is, 1 is something like a userID set by the user itself so that will vary. I used this code in pyrebase to extract the distance_traveled db.child("mileage_maintenance").order_by_child("distance_traveled").get() but I get Index not defined, add ".indexOn": "distance_traveled", for path "/mileage_maintenance", to the rules This is my database: Any my rules

How does .indexOn works with users and unique keys?

 ̄綄美尐妖づ 提交于 2021-02-15 07:49:03
问题 I am confused with index rules in firebase. I have this database and I wanted to extract distance_traveled in battery_and_cables . The thing is, 1 is something like a userID set by the user itself so that will vary. I used this code in pyrebase to extract the distance_traveled db.child("mileage_maintenance").order_by_child("distance_traveled").get() but I get Index not defined, add ".indexOn": "distance_traveled", for path "/mileage_maintenance", to the rules This is my database: Any my rules