firebase-realtime-database

Access url without token in Firebase Storage

六眼飞鱼酱① 提交于 2020-07-17 06:55:30
问题 I have a firebase storage download url, like https://firebasestorage.googleapis.com/v0/b/siren-5eee7.appspot.com/o/profile%2FC6jNlR0F4cZBPv7wF0REWUNVor33?alt=media&token=63a9130e-2ba6-4f38-ac3f-2231c54a1043 How can I access this url without token parameter? For example, If I access above url without token there will be 403 error showing permisson denied. My firebase storage secure rule is below : service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read, write: if

How to connect Laravel to Firebase

此生再无相见时 提交于 2020-07-16 10:38:11
问题 I am using Laravel and Firebase. I need to connect Laravel to Firebase, but I am facing this error: Call to undefined method Kreait\Firebase\Factory::getDatabase() <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Kreait\Firebase; use Kreait\Firebase\Factory; class FirebaseController extends Controller { public function index() { $factory = (new Factory()) ->withDatabaseUri('https://posts-ba088.firebaseio.com/'); $datebase = $factory->getDatabase(); $ref = $datebase-

Send notification from device to another with firebase in Android [duplicate]

别等时光非礼了梦想. 提交于 2020-07-16 10:33:30
问题 This question already has answers here : How to send one to one message using Firebase Messaging (5 answers) How to send Device to device notification by using FCM without using XMPP or any other script.? (3 answers) Closed yesterday . I build an application that book lessons, in the application there are student account and teacher account. So I need when the student book the lesson then the teacher receive a notification with the details of the lesson. I use Firebase Realtime database to

Swift Firebase Get childByAutoId Key When Setting

拟墨画扇 提交于 2020-07-16 08:07:53
问题 I would like to obtain the .childByAutoId() key value while I am setting a firebase value. Is this possible to do or do I have to recall firebase again to retrieve it? ref.child("users").child(user.id).child("alerts").childByAutoId().setValue(["autoID" : .childByAutoIdValue]) For Example: I need the AutoId that it generates but would like to obtain it while setting a firebase value. let keyValue = ref.childByAutoId.key //Completley wrong but to better understand what im trying to do *Update:

Swift Firebase Get childByAutoId Key When Setting

房东的猫 提交于 2020-07-16 08:07:11
问题 I would like to obtain the .childByAutoId() key value while I am setting a firebase value. Is this possible to do or do I have to recall firebase again to retrieve it? ref.child("users").child(user.id).child("alerts").childByAutoId().setValue(["autoID" : .childByAutoIdValue]) For Example: I need the AutoId that it generates but would like to obtain it while setting a firebase value. let keyValue = ref.childByAutoId.key //Completley wrong but to better understand what im trying to do *Update:

Not able to print all childs from my firebase database

你。 提交于 2020-07-16 08:00:07
问题 I want to print all dates(childs) details from 5th of july to 7th of july from my database but i only get top date(child)[7th july] as my output instead of all of the child nodes** Here is my reference where i get values from database and put into RecyclerView adapter DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Dateinfo").child(firebaseUser.getUid()); reference.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull

Flutter sort Firebase snapshot by timestamp

风流意气都作罢 提交于 2020-07-16 02:43:47
问题 I'm trying to sort snapshot by timestamp but returns original order. data structure looks like this I have two snapshot and timestamps are -1536025466539 and -1536025893015 . So, I expect -1536025893015 to come first after sorted. Does anyone know how to sort correctly? Code: Map<dynamic, dynamic> map = snapshot.data?.snapshot?.value; map.values.toList().sort((a, b) { return a['timestamp'].compareTo(b['timestamp']); // also not work return b['timestamp'].compareTo(a['timestamp']); }); 回答1:

Restrict Firebase authentication to a certain domain

橙三吉。 提交于 2020-07-15 08:19:12
问题 I want to restrict the Firebase Authentication only by ne mail domain name, to make this mail access to my application : exemple@exemple.fr I did this in the database side of firebase { "rules": { ".read": "auth.token.email.endsWith('@exemple.fr')", ".write": "auth.token.email.endsWith('@exemple.fr')" } } I think i'm doing something wrong, thank you for your help. 回答1: Try this { "rules": { ".read": "auth.token.email.matches(/.*@exemple.fr$/)", ".write": "auth.token.email.matches(/.*@exemple

Restrict Firebase authentication to a certain domain

ⅰ亾dé卋堺 提交于 2020-07-15 08:17:01
问题 I want to restrict the Firebase Authentication only by ne mail domain name, to make this mail access to my application : exemple@exemple.fr I did this in the database side of firebase { "rules": { ".read": "auth.token.email.endsWith('@exemple.fr')", ".write": "auth.token.email.endsWith('@exemple.fr')" } } I think i'm doing something wrong, thank you for your help. 回答1: Try this { "rules": { ".read": "auth.token.email.matches(/.*@exemple.fr$/)", ".write": "auth.token.email.matches(/.*@exemple

Firebase queries not working on Android even though the reference retrieves data

我怕爱的太早我们不能终老 提交于 2020-07-11 06:51:05
问题 I am trying to filter my Firebase data, my dataset is complex but here is a sample. I am able to retrieve data just fine but I am unable to filter that data any further using the Firebase queries. Here is a sample dataset: Here is my query: private double locStart; private double locEnd; Firebase mRef; Firebase mRef1; mRef = new Firebase("https://test.firebaseio.com/"); mRef1 = mRef.child("test"); final Intent intent = getIntent(); final Inputs inputs = (Inputs) intent.getSerializableExtra(