firebase-php | Unofficial Firebase Admin SDK for PHP | Authentication library

 by   kreait PHP Version: 5.26.5 License: MIT

kandi X-RAY | firebase-php Summary

kandi X-RAY | firebase-php Summary

firebase-php is a PHP library typically used in Security, Authentication, Firebase applications. firebase-php has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Firebase provides the tools and infrastructure you need to develop your app, grow your user base, and earn money. The Firebase Admin PHP SDK enables access to Firebase services from privileged environments (such as servers or cloud) in PHP. For more information, visit the Firebase Admin PHP SDK documentation.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              firebase-php has a medium active ecosystem.
              It has 1943 star(s) with 397 fork(s). There are 38 watchers for this library.
              There were 4 major release(s) in the last 12 months.
              There are 10 open issues and 486 have been closed. On average issues are closed in 15 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of firebase-php is 5.26.5

            kandi-Quality Quality

              firebase-php has 0 bugs and 0 code smells.

            kandi-Security Security

              firebase-php has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              firebase-php code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              firebase-php is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              firebase-php releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              firebase-php saves you 4061 person hours of effort in developing the same functionality from scratch.
              It has 9137 lines of code, 1062 functions and 220 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed firebase-php and discovered the below as its top functions. This is intended to give you an instant insight into firebase-php implemented functionality, and help decide if they suit your requirements.
            • Convert a DateTimeImmutable to a DateTimeImmutable instance .
            • Create a new Database from a URI .
            • Creates a new exception for the given token .
            • Log request to a given logger .
            • Get the error reason from the response .
            • Creates an exception for a missing project ID .
            • Validate the child key .
            • Decodes a JSON string .
            • Trigger a deprecated error message .
            • Modify value .
            Get all kandi verified functions for this library.

            firebase-php Key Features

            No Key Features are available at this moment for firebase-php.

            firebase-php Examples and Code Snippets

            No Code Snippets are available at this moment for firebase-php.

            Community Discussions

            QUESTION

            Remove multiple data from firebase
            Asked 2021-Nov-09 at 00:16

            I uses a wrap of kreait/firebase-php for processing needed requests. I need to realize removing old data, but them too much for removing data one by one entry. How I can to remove multiple data by one request? this is an example of my current code:

            ...

            ANSWER

            Answered 2021-Nov-09 at 00:16

            Assuming you are asking about Firebase's Realtime Database, you can send a multi-path update request with the values for each key set to null to remove a lot of nodes in one go.

            Source https://stackoverflow.com/questions/69891062

            QUESTION

            FCM Target condition syntax
            Asked 2021-May-26 at 14:37

            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:37

            The 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 either TopicB or TopicC:

            Source https://stackoverflow.com/questions/67706326

            QUESTION

            How to get failed token in firebase-php?
            Asked 2021-May-18 at 15:05

            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:

            https://firebase-php.readthedocs.io/en/stable/cloud-messaging.html#send-messages-to-multiple-devices-multicast

            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:35

            QUESTION

            PHP- No option to authenticate user in firebase-php
            Asked 2021-May-08 at 15:05

            I am trying to identify if I have set security rules in the users node like below

            ...

            ANSWER

            Answered 2021-May-08 at 15:05

            Firebase 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.

            Source https://stackoverflow.com/questions/67447136

            QUESTION

            Assigning webhooks to Firebase Messaging "subscribe to topic" event
            Asked 2021-Jan-11 at 16:02

            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:02

            There 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.

            Source https://stackoverflow.com/questions/65665600

            QUESTION

            Composer 2.0.8 issue package-versions-deprecated
            Asked 2020-Dec-17 at 14:30

            Using php 7.2

            ...

            ANSWER

            Answered 2020-Dec-17 at 14:30

            This 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

            Source https://stackoverflow.com/questions/65149298

            QUESTION

            Fatal error: Uncaught Error: Call to undefined method Kreait\Firebase\Factory::getDatabase()
            Asked 2020-Dec-12 at 22:47

            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:47

            You 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:

            Source https://stackoverflow.com/questions/65262656

            QUESTION

            Firebase query filter multiple keys by array contain in PHP?
            Asked 2020-Dec-06 at 16:27

            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:27

            The 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.

            Source https://stackoverflow.com/questions/65165908

            QUESTION

            firebase php sdk not supported multi filter data
            Asked 2020-Nov-02 at 22:03

            I am stuck to multi filter data in firebase with php sdk

            ...

            ANSWER

            Answered 2020-Nov-02 at 22:03

            This 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.

            Source https://stackoverflow.com/questions/64635213

            QUESTION

            App Engine deploy composer memory limit exceeded
            Asked 2020-Oct-30 at 02:15

            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:15

            Since 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.

            Source https://stackoverflow.com/questions/64581867

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install firebase-php

            The Firebase Admin PHP SDK is available on Packagist as kreait/firebase-php:.
            kreait/laravel-firebase
            kreait/firebase-bundle

            Support

            Authentication GuideCloud Messaging GuideCloud Storage GuideDynamic Links GuideFirestore GuideRealtime Database GuideRemote Config Guide
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/kreait/firebase-php.git

          • CLI

            gh repo clone kreait/firebase-php

          • sshUrl

            git@github.com:kreait/firebase-php.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link