firebase-realtime-database

Adding Firebase Admin SDK to Unity project

此生再无相见时 提交于 2021-02-11 07:43:54
问题 I'm new to Unity as well as to C# (real noob to C# and all the .NET stuff) and I want to use the Firebase Realtime Database in my Unity project. I was following the instructions on the Firebase docs to set things up, but after I created a new p12 file and added this code to my project void Start() { // Set these values before calling into the realtime database. FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://YOUR-FIREBASE-APP.firebaseio.com/"); FirebaseApp.DefaultInstance

Slow data loading from firebase causing “RangeError (index)”

此生再无相见时 提交于 2021-02-11 06:11:37
问题 Here i am trying to load image link from firebase into flutter app then passing it into image.network(). the data loading is taking time to load data so it is giving me following error: RangeError (index): Invalid value: Valid value range is empty: 1 but after 5 second the data is loaded successfully and printed in console but not displayed on screen. here is code to print data class _DataFetching extends State<MyHomePage> { List<eyes> allCriminals=eyes.allcriminals(); @override Widget build

(if, else) question check number equal or greater in Realtime database

可紊 提交于 2021-02-11 04:54:05
问题 How can I implement if-else to check if the value of the money field is equal or greater (pre defined value in code) checking on the Realtime database money field? Only after this verification runs the code? I did a web search but all the methods I have searched but none were successful in the implementation. ref.child("users").child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot ds :

How to access the object in the observable list

懵懂的女人 提交于 2021-02-11 04:53:48
问题 I'm building a quiz app. My idea is to show 1 question per page. How do I subscribe and get an object inside a list using Observable. Instead of using *ngFor which display all of my objects. Is there a way to access the object one by one inside the subscribe block. export class ExerciseFlashcardPage { questions: Observable < any > ; type: string; constructor( public navCtrl: NavController, public navParams: NavParams, public afd: AngularFireDatabase ) { this.type = this.navParams.get('data');

(if, else) question check number equal or greater in Realtime database

僤鯓⒐⒋嵵緔 提交于 2021-02-11 04:52:23
问题 How can I implement if-else to check if the value of the money field is equal or greater (pre defined value in code) checking on the Realtime database money field? Only after this verification runs the code? I did a web search but all the methods I have searched but none were successful in the implementation. ref.child("users").child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot ds :

Check whether the writing permission was accepted or denied

戏子无情 提交于 2021-02-10 17:57:44
问题 I am currently trying to implement a trading system for my unity android app using firebase. For that I have to check, if a player pressed the buy button for one trade, if the selected trade is still available in the firebase database. The way it is supposed to work is, that the player who wants to buy something checks in the corresponding trade, if the buyerId is still empty, and if so puts his own id in there. I've set up the firebase rules, so that the buyerId and buyerName can only be set

android-firebase childEventListener in service

假如想象 提交于 2021-02-10 17:35:11
问题 in my android application i am trying to implement childEventListener of firebase database even when the app is not active. means whenever the firebase db particular child has a new entry it should notify the user.. so till now i have done with this, i have declared service in manifest file as <service android:name=".ChildEventListener"/> then my ChildEventListener class is as follows public class ChildEventListener extends Service { FirebaseAuth auth; NotificationCompat.Builder builder;

android-firebase childEventListener in service

此生再无相见时 提交于 2021-02-10 17:34:45
问题 in my android application i am trying to implement childEventListener of firebase database even when the app is not active. means whenever the firebase db particular child has a new entry it should notify the user.. so till now i have done with this, i have declared service in manifest file as <service android:name=".ChildEventListener"/> then my ChildEventListener class is as follows public class ChildEventListener extends Service { FirebaseAuth auth; NotificationCompat.Builder builder;

Rule entries duplicates firebase not working

南笙酒味 提交于 2021-02-10 16:59:40
问题 I have an application in android that registers sellers, which have a unique email, I am storing them in firebase. Create a rule to not allow duplicates to be added but it does not seem to work. What am I doing wrong? { "rules": { ".read": true, ".write": true, "sellers": { "$seller": { "email": { ".write": "!data.exists()" } } } } } my method to add public void addSeller(Seller seller){ HashMap<String,Seller> map= new HashMap<>() ; String email = seller.getEmail().replace(".",","); map.put

Rule entries duplicates firebase not working

本秂侑毒 提交于 2021-02-10 16:59:32
问题 I have an application in android that registers sellers, which have a unique email, I am storing them in firebase. Create a rule to not allow duplicates to be added but it does not seem to work. What am I doing wrong? { "rules": { ".read": true, ".write": true, "sellers": { "$seller": { "email": { ".write": "!data.exists()" } } } } } my method to add public void addSeller(Seller seller){ HashMap<String,Seller> map= new HashMap<>() ; String email = seller.getEmail().replace(".",","); map.put