Skip to content

Commit

Permalink
Fix #18: Do not pass as notification image
Browse files Browse the repository at this point in the history
  • Loading branch information
luke- committed Apr 23, 2023
1 parent b5affa5 commit a2a5b9e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

- Enh: Validator for GoogleService Account JSON
- Enh: Show/Hide Mobile App Opener Dialog after Login/Logout
- Fix #18: Do not pass `SiteIcon` as notification image

2.0.0-beta.1 (March 28, 2023)
-----------------------------
Expand Down
5 changes: 3 additions & 2 deletions driver/FcmLegacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace humhub\modules\fcmPush\driver;

use humhub\modules\fcmPush\components\SendReport;
use humhub\modules\web\pwa\widgets\SiteIcon;
use Yii;
use yii\httpclient\Client;
use humhub\modules\fcmPush\models\ConfigureForm;
Expand Down Expand Up @@ -33,13 +34,13 @@ public function processCloudMessage(array $tokens, string $title, string $body,
"notification" => [
"title" => $title,
"body" => $body,
"icon" => $imageUrl,
"icon" => SiteIcon::getUrl(180),
"click_action" => $url
],
"data" => [
"title" => $title,
"body" => $body,
"icon" => $imageUrl,
"icon" => SiteIcon::getUrl(180),
"url" => $url
],
"registration_ids" => $tokens
Expand Down
4 changes: 3 additions & 1 deletion driver/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use humhub\modules\fcmPush\components\SendReport;
use humhub\modules\fcmPush\Module;
use humhub\modules\notification\models\Notification;
use humhub\modules\web\pwa\widgets\SiteIcon;
use Yii;
use yii\httpclient\Client;
use humhub\modules\fcmPush\models\ConfigureForm;
Expand Down Expand Up @@ -34,7 +35,8 @@ public function processCloudMessage(array $tokens, string $title, string $body,
'tokens' => $tokens,
'title' => $title,
'body' => $body,
'iconUrl' => $imageUrl,
'imageUrl' => $imageUrl,
'iconUrl' => SiteIcon::getUrl(180),
'url' => $url,
'notificationCount' => $notificationCount
];
Expand Down
2 changes: 1 addition & 1 deletion services/MessagingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function processNotification(BaseNotification $baseNotification, User $us
Yii::$app->name,
$baseNotification->text(),
Url::to(['/notification/entry', 'id' => $baseNotification->record->id], true),
SiteIcon::getUrl(180),
null,
NotificationHumHub::findUnseen($user)->count()
);
}
Expand Down

0 comments on commit a2a5b9e

Please sign in to comment.