kreait / firebase-php

Unofficial Firebase Admin SDK for PHP
https://firebase-php.readthedocs.io/
MIT License
2.27k stars 431 forks source link

FCM Error: Operation is not implemented, or supported, or enabled - Using Firebase Admin SDK for PHP #926

Closed sarup closed 2 months ago

sarup commented 2 months ago

Describe the bug

Hi Guys,

I have been using Firebase Admin SDK for PHP for FCM V1. Today it suddenly shows issues. I am sending a push in a batch of 500. As per response logs very few are getting delivered but most of them fail and showing error "Operation is not implemented, or supported, or enabled".

Can you guys help what needs to be changed?

Installed packages

https://firebase-php.readthedocs.io/en/stable/cloud-messaging.html

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

PHP version and extensions

PHP 8.2.17 (cli) (built: Mar 16 2024 08:41:44) (NTS)

Steps to reproduce the issue.

$message = new RawMessageFromArray([ 'notification' => [ 'title' => $header, 'body' => $alertString, ], 'data' => [ 'type' => $payloadSection, 'message' => $alertString, 'section' => $payloadSection, 'url' => $link, 'my-attachment' => $story_image, ], 'apns' => [ 'payload' => [ 'aps' => [ 'mutable-content' => 1,] ] ] ]);

//In a loop for 500 users; $sendReport = $messaging->sendMulticast($message, $tokensarray);

Error message/Stack trace

Snap of log:
_Successful sends: 83
Failed sends: 417
Operation is not implemented, or supported, or enabled._

Additional information

No response

sarup commented 2 months ago

Is there any support for the sendEachForMulticast method?

jeromegamez commented 2 months ago

You didn't provide all the information the issue template asked for - please share the output of composer show

Please make sure you have installed the latest version (7.14 at the time of this message). Older versions are still using the deprecated/shut-down legacy FCM API.

sarup commented 2 months ago

Hi jeromegamez,

Heres the composer show output:

beste/clock 2.3.1 A collection of Clock implementations beste/json 1.5.0 A simple JSON helper to decode and encode JSON brick/math 0.12.1 Arbitrary-precision arithmetic library fig/http-message-util 1.1.5 Utility classes and constants for use with PSR-7 (psr/http-message) firebase/php-jwt 6.10.1 A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec. google/apiclient 2.17.0 Client library for Google APIs google/apiclient-services 0.372.0 Client library for Google APIs google/auth 1.42.0 Google Auth Library for PHP google/cloud-core 1.59.1 Google Cloud PHP shared dependency, providing functionality useful to all components. google/cloud-storage 1.42.1 Cloud Storage Client for PHP google/common-protos 4.8.3 Google API Common Protos for PHP google/gax 1.34.1 Google API Core for PHP google/grpc-gcp 0.4.0 gRPC GCP library for channel management google/longrunning 0.4.3 Google LongRunning Client for PHP google/protobuf 4.28.0 proto library for PHP grpc/grpc 1.57.0 gRPC library for PHP guzzlehttp/guzzle 7.9.2 Guzzle is a PHP HTTP client library guzzlehttp/promises 2.0.3 Guzzle promises library guzzlehttp/psr7 2.7.0 PSR-7 message implementation that also provides common utility methods kreait/firebase-php 6.9.6 Firebase Admin SDK kreait/firebase-tokens 3.0.3 A library to work with Firebase tokens lcobucci/clock 3.2.0 Yet another clock abstraction lcobucci/jwt 4.3.0 A simple library to work with JSON Web Token and JSON Web Signature monolog/monolog 3.7.0 Sends your logs to files, sockets, inboxes, databases and various web services mtdowling/jmespath.php 2.8.0 Declaratively specify how to extract elements from a JSON document paragonie/constant_time_encoding 3.0.0 Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16) paragonie/random_compat 9.99.100 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7 phpseclib/phpseclib 3.0.41 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc. psr/cache 3.0.0 Common interface for caching libraries psr/clock 1.0.0 Common interface for reading the clock. psr/http-client 1.0.3 Common interface for HTTP clients psr/http-factory 1.1.0 PSR-17: Common interfaces for PSR-7 HTTP message factories psr/http-message 2.0 Common interface for HTTP messages psr/log 3.0.1 Common interface for logging libraries ralouphie/getallheaders 3.0.3 A polyfill for getallheaders. ramsey/collection 2.0.0 A PHP library for representing and manipulating collections. ramsey/uuid 4.7.6 A PHP library for generating and working with universally unique identifiers (UUIDs). riverline/multipart-parser 2.1.2 One class library to parse multipart content with encoding and charset support. rize/uri-template 0.3.8 PHP URI Template (RFC 6570) supports both expansion & extraction stella-maris/clock 0.1.7 A pre-release of the proposed PSR-20 Clock-Interface symfony/deprecation-contracts 3.5.0 A generic function and convention to trigger deprecation notices symfony/polyfill-mbstring 1.31.0 Symfony polyfill for the Mbstring extension symfony/polyfill-php80 1.31.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions symfony/polyfill-php81 1.31.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions

jeromegamez commented 2 months ago

Here's the culprit:

"kreait/firebase-php": "6.9.6"

Please add/replace

"kreait/firebase-php": "^7.14"

in your composer.json file and do a composer update --with-all-dependencies

sarup commented 2 months ago

Thank you so much jeromegamez! It worked, delivery rates are better now.