firebase-realtime-database

After login, it display 'Unfortunately, app has stop'

大兔子大兔子 提交于 2021-01-27 20:57:12
问题 I tried to run my login page and suddenly it displays 'Unfortunately app has stop'. Here is my entire logcat stack trace. Any help would be much appreciated. 10-16 11:10:08.946 7285-7285/? I/art: Late-enabling -Xcheck:jni 10-16 11:10:09.022 7285-7285/? W/ResourceType: Found multiple library tables, ignoring... 10-16 11:10:09.028 7285-7285/? W/ResourceType: Found multiple library tables, ignoring... 10-16 11:10:09.036 7285-7285/? W/ResourceType: Found multiple library tables, ignoring... 10-16

How to delete specific record in firebase having specified Title

时光毁灭记忆、已成空白 提交于 2021-01-27 20:30:13
问题 I was using Firebase Database in Web App, and have data like this yet: How can i delete the entire record having "Apple" in title (marked in picture)? I wrote the below code but it's not working. Kindly Help. var abc = firebase.database().ref('firebase-test'); var key_to_delete = 'Apple'; var query = abc.orderByChild('KISNx87aYigsH3ILp0D').equalTo(key_to_delete); query.on('child_added', function(snapshot) { snapshot.ref.remove(); }); It's not giving me any error in Console. 回答1: You're

Firebase pagination in Android

主宰稳场 提交于 2021-01-27 20:24:40
问题 I am making a image posting app in which I want to fetch first five records and then when the user scrolls down to bottom next 5 records should be fetched automatically . I am ordering by "negative_time stamp" so that the latest post comes at the top . After fetching first 5 records from bottom i want the next five records . Please help . Thanks in Advance; I am using this query for fetching next five records ref_to_all_posts.orderByChild("negative_timestamp").startAt( neg_timeStamp)

How to avoid duplicate data in Firebase Database

牧云@^-^@ 提交于 2021-01-27 18:54:28
问题 In my Android application I am inserting a VideoEntity objects in firebase database this way: @Override protected void onCreate(Bundle savedInstanceState){ Log.d(TAG, " onCreate(Bundle) - Ini "); super.onCreate(savedInstanceState); database = FirebaseDatabase.getInstance(); String videoId = ""; for(VideoEntity video: videosList) { videoId = video.getId(); DatabaseReference mRef = database.getReference().child("Videos").push(); mRef.setValue(video); } this the VideoEntity class: package com

Failed to get FirebaseDatabase instance. Specify DatabaseURL within FirebaseApp

為{幸葍}努か 提交于 2021-01-27 18:50:27
问题 Application crashed when I call FirebaseDatabase database = FirebaseDatabase.getInstance(); Logs com.google.firebase.database.DatabaseException: Failed to get FirebaseDatabase instance: Specify DatabaseURL within FirebaseApp or from your getInstance() call. at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source) at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source) Firebase project configured correctly. Authentication works without issue, but cannot

Firebase Server Timestamp to Double iOS

霸气de小男生 提交于 2021-01-27 18:29:38
问题 ServerValue.timestamp() returns [AnyHashable : Any] . How to convert it to Double , so I could create a date with the timestamp. 回答1: That's not exactly how the Firebase timestamp works. What it actually does is writes a timestamp to a node but you don't have access to it until after the write. To get access to it, attach an observer to that node so when the timestamp is written, it will be returned in a snapshot. So first we define a var let kFirebaseServerValueTimestamp = [".sv":"timestamp"

Cant use getRef()?

时光总嘲笑我的痴心妄想 提交于 2021-01-27 18:02:48
问题 Can anyone explain why this is saying I can not use getRef to get the position that is being clicked? From everything I have looked up, this should work and for some reason it is not. public class DeleteChoiceListFragment extends Fragment { DatabaseReference mRootRef = FirebaseDatabase.getInstance().getReference(); DatabaseReference mRestReference = mRootRef.child("restaurants"); List<String> listofrest = new ArrayList<String>(); ListView restaurantListView; ListAdapter restaurantListAdapter;

Swift - Firebase observer on .childchanged is not being recognized

孤者浪人 提交于 2021-01-27 16:59:10
问题 Here is the code below, it will not get executed even if I change the child node called "tokens" in the Firebase via app or directly in Firebase!? handle = ref.child("Users").child(uid).child("tokens").observe(.childChanged, with: { snap in print("Changed Token Count: ", snap.value!) if snap.value is NSNull { // Child not found } else { if (currTokenCount < snap.value as! UInt) { print("Value increased....") } else { print("Value decreased....") } } }) { (error) in print(error

Swift - Firebase observer on .childchanged is not being recognized

↘锁芯ラ 提交于 2021-01-27 16:43:56
问题 Here is the code below, it will not get executed even if I change the child node called "tokens" in the Firebase via app or directly in Firebase!? handle = ref.child("Users").child(uid).child("tokens").observe(.childChanged, with: { snap in print("Changed Token Count: ", snap.value!) if snap.value is NSNull { // Child not found } else { if (currTokenCount < snap.value as! UInt) { print("Value increased....") } else { print("Value decreased....") } } }) { (error) in print(error

where to provide NSURL value?

只谈情不闲聊 提交于 2021-01-27 14:20:38
问题 Every time I run the app it crashes and the console says: Terminating app due to uncaught exception 'MissingDatabaseURL', reason: 'Failed to get FirebaseDatabase instance: Specify DatabaseURL within FIRApp or from your databaseForApp:URL: call. I have the URL I don't know where to place it. I am new to objective C. This is the line that firebase say to use I Just don't know where to place the value of url. + (FIRDatabase *)databaseForApp:(FIRApp *)app URL:(NSString *)url 回答1: It looks like