kreait / firebase-bundle

A Symfony Bundle for the Firebase PHP Admin SDK
https://github.com/kreait/firebase-php
MIT License
142 stars 27 forks source link

Empty report in case of sendAll and sendmulticast #65

Closed asif-ca closed 1 week ago

asif-ca commented 1 week ago

Describe the bug

@jeromegamez I am using sendAll and sendMulticast "kreait/firebase-php": "^5.26" in laravel 6 and PHP 7.4 (that's the only supported package version with this env) and I am getting an empty report.

Kreait\Firebase\Messaging\MulticastSendReport {#4208 ▼
  -items: []
}

and the send method is working fine which sends messages one by one (so not scalable) with same package version

is there any workaround for this?

Installed packages

"require": {
        "php": "^7.2",
        "brozot/laravel-fcm": "^1.3",
        "fideloper/proxy": "^4.0",
        "intervention/image": "^2.5",
        "kreait/firebase-php": "^5.26",
        "laravel/framework": "^6.2",
        "laravel/socialite": "^5.1",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^1.2",
        "laravelcollective/html": "^6.0",
        "league/flysystem-aws-s3-v3": "~1.0",
        "nadeem2462/sendpulselaraveldriver": "master@dev",
        "sendpulse/rest-api": "^1.0",
        "stripe/stripe-php": "^7.113",
        "yajra/laravel-datatables-oracle": "~9.0"
    },

PHP version and extensions

PHP 7.4

composer               2.5.8    Composer package
composer-plugin-api    2.3.0    The Composer Plugin API
composer-runtime-api   2.2.2    The Composer Runtime API
ext-bcmath             7.4.33   The bcmath PHP extension
ext-bz2                7.4.33   The bz2 PHP extension
ext-calendar           7.4.33   The calendar PHP extension
ext-ctype              7.4.33   The ctype PHP extension
ext-curl               7.4.33   The curl PHP extension
ext-date               7.4.33   The date PHP extension
ext-dom                20031129 The dom PHP extension
ext-exif               7.4.33   The exif PHP extension
ext-fileinfo           7.4.33   The fileinfo PHP extension
ext-filter             7.4.33   The filter PHP extension
ext-ftp                7.4.33   The ftp PHP extension
ext-gd                 7.4.33   The gd PHP extension
ext-gettext            7.4.33   The gettext PHP extension
ext-hash               7.4.33   The hash PHP extension
ext-iconv              7.4.33   The iconv PHP extension
ext-json               7.4.33   The json PHP extension
ext-libxml             7.4.33   The libxml PHP extension
ext-mbstring           7.4.33   The mbstring PHP extension
ext-mysqli             7.4.33   The mysqli PHP extension
ext-mysqlnd            0        The mysqlnd PHP extension (actual version: mysqlnd 7.4.33)
ext-openssl            7.4.33   The openssl PHP extension
ext-pcre               7.4.33   The pcre PHP extension
ext-pdo                7.4.33   The PDO PHP extension
ext-pdo_mysql          7.4.33   The pdo_mysql PHP extension
ext-pdo_sqlite         7.4.33   The pdo_sqlite PHP extension
ext-phar               7.4.33   The Phar PHP extension
ext-readline           7.4.33   The readline PHP extension
ext-redis              5.3.7    The redis PHP extension
ext-reflection         7.4.33   The Reflection PHP extension
ext-session            7.4.33   The session PHP extension
ext-simplexml          7.4.33   The SimpleXML PHP extension
ext-spl                7.4.33   The SPL PHP extension
ext-tokenizer          7.4.33   The tokenizer PHP extension
ext-xml                7.4.33   The xml PHP extension
ext-xmlreader          7.4.33   The xmlreader PHP extension
ext-xmlwriter          7.4.33   The xmlwriter PHP extension
ext-zip                1.15.6   The zip PHP extension
ext-zlib               7.4.33   The zlib PHP extension
lib-bz2                1.0.8    The bz2 library
lib-curl               7.70.0   The curl library
lib-curl-libssh2       1.9.0    curl libssh2 version
lib-curl-openssl       1.1.1.19 curl OpenSSL version (1.1.1.19)
lib-curl-zlib          1.2.12   curl zlib version
lib-date-timelib       2018.04  date timelib version
lib-date-zoneinfo      2022.1   zoneinfo ("Olson") database for date
lib-fileinfo-libmagic  537      fileinfo libmagic version
lib-gd                 2.0.35   The gd library
lib-gd-freetype        2.9.1    freetype version for gd
lib-gd-libjpeg         9.0      libjpeg version for gd
lib-gd-libpng          1.6.34   libpng version for gd
lib-gd-libxpm          3.5.12   libxpm version for gd
lib-iconv              1.16     The iconv library
lib-libxml             2.9.10   libxml library version
lib-mbstring-libmbfl   1.3.2    mbstring libmbfl version
lib-mbstring-oniguruma 6.9.5    mbstring oniguruma version
lib-openssl            1.1.1.19 OpenSSL 1.1.1s  1 Nov 2022
lib-pcre               10.35    The pcre library
lib-pcre-unicode       13.0.0   PCRE Unicode version support
lib-pdo_sqlite-sqlite  3.31.1   The pdo_sqlite-sqlite library
lib-zip-libzip         1.7.1    The zip-libzip library
lib-zlib               1.2.12   The zlib library
php                    7.4.33   The PHP interpreter
php-64bit              7.4.33   The PHP interpreter, 64bit
php-ipv6               7.4.33   The PHP interpreter, with IPv6 support
php-zts                7.4.33   The PHP interpreter, with Zend Thread Safety

Steps to reproduce the issue.

# Insert the commands issued in the terminal if they are needed
# to reproduce the issue. Otherwise, delete this code block.
// Insert the PHP code to reproduce the issue. Please ensure that it is code that
// can be copy pasted to reproduce it.

Error message/Stack trace

Empty resport and not sending notifications

Additional information

No response

jeromegamez commented 1 week ago

Version 5.x isn't supported anymore. Firebase has shut down the legacy FCM API that version 5.x and 6.x rely on, so there's no other way than to upgrade to version 7.x to send batch requests. The send() method already uses the non-deprecated/shut-down endpoint.

You can find possible workarounds by searching the issues and discussions - in short: if you can't upgrade, you could use background workers to send the messages one by one.

Sorry that I don't have better news. You could, of course, pay me with a one-time donation, first to look into if it's even possible, then to implement it, but I have to say, given how old the 5.x and 6.x releases are, it's not going to be cheap 😅