humhub / fcm-push

Enables your users to receive push notifications from your network.
5 stars 7 forks source link

Unrecognized format error #11

Closed BarryJohnson01 closed 1 year ago

BarryJohnson01 commented 2 years ago

I have installed and configured the fcm-push module. I use firebase on a number of websites with the same credentials. What I notice is that the browser doesn't asks for permissions, which it does for the other websites. So I assume the module is not working. I checked the log and found the following error. By the way... it would be nice to see some kind of test result, or a test button to check the API connection.

Error message in HumHub log: yii\base\InvalidParamException: Unrecognized format '' in /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2-httpclient/src/Client.php:178 Stack trace:

0 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2-httpclient/src/Response.php(199): yii\httpclient\Client->getParser(NULL)

1 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2-httpclient/src/Response.php(33): yii\httpclient\Response->getParser()

2 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/base/Component.php(140): yii\httpclient\Response->getData()

3 /var/www/vhosts/lostboysworld.org/protected/modules/fcm-push/components/FcmApi.php(69): yii\base\Component->__get('data')

4 /var/www/vhosts/lostboysworld.org/protected/modules/fcm-push/components/NotificationTargetProvider.php(32): humhub\modules\fcmPush\components\FcmApi->sendNotification(Object(humhub\modules\user\notifications\Followed), Object(humhub\modules\user\models\User))

5 /var/www/vhosts/lostboysworld.org/protected/humhub/modules/notification/targets/MobileTarget.php(56): humhub\modules\fcmPush\components\NotificationTargetProvider->handle(Object(humhub\modules\user\notifications\Followed), Object(humhub\modules\user\models\User))

6 /var/www/vhosts/lostboysworld.org/protected/humhub/modules/notification/targets/BaseTarget.php(161): humhub\modules\notification\targets\MobileTarget->handle(Object(humhub\modules\user\notifications\Followed), Object(humhub\modules\user\models\User))

7 /var/www/vhosts/lostboysworld.org/protected/humhub/modules/notification/components/NotificationManager.php(89): humhub\modules\notification\targets\BaseTarget->send(Object(humhub\modules\user\notifications\Followed), Object(humhub\modules\user\models\User))

8 /var/www/vhosts/lostboysworld.org/protected/humhub/modules/notification/components/NotificationManager.php(108): humhub\modules\notification\components\NotificationManager->sendBulk(Object(humhub\modules\user\notifications\Followed), Object(humhub\modules\user\components\ActiveQueryUser))

9 /var/www/vhosts/lostboysworld.org/protected/humhub/modules/notification/jobs/SendNotification.php(41): humhub\modules\notification\components\NotificationManager->send(Object(humhub\modules\user\notifications\Followed), Object(humhub\modules\user\models\User))

10 /var/www/vhosts/lostboysworld.org/protected/humhub/modules/queue/ActiveJob.php(33): humhub\modules\notification\jobs\SendNotification->run()

11 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2-queue/src/Queue.php(246): humhub\modules\queue\ActiveJob->execute(Object(humhub\modules\queue\driver\MySQL))

12 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2-queue/src/cli/Queue.php(162): yii\queue\Queue->handleMessage('473', 'O:49:"humhub\mo...', '300', '1')

13 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2-queue/src/cli/Command.php(146): yii\queue\cli\Queue->execute('473', 'O:49:"humhub\mo...', '300', '1', '36931')

14 [internal function]: yii\queue\cli\Command->actionExec('473', '300', '1', '36931')

15 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)

16 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)

17 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction('exec', Array)

18 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction('exec', Array)

19 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction('queue/exec', Array)

20 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction('queue/exec', Array)

21 /var/www/vhosts/lostboysworld.org/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest(Object(yii\console\Request))

22 /var/www/vhosts/lostboysworld.org/protected/yii(29): yii\base\Application->run()

23 {main}

marc-farre commented 2 years ago

It means that your Server Key is not correct. I should start with AAAA as you can see on this screenshot (on the bottom right, the token column): image