firebase-realtime-database

Retrieve Data from Realtime Database with Action Callback

青春壹個敷衍的年華 提交于 2021-02-05 09:26:00
问题 I am trying to receive the JSON value from the Realtime Database of Firebase using Unity. I do the following: FirebaseDatabase.DefaultInstance .GetReference("Leaders").OrderByChild("score").GetValueAsync().ContinueWith(task => { if (task.IsFaulted) { Debug.LogError("error in reading LeaderBoard"); return; } else if (task.IsCompleted) { Debug.Log("Received values for Leaders."); string JsonLeaderBaord = task.Result.GetRawJsonValue(); callback(JsonLeaderBaord); } } }); Trying to Read the

How to display the countdown time for all users [closed]

旧街凉风 提交于 2021-02-05 07:46:24
问题 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 8 months ago . Improve this question I am building a flutter auction application, I am stuck at the countdown time of an auction product so I use firebase realtime database. I have to make sure all users see the countdown at the same time. Please help me whether it's just a keyword to search

Android - RecyclerView not working

风格不统一 提交于 2021-02-05 07:27:05
问题 I am trying to retrieve data from my Firebase database, but my screen is not showing anything. I don't see any errors so I don't know why nothing is happening. Can anyone spot any mistakes? I followed the FirebaseUI guide with some help from a stackoverflow member. The data should show the street and the user on the screen Fragment: public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_stopandmap,

VueJS - How to update component data from a function inside a method?

允我心安 提交于 2021-02-05 06:40:27
问题 I'm trying to do a search using Firebase. I have this in my VueJS Code. export default { data () { return { listings: [], searchData: { keyword: "" } } }, name: 'SearchScreen', components: { ValidationProvider, ValidationObserver }, firebase: { listings: listingsRef }, methods: { search () { console.log(this.searchData.keyword) listingsRef.orderByChild('location').equalTo(this.searchData.keyword).on('value', function (snapshot){ console.log(snapshot.val()) return{ listings: snapshot.val() } }

How to get a value once of a firebase database (Android)

情到浓时终转凉″ 提交于 2021-02-04 19:50:51
问题 I just started using firebase and I'm amazed of how simple are complex things, and how complex simple things can be. I need to check if a user exists in my Firebase database, and if exists, I need to get its key and value. I have the key and I try to find it in the DB by going to my user subtree and loking for a child with the same key (ID) DatabaseReference root_firebase = FirebaseDatabase.getInstance().getReference(); DatabaseReference users_firebase = root_firebase.child("Users");

getReference() vs. getChild()

时光毁灭记忆、已成空白 提交于 2021-02-04 17:41:08
问题 I was wondering what the difference between database.getReference("foo/bar/123") and database.getReference("foo").child("bar").child("123") is? I'm assuming that the later one will load the complete "foo" object whereas database.getReference("foo/bar/123") just loads the "123" object? Is my assumption correct or what is the correct / most efficient way to only load data of "123"? 回答1: The two are equivalent. You can inspect this manually this by printing the toString() format for both

Finding nearby latlng using firebase

て烟熏妆下的殇ゞ 提交于 2021-02-04 15:29:32
问题 -uniqueid1 latitude: 30.7188235 longitude: 76.810132 -uniqueid2 latitude: 30.7188235 longitude: 76.810132 there are 1000 such records in firebase , I want to find uniqueids closest to a specific long/lat.I started using startAt() and endAt() but no success.How do we implement conditional clause and multiple queries.The query me looking for is SELECT uniqueids from table where (lon-specific_lon)^2+(lat-specific_lat)^2<CONSTANT. 回答1: What you're looking for is part of Firebase's Geofire library

Finding nearby latlng using firebase

时光怂恿深爱的人放手 提交于 2021-02-04 15:27:28
问题 -uniqueid1 latitude: 30.7188235 longitude: 76.810132 -uniqueid2 latitude: 30.7188235 longitude: 76.810132 there are 1000 such records in firebase , I want to find uniqueids closest to a specific long/lat.I started using startAt() and endAt() but no success.How do we implement conditional clause and multiple queries.The query me looking for is SELECT uniqueids from table where (lon-specific_lon)^2+(lat-specific_lat)^2<CONSTANT. 回答1: What you're looking for is part of Firebase's Geofire library

Pagination in Flutter with Firebase Realtime Database

左心房为你撑大大i 提交于 2021-02-04 14:07:56
问题 I am trying to paginate in Flutter with firebase realtime databse. I have tried this in Firestore and it works fine there but I want this with realtime database. I am fetching data for the first time like this. Widget buildListMessage() { return Flexible( child: StreamBuilder( stream: _firebase.firebaseDB .reference() .child("chats") .child("nsbcalculator") .orderByChild('timestamp') .limitToFirst(15) .onValue, builder: (context, AsyncSnapshot<Event> snapshot) { if (!snapshot.hasData) {

Firebase Database points to wrong database URL

守給你的承諾、 提交于 2021-02-04 08:34:07
问题 I am working on an Android app and trying to use Firebase Database. I tried to write data to the Database but nothing was showing up (checked via Firebase console). I have Firebase libraries in the build: implementation platform('com.google.firebase:firebase-bom:26.2.0') implementation 'com.google.firebase:firebase-database' My Firebase Database URL as per Firebease console is : https://xxxxxxxx-xxxxxxx-default-rtdb.europe-west1.firebasedatabase.app/ whereas when I get a reference to it from