firebase-php | Firebase PHP Client - Based on the Firebase REST API | Authentication library
kandi X-RAY | firebase-php Summary
kandi X-RAY | firebase-php Summary
Based on the Firebase REST API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get the curl handler .
- Write data to the given path .
- Get JSON path .
- Sets the base URI
- Send DELETE request .
- Get the set response .
- Get the get response .
- Get the delete response .
- Sets the expected response .
firebase-php Key Features
firebase-php Examples and Code Snippets
Community Discussions
Trending Discussions on firebase-php
QUESTION
I have been unable to find any official FCM documentation that explains the correct syntax for constructing the condtion string passed to FCM in order to send targeted pushes. I am using the excellent Firebase Admin SDK for PHP with which I can target outgoing message recipients like so
...ANSWER
Answered 2021-May-26 at 14:37The best I know of the documentation on sending messages to topics, which contains this section on conditions:
To send a message to a combination of topics, specify a condition, which is a boolean expression that specifies the target topics. For example, the following condition will send messages to devices that are subscribed to
TopicA
and eitherTopicB
orTopicC
:
QUESTION
I'm using the firabase-php(https://github.com/kreait/firebase-php) library to push notifications to multiple devices with flutter.
I have followed the following document and it is working fine:
Now, I want to remove failed tokens from DB if any, but not sure how to get them. The above document is showing how to get message for each request. Is there a way to get failed token? Something like $failure->error()->getToken()?
...ANSWER
Answered 2021-May-18 at 09:35You can use the following methods:
QUESTION
I am trying to identify if I have set security rules in the users node like below
...ANSWER
Answered 2021-May-08 at 15:05Firebase Authentication code runs client-side, so in the browser or in the native app. The PHP code that you have runs on the server, where you can't sign in a user. The server-side code itself runs with administrative privileges, as you configure it with a service account.
If you are interacting with the database directly from the client-side code too, you'll want to include the JavaScript SDK in your client-side, and sign in the user there as shown in the documentation.
If you're interacting with the database from the server-side PHP code, that should already work as using a service account means your code bypasses the security rules. If this isn't working for you, please edit your question to show how you configure the SDK.
QUESTION
In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic
, UnsubscribeFromTopic
event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.
...ANSWER
Answered 2021-Jan-11 at 16:02There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.
QUESTION
Using php 7.2
...ANSWER
Answered 2020-Dec-17 at 14:30This seems to be a problem with the virtual box filesystem. I created an issue to composer and hopefully more insight will be gained.
https://github.com/composer/package-versions-deprecated/issues/21
QUESTION
I'm trying to use php with firebase, but I have this error when I'm trying to run the code.
Fatal error: Uncaught Error: Call to undefined method Kreait\Firebase\Factory::getDatabase() in C:\xampp\htdocs\table\includes\db.php on line 10
the db.php file:
ANSWER
Answered 2020-Dec-12 at 22:47You have installed v5.0.0 of the Firebase Admin SDK for PHP, but the tutorial you followed is for a 4.x version.
This is an issue that happens so often that it has its own section in the "Troubleshooting" section in the SDK's documentation.
With v5.x, the correct way to initialize a Firebase component is:
QUESTION
I am using this firebase PHP library
https://github.com/kreait/firebase-php
I have to filter data by keys from user
table.
ANSWER
Answered 2020-Dec-06 at 16:27The only way to get multiple (but not all) child nodes with a single request is with a query. But you can't pass multiple IDs in a query.
Simply put: Firebase Realtime Database does not support a WHERE $key IN [key1, key2, key3]
type query that you want to do here. You will have to perform a separate request for each ID.
QUESTION
I am stuck to multi filter data in firebase with php sdk
...ANSWER
Answered 2020-Nov-02 at 22:03This is not a limitation of the PHP SDK (or any other Firebase SDK) - Realtime Database queries only support sorting by one dimension. The SDK just saves you from making a request and getting an error or unexpected results.
If you need to sort by multiple dimensions, you either have to do it in your (PHP) code, or create a compound key/field in the database that you can sort by.
You could do the latter for example by introducing a new field in which the value is active_
or inactive_
.
Querying by this field in ascending order would give you the active users sorted by email first, followed by the inactive users sorted by email.
Querying by this field in descending order would give you the inactive users sorted by email first, followed by the active users sorted by email.
QUESTION
Recently without any code change except environmental variable in app.yaml, app engine deployments fails during cloud build process where it exceeds memory limit, and I can't understand where can I change it, or why it became a problem... I tried to set "gcp-build" to overwrite composer install command, but getting this error during cloud build:
...ANSWER
Answered 2020-Oct-30 at 02:15Since your deployed application already has a composer.lock
file generated from App Engine deployment and by default, App Engine caches fetched dependencies to reduce build times. It will prevents you from automatically getting the latest versions of your dependencies and you will encounter the error:
You are using an outdated version of Composer
To resolve the issue, run command composer install
locally to pin your dependencies to their current version and to have a composer.lock
and composer update
if composer.lock
is existing. Then deploy using the command 'gcloud beta app deploy --no-cache' to install an uncached version of the dependency.
QUESTION
How do I upload images to firebase cloud storage? The documentation gives only these methodes but no upload method. This is the documentation link https://firebase-php.readthedocs.io/en/stable/cloud-storage.html
...ANSWER
Answered 2020-Sep-14 at 10:07You can do something like this,
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install firebase-php
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page